Jump to content


Photo

Refinements HLAs, modularized and on BG2EE


52 replies to this topic

#41 ALIEN

ALIEN
  • Member
  • 735 posts

Posted 15 August 2016 - 11:25 AM

I don't remember if I asked you about it in the past: did you take look at patches from https://github.com/B...ack/refinements ? Those aren't needed anymore?


Edited by ALIEN, 15 August 2016 - 11:25 AM.

You cannot have progress without changes...

 

 


#42 subtledoctor

subtledoctor
  • Member
  • 416 posts

Posted 15 August 2016 - 01:34 PM

The only fix I see there is the broken kit.ids patch. I apply the fix to kit.ids, but I'm using the most recent version suggested by Wisp and Camdawg in March/April of this year. So if that's it, my version should not need anything from the BWFixPack.

#43 subtledoctor

subtledoctor
  • Member
  • 416 posts

Posted 15 August 2016 - 05:57 PM

Okay!  I did that pretty quickly.  Here is rc8:

https://github.com/s...eleases/tag/0.8

 

This adds support for mod kits, as I described above.  After patching the base HLA tables for each vanilla kit and multiclass combo it runs a routine that looks for any kits added later, patching their HLA tables with the same changes applied to the trueclass kits.  The code looks like this:

 

ACTION_IF ENGINE_IS ~soa tob bgt~ BEGIN
  OUTER_SET kitlist_row = 31
END
ACTION_IF GAME_IS ~bgee bg2ee eet iwdee~ BEGIN
  OUTER_SET kitlist_row = 40
END
COPY_EXISTING ~kitlist.2da~ ~override~
//  COUNT_2DA_ROWS num_rows
  COUNT_2DA_COLS num_cols
  READ_2DA_ENTRIES_NOW ~r2en_kitlist~ num_cols
  PATCH_IF (%r2en_kitlist% >= %kitlist_row%) BEGIN
    FOR (row = %kitlist_row%; row < r2en_kitlist; row += 1) BEGIN
      READ_2DA_ENTRY_FORMER ~r2en_kitlist~ row 1 kitlist_name
      READ_2DA_ENTRY_FORMER ~r2en_kitlist~ row 8 class_num
      PATCH_IF (class_num == 12) BEGIN // ranger
        INNER_ACTION BEGIN
            LAF action_remove_hla STR_VAR kit_name = EVAL ~%kitlist_name%~ remove_ability = ~GA_SPCL901~ END
            LAF action_remove_hla STR_VAR kit_name = EVAL ~%kitlist_name%~ remove_ability = ~GA_SPCL902~ END
            LAF action_remove_hla STR_VAR kit_name = EVAL ~%kitlist_name%~ remove_ability = ~GA_SPCL903~ END
            LAF action_add_hla STR_VAR kit_name = EVAL ~%kitlist_name%~ ability = ~AP_TG#TOUG~ num_allowed = ~5~ END
            LAF action_add_hla STR_VAR kit_name = EVAL ~%kitlist_name%~ ability = ~GA_TG#ENDU~ num_allowed = ~1~ END
            LAF action_add_hla STR_VAR kit_name = EVAL ~%kitlist_name%~ ability = ~AP_TG#AMBI~ num_allowed = ~1~ END
            LAF action_add_hla STR_VAR kit_name = EVAL ~%kitlist_name%~ ability = ~AP_TB#HATE~ num_allowed = ~1~ END
        END
      END
    END
  END
BUT_ONLY

 

 

So, this should definitively be installed *after* any kit mods.  Note, this uses my table-patching functions, so if there is a mod kit like a Revised Archer or something, with crazy HLA Called Shots and other stuff relating to ranged combat, all that that will still be there.  That Revised Archer kit will have its own custom HLAs but will also get access to Toughness, Endurance, Ambidexterity, and Racial Nemesis.

 

A note about Rogue Rebalancing: I have suggested that RR adopt these HLA functions in order to be compatible with other HLA-changing mods that use them, but it seems that such a major change in the code is not in the cards for RR.  The thing is, no matter what kind of table-changing code it uses, the RR thief and bard HLAs currently do NOT apply to mod kits.  I cannot fix that from here, in the Refinements code.  What I can do is, in the case of mod kits, where Refinements would ordinarily defer to RR HLAs if they are detected?  In those cases Refinements will *not* defer to RR (which isn't in those tables anyway).  So for mod kits, all Refinements HLAs will be installed regardless of whether RR is present.  It's not perfect (perfect would be RR applying something like the code I posted above), but the important thing is that, if you install Refinements, no kit will be stuck with the stupid vanilla HLA selection.

 

Any feedback is welcome on this point!


Edited by subtledoctor, 15 August 2016 - 06:00 PM.


#44 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3325 posts

Posted 16 August 2016 - 01:34 PM

(Of course that would mean only kits that get Use Scrolls would get UAI - so not the Assassin or Bounty Hunter. But you could give them Use Scrolls as well - just copy the code from the Swashbuckler.)


That was a technical limitation that was solved with ToBex, related to how unusabilities match with those kit's thieving skill points. It should already been removed, and can surely be removed from the EE implementation (which doesn't use unusabilities anyway).
Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.

#45 subtledoctor

subtledoctor
  • Member
  • 416 posts

Posted 17 October 2016 - 07:01 AM

Sorry, I missed this post 2 months ago. Does it mean that you would like Assassins and Bounty Hunters to get access to Use Scrolls? Should be easy enough to implement if so. (For the EE games at least.)

#46 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3325 posts

Posted 17 October 2016 - 10:05 AM

Yes, absolutely. "Traditional" Refinements already enables Use Scrolls and Scribe Scrolls for TobEx users (even if it isn't apparent from the 2DA files, and checked in a... creative way in the TP2). See the changelog: 
 12 February 2011 - Version 3.30:

Integration with ToBEx: Barbarian -> Mage, Barbarian -> Thief, Wild Mage -> Thief compatibility, Bounty Hunters and Assassins can get Use Scrolls.

the HLA documentation:
//2.7.1: Assassin

Table:

-Set Spike Trap 
-Set Exploding Trap
-Set Time Trap
-Assassination
-Cripple#
-Nerve Poison*              (requires: Alchemy)
-Evasion#
-Greater Evasion            (requires: Evasion#)
-Avoid Death#               (requires: Evasion#) 
-Alchemy
-Brew Poison*               (requires: Alchemy)

Only if you installed ToBEx:
-Use Scrolls#  
-Scribe Scrolls#            (requires: Use Scrolls#)

<...>

//2.7.2: Bounty Hunter

Table:

-Set Spike Trap 
-Set Exploding Trap
-Set Time Trap
-Set Toxic Trap*
-Assassination
-Cripple#
-Evasion#
-Greater Evasion            (requires: Evasion#)
-Avoid Death#               (requires: Evasion#) 
-Alchemy
-Tracking*

Only if you installed ToBEx:
-Use Scrolls#  
-Scribe Scrolls#            (requires: Use Scrolls#)

and the TP2:
COPY ~refinements/Hlab/Thief/copy~	  	~override~
// ToBEx Assassin and Bounty Hunter
ACTION_IF FILE_EXISTS ~bgmain.exe~ THEN BEGIN
  COPY_EXISTING ~luth2.2da~ ~override~
                ~luth3.2da~ ~override~
    SET_2DA_ENTRY 11 1 10 AP_TG#USSC
    SET_2DA_ENTRY 11 4 10 1
    SET_2DA_ENTRY 11 5 10 99
    SET_2DA_ENTRY 11 6 10 1
    SET_2DA_ENTRY 12 1 10 GA_LI#SCRT
    SET_2DA_ENTRY 12 4 10 1
    SET_2DA_ENTRY 12 5 10 99
    SET_2DA_ENTRY 12 6 10 1
    SET_2DA_ENTRY 12 7 10 AP_TG#USSC
END

Edited by the bigg, 17 October 2016 - 10:07 AM.

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.

#47 subtledoctor

subtledoctor
  • Member
  • 416 posts

Posted 17 October 2016 - 12:36 PM

Got it. Cool, I'll add that when I get the chance. I need t find some time to look at SwashImoen as well, someone said it is buggy on BG2EE.

#48 Salk

Salk
  • Member
  • 1182 posts

Donator

Posted 04 January 2017 - 05:15 AM

subtledoctor,

 

I was reading the ReadMe (and good thing I did, but I urge you to change the header from the old 3.11 to 4 Beta 8 or so because I was thinking I was dealing with the old file) and noticed this addition:

 

"For the moment, the multiclass HLAs do not install..."

 

Tell me I am not interpreting right and you do not mean to say that there is no Refinements HLA for multiclasses?!

 

It's not be a small detail for people like me that play with a multiclass character... :blink:


Edited by Salk, 04 January 2017 - 05:15 AM.


#49 subtledoctor

subtledoctor
  • Member
  • 416 posts

Posted 08 January 2017 - 01:56 PM

Youch, I haven't looked at this stuff in about half a year. I still need to give Use Scrolls to Assassins and Bounty Hunters. And clearly the readme needs a few updates!

Last I recall, multiclasses are working fine. Up through about rc4 I had not added code to add the multiclass HLAs. (When each class is optional, it gets complicated - if you install wizard HLAs but not thief HLAs, what to do about the mage/thief table?) However, I have since included code that handles these possibilities, so multiclasses should be working fine.

I'll put a bit of time into this, put out rc9 and fix the readme, when I can.

#50 subtledoctor

subtledoctor
  • Member
  • 416 posts

Posted 15 June 2017 - 01:50 PM

Okay, I'm going to really embrace the fact that this is still labeled "beta," and darn well treat it like a beta.

I have completely revamped the EE version of Use Scrolls. The new code is about 10x simpler than the old code, and that in turn was about 10x simpler than the old BGT code. The problem was, even with the fun new stuff in the EE engine, there were still problems with edge cases - cleric/thieves using divine scrolls, normal thieves using green scrolls, etc.

So I've done something fairly radical: identified all scrolls that were already usable by thieves, and changed their underlying "item type" to potions.

I don't think this will break anything; potions are used from item quickslots, they can have any kinds of targeting, and they can use any kind of projectile AFAIK. So a potion that looks and acts like a scroll, should still look and act like a scroll.

Then, I take the remaining scrolls, which are not usable by thieves, and make them usable by thieves. Then I apply an opcocde 181 effect in thieves' clab table, preventing them from using any scrolls. Since green scrolls are not considered "scrolls," they are exempt from this prohibition. Finally, when you take the "Use Magical Devices" HLA, it cancels the spell with that 181 effect, so your thief can now use any scroll in the game.

Yes - I said "Use Magical Devices." Because two nice benefits to this change are 1) it applies to divine scrolls as well as arcane scrolls, without interfering with their use by cleric/thieves; and 2) it also applies to wands. So a thief taking this HLA can now use any kind of wand as well as any scroll. A nice little boost, I think.

This is in v4 rc13

Cheers. Let me know if this horribly ruins anything. Can always revert and try a different technique.

EDIT - changed to using "miscellaneous" instead of potions in 4b13, so you don't get the option to "drink" green scrolls.

Edited by subtledoctor, 18 June 2017 - 08:41 AM.


#51 Higara

Higara
  • Member
  • 22 posts

Posted 25 July 2017 - 04:25 PM

So I am working on trying to fix the Rune of Immunity spell as it has broken. What are the effects that are applied to cause the spell to work. Right now in the extended effects there are a lot of dispel magic effects and secret word effects with unknown opcodes.



#52 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 4179 posts

Posted 25 July 2017 - 05:59 PM

... with unknown opcodes.
Into what version of the game did you apply the mod into ? An old EE game perhaps(not 2.3.something), as that could be the problem, if you ahve an old game as the patches added opcodes... or do you just have an old moding tool perhaps ? Near Infinity circa 2012, not the current up to date one uploaded May 30th 2017...

Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#53 subtledoctor

subtledoctor
  • Member
  • 416 posts

Posted 29 July 2017 - 03:43 PM

I noticed that the Rune of Immunity doesn't always work... but I can't figure out why. The spell seems to be in fine shape. I'll take a closer look when I can.



Reply to this topic