Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

New Premium Module: Tyrants of the Moonsea! Read More
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

[Question] Specialists Mages

2»

Comments

  • subtledoctorsubtledoctor Member Posts: 11,463
    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?

  • kjeronkjeron Member Posts: 2,132

    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 ~

  • WarChiefZekeWarChiefZeke Member Posts: 1,862
    So...if I were to EEkeeper a specialist mage into a multiclass because im filthy cheating scum, would that give me all the specialist bonuses?

  • kjeronkjeron Member Posts: 2,132

    So...if I were to EEkeeper a specialist mage into a multiclass because im filthy cheating scum, would that give me all the specialist bonuses?

    Gnome Illusionists/Multi's already work this way.

  • subtledoctorsubtledoctor Member Posts: 11,463
    kjeron said:

    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 ~
    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.

  • subtledoctorsubtledoctor Member Posts: 11,463

    So...if I were to EEkeeper a specialist mage into a multiclass because im filthy cheating scum, would that give me all the specialist bonuses?

    Sure. But you might rather use my NPC_EE mod, and then every time you create a multiclass mage, you will have an innate ability allowing you to choose a specialization. No need to muck about with EEKeeper every time.

  • ArunsunArunsun Member Posts: 1,581
    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?

  • kjeronkjeron Member Posts: 2,132


    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

  • subtledoctorsubtledoctor Member Posts: 11,463
    edited July 2017
    Okay @Raduziel I have ZERO idea if this will actually work. But I hope it will. Add this code immediately after your kit is installed - before any other kits are installed. So, if you have a section of code for the "fl#add_kit_ee" function, paste this after it. And change the kit name to the name of your kit (ADD_KIT ~...~)

    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
    END

    COPY_EXISTING ~kitlist.2da~ ~override~
    COUNT_2DA_COLS cols
    READ_2DA_ENTRIES_NOW rows cols
    FOR (row = 1; row < rows; ++row) BEGIN
    READ_2DA_ENTRY_FORMER rows row 1 ~kit_name~
    READ_2DA_ENTRY_FORMER rows row 9 kit_ids
    PATCH_IF (~%kit_name%~ STRING_EQUAL_CASE ~D5_CORSA~) BEGIN // REPLACE THIS WITH YOUR KIT
    LPF INT_TO_HEX INT_VAR value = %kit_ids% RET hex_string END
    SPRINT ~old_hex_string~ ~%hex_string%~
    SET new_ids = (%kit_ids% - 12288)
    LPF INT_TO_HEX INT_VAR value = %new_ids% RET hex_string END
    SPRINT ~new_hex_string~ ~%hex_string%~
    SET_2DA_ENTRY row 9 cols ~0x0000%new_hex_string%~
    INNER_ACTION BEGIN
    COPY_EXISTING ~kit.ids~ ~override~
    REPLACE_TEXTUALLY ~%old_hex_string%~ ~%new_hex_string%~
    BUT_ONLY
    END
    END
    END
    BUT_ONLY
    That will change your kit's KITIDS value from "0x00004xyz" to "0x00001xyz" which should mean that it takes on the hard-coded characteristics of the Necromancer specialist kit. I will leave the actual testing of the saving throw penalties etc. to you.

    If this does work, it will be amazing, because it will open up the door for all sort of Necromancer subkits, Illusionist subkits, etc., which would probably be of interest to @Aquadrizzt and lead to cool stuff in Tome & Blood. If it works. Which it might. Maybe. (And note, even if it does, there will be issues with using this for abjurers, conjurers, diviners and enchanters, because this method would make the new kit duplicate the KITIDS value of another kit, which means any such mod would have to do some serious jiujitsu on the values...)

    Raduziel
  • RaduzielRaduziel Member Posts: 4,716
    I'll try this as soon as I get home, but if I can't understand a thing of what was done means that it's probably right.

    As soon as I get the results I'll give feedback to you guys.

  • subtledoctorsubtledoctor Member Posts: 11,463
    edited July 2017
    Okay I ran a quick test and holy crap I think it works.

    Methodology:
    Made a new wizard kit and installed it to SoD. Manually changed the KITIDS value from 4027 to 1027 in kitlist.2da and kit.ids. Created a character with my new kit. Results:
    - Necromancy spells are highlighted in green in character selection and you have to choose one to learn and memorize.
    - I consoled scrl90 (invisibility) into my inventory, and it was bordered on red and I could not learn the spell. (I could cast the spell however, because my kits has the trueclass usability flag. Make sure your Necromancer kit has the Necromancer usability flag.)

    This is SUPER cool, but it also implies a major issue: I think this means that ten mod kits (4040-4049) must share the Abjurer characteristics, and another ten (4080-4089) share the conjured characteristics, and up to 100 mod kits (4100-4199) might share the Diviner characteristics. Right? If so, that is... quite bad.

    EDIT - I think this also seems to interfere with the kit name appearing on the Record screen...

    Grammarsalad
  • kjeronkjeron Member Posts: 2,132
    edited July 2017
    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.

  • RaduzielRaduziel Member Posts: 4,716
    @kjeron What does it means?

    I'm home now. Will try this code in a few hours.

  • RaduzielRaduziel Member Posts: 4,716
    @subtledoctor Apparently it doesn't work.

    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).

  • ArunsunArunsun Member Posts: 1,581
    I was quite excited about that and tried it too, and... same conclusion.

    Has anyone asked Beamdog if they could de-hardcode that? or alternatively create OP codes so that we may reproduce these functions?

  • RaduzielRaduziel Member Posts: 4,716
    @Arunsun Beamdog should focus on updating IWDEE to 2.0.

    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.

Sign In or Register to comment.