Hmmm I can get Weidu to do the math and set the right value for a kit to make it (theoretically) have Necromancer characteristics. But, the output is in decimal integer format (4135) and it seems like kitlist.2da and kit.ids probably want it in hex format (0x1027)
Anyone know how to do that conversion in Weidu before using SET_2DA_ENTRY to enter the value into the tables?
Is it actually necessary?
Add a space at the end of the text: SET_2DA_ENTRY x y z ~0x1027 ~
Not an answer to the OP's problem but from what I get there is no way of reproducing the malus to enemy saving throws a specialist gets on a custom kit? There's no OPcode doing that but can one not play with some 2da tables to reproduce the effect?
Sorry, the issue is, the value in my variable is 4135. How do I derive 1027 from 4135?
Once I have 1027 in the variable, writing it into the 2da table isn't a problem.
Sorry, misunderstood:
DEFINE_PATCH_FUNCTION INT_TO_HEX INT_VAR value = 0 RET hex_string BEGIN
DEFINE_ARRAY hex BEGIN ~0~ ~1~ ~2~ ~3~ ~4~ ~5~ ~6~ ~7~ ~8~ ~9~ ~A~ ~B~ ~C~ ~D~ ~E~ ~F~ END
TEXT_SPRINT hex_string ~~
WHILE value > 0 BEGIN
i = value BAND 0xf
value = value / 16
TEXT_SPRINT string EVAL $hex(~%i%~)
TEXT_SPRINT hex_string ~%string%%hex_string%~
END
TEXT_SPRINT hex_string ~0x%hex_string%~
END
The file is a mess of functionality, however, I could not find any combined value that gave the specialists save/learn% bonus/penalties to a kit, only usability/spellselection.
For most kits, (KITIDS - 0x4000) dictates the row# of kitlist.2da that it uses. KITIDS 0x4016 uses the entry for ABJURER, since it occupies row# 22(0x16), but it still doesn't take on any hardcoded aspects of the Abjurer, just what is listed in KITLIST.2da (strings, CLAB, usability, baseclass, proficiency).
When Specialists, Wildmage, or Barbarian IDS are contained with the KITIDS, the row doesn't always matter, often inheriting aspects of the specialist it contains.
0x4027 - 0x4000 = 0x27 = row 39 0x4047 - 0x4000 = 0x47 = row 71 0x4040 - 0x4000 = 0x40 = MAGESCHOOL_ABJURER, gains the Abjurer's usability/spellselection 0x1040 = MAGESCHOOL_ABJURER + MAGESCHOOL_NECROMANCER, has the Abjurer and Necromancer's usability/spellselection.
Then it breaks: 0x5040 = TRUECLASS + MAGESCHOOL_ABJURER + MAGESCHOOL_NECROMANCER. Every time I load/start the game the usability/spellselection is different.
The kit installed just fine, the usability flag works perfectly and the kit name appeared on the character sheet with no problem, but I did a test to see if I was gaining the 15% bonus to learn necromancy spells (one of the hardcoded features).
Using a Undead Slayer with 18 Intelligence (which means 85% to learn spells - 100% for Necromancy, 70% for others) I had approximately the same number of failures copying scrolls from Necromancy and Evocation.
Also, the save penalty doesn't apply. Phlydia's save versus spells value is 10 and she was able to resist a Contagion rolling a 10.
Sorry about such a late feedback, yesterday was my wife's day off (aka my day away from the PC).
Comments
SET_2DA_ENTRY x y z ~0x1027 ~
As soon as I get the results I'll give feedback to you guys.
For most kits, (KITIDS - 0x4000) dictates the row# of kitlist.2da that it uses. KITIDS 0x4016 uses the entry for ABJURER, since it occupies row# 22(0x16), but it still doesn't take on any hardcoded aspects of the Abjurer, just what is listed in KITLIST.2da (strings, CLAB, usability, baseclass, proficiency).
When Specialists, Wildmage, or Barbarian IDS are contained with the KITIDS, the row doesn't always matter, often inheriting aspects of the specialist it contains.
0x4027 - 0x4000 = 0x27 = row 39
0x4047 - 0x4000 = 0x47 = row 71
0x4040 - 0x4000 = 0x40 = MAGESCHOOL_ABJURER, gains the Abjurer's usability/spellselection
0x1040 = MAGESCHOOL_ABJURER + MAGESCHOOL_NECROMANCER, has the Abjurer and Necromancer's usability/spellselection.
Then it breaks:
0x5040 = TRUECLASS + MAGESCHOOL_ABJURER + MAGESCHOOL_NECROMANCER. Every time I load/start the game the usability/spellselection is different.
I'm home now. Will try this code in a few hours.
The kit installed just fine, the usability flag works perfectly and the kit name appeared on the character sheet with no problem, but I did a test to see if I was gaining the 15% bonus to learn necromancy spells (one of the hardcoded features).
Using a Undead Slayer with 18 Intelligence (which means 85% to learn spells - 100% for Necromancy, 70% for others) I had approximately the same number of failures copying scrolls from Necromancy and Evocation.
Also, the save penalty doesn't apply. Phlydia's save versus spells value is 10 and she was able to resist a Contagion rolling a 10.
Sorry about such a late feedback, yesterday was my wife's day off (aka my day away from the PC).
Has anyone asked Beamdog if they could de-hardcode that? or alternatively create OP codes so that we may reproduce these functions?
One of the features (save versus specific school) is already available, but only for BG(2)EE.
De-hardcoding now would only enlarge the chasm between IWDEE and BG(2)EE in terms of modding.
I spend more time thinking "how can I make this thing work with BG(2)EE, EET and IWDEE" than actually modding.
But it's a great idea. Too bad Beamdog is putting IWDEE aside.