Icewind Dale: ToEE - Total Conversion

Discussion in 'Icewind Dale Total Conversion' started by Allyx, May 7, 2016.

Remove all ads!
  1. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    On that note, if you swap them out as above, they won't appear in alphabetical order in char creation.
    Before I dive into hex editing the DLL to accomodate the favored weapon handling, I need to know the final deity enums, so please finalize the subtitutions first. (the above is fine by me, but I don't want to do it over later)


    Edit:
    To change the weapon types, make the following edits:

    Hextor:
    Code:
    Heavy Flail → Battleaxe
        004AC4D | 3D F5 00 00 00     // cmp     eax, FEAT_MARTIAL_WEAPON_PROFICIENCY_HEAVY_FLAIL ; case 0x9
        change to:
        004AC4D | 3D EB 00 00 00     // cmp     eax, FEAT_MARTIAL_WEAPON_PROFICIENCY_BATTLEAXE ; case 0x9
     
        and
     
        004AC54 | 3D C5 01 00 00     // cmp     eax, FEAT_WEAPON_FOCUS_HEAVY_FLAIL
        change to:
        004AC54 | 3D BB 01 00 00     // cmp     eax, FEAT_WEAPON_FOCUS_BATTLEAXE
      
    Erythnul:
    Code:
    Morningstar → Spiked Gauntlet            
        004AC2C |  3D AC 01 00 00    // cmp     eax, FEAT_WEAPON_FOCUS_MORNINGSTAR ; case 0x4
        change to:
        004AC2C |  3D A6 01 00 00    // cmp     eax, FEAT_WEAPON_FOCUS_SPIKED_GAUNTLET ; case 0x4
    
    Once you've decided the swapping order, the above can be reassigned to other deity IDs.
     
    Last edited: Jun 5, 2017
  2. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,009
    Likes Received:
    254
    I suppose the base set should be in alphabetical order, excluding any additional deities added later.
     
  3. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,740
    Likes Received:
    374
    Can I just say that I really disagree with that, if it means moving the existing ones (the racial deities, Corellan and Gruumsh and such) around. While I don't doubt Sitra's decon-struct-ion of the deity structure, I am suspicious of how ToEE may use those values. It wouldn't surprise me if somewhere in the engine there is some use of them, racial I suspect, similar to how the map numbers are suddenly and inexplicably associated with the resting function. Better to keep the existing ones where they are, bring new ones across to the nearest comparable deity (swap Bane for Hextor, etc etc) and if anyone complains about the lack of alphabeticallity just ask them how they got past the attributes stage. ("Strength BEFORE Dexterity? Waaaa!!!!")

    Anyway, It's your call Al but I shudder to think what the potential bug reports will look like if I'm right. ("I'd just done the quest with the blue girl but I HADN'T done the stolen goblin fish quest - but I meant to, I was heading over to do that - but first I did the wolf in the workshop quest and my rolls breakdown showed I suddenly had a Weapon Focus feat that I had never taken and I SWEAR was not there on the roll breakdown of lockpicking to get into the workshop - apparently entering the workshop gives you a free feat!")

    Moreover, as well as complaining and giving advice, I am happy to break out the hex editor and do it if you like.
    This sounds like something right up Temple+'s alley, not something we need worry about now.

    On a happier note, I've converted about 7 dialogues, they are easy enough but fiddly, because this one references a flag in that one, which references a variable in t'other one. You can keep track of my progress by checking my entries in the flags and variables thread.
     
  4. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    Fortunately I can scan the DLL for usages of these structs as well as direct deity checks and let you know if there's any actual risk (I don't recall any but I can check). If you still don't want to risk it that's fine by me, it can be something left to T+ to handle (i.e. automatically sorting the deity names in the UI).

    Another thing, vanilla ToEE has hidden deity slots going up to 26 IIRC. These are used by NPCs, so you perhaps you'd want to use those (for NPCs at least).

    Lastly, I'd like to ask that dialogue/script checks be made using a central utility function, rather than directly using the old ToEE enums.
    E.g. add a file such as iwd_util.py with a function such as
    Code:
    def is_worshipping_deity(attachee, deity_name): ... 
    This would make it easier to change things down the line from one central place, in case the deity mapping changes (which may be the case with Temple+).
     
  5. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,009
    Likes Received:
    254
    The racial and alignment requirements for the worship of each deity was in my mind when I suggested just swaping deity x for deity y.

    As it is, only 1 of the swapped deities needs an alignment change and I don't know how to go about doing that, but the races able to select the race specific Gods should be accurate.

    I think preserving that functionality is more important than alphabetizing the list, especially if switching the names on the buttons can be done easilly in Temple plus afterwards.
     
  6. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,009
    Likes Received:
    254
    Ok, after some discussion on the Beamdog forum, the final list of deities I would like is:

    Bane LE - Destruction, Evil, Law, War - Spiked Gauntlet preferred weapon)
    Chauntea NG - Animal, Good, Plant, Sun
    Corellon Larethian (Unchanged) CG - Chaos, Good, Protection, War - Longsword preferred weapon
    Garl Glittergold (Unchanged) NG - Good, Protection, Trickery
    Gruumsh (Unchanged) CE - Chaos, Evil, Strength, War - Spear preferred weapon
    Helm LN - Law, Protection, Strength
    Lathander NG - Good, Protection, Strength, Sun
    Auril NE - Water, Evil, Air
    Moradin (Unchanged) LG - Earth, Good, Law, Protection
    Mystra LN - Knowledge, Good, Magic
    Oghma NN - Knowledge, Luck, Trickery, Travel
    Selûne CG - Protection, Travel, Chaos, Good
    Myrkul NE - Evil, Luck, Death
    Silvanus NN - Animal, Plant, Protection
    Talos CE - Chaos, Evil, Destruction, Fire
    Tempus CN - Protection, War, Chaos - Battleaxe preferred weapon
    Tymora CG - Chaos, Travel, Good, Protection
    Tyr LG - Good, Law, War, Knowlkedge - Longsword preferred weapon
    Waukeen NN - Knowledge, Protection, Travel

    I did look into swapping Bane for Bhaal, but Bane would appear to be the more prominant deity of the two, perhaps Bhaal can be one of the additional 8 instead as his death occured 80 years after IWD's timeline concluded.
     
  7. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    Fine by me. Can you post the final mapping of old deities to new?

    As for changing the alignment, you have to change the value to the corresponding enumeration.

    That's:

    TRUE_NEUTRAL = 0
    LAWFUL_NEUTRAL = 1
    CHAOTIC_NEUTRAL = 2
    NEUTRAL_GOOD = 4
    NEUTRAL_EVIL = 8

    LAWFUL_GOOD = 5
    CHAOTIC_GOOD = 6
    LAWFUL_EVIL = 9
    CHAOTIC_EVIL = 10

    Also, I'd like to reiterate the request for a central is_worshipping_deity function. It'll make compatibility with Temple+ much easier down the line.
     
  8. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,009
    Likes Received:
    254
    I'd be happy to, if you explain exactly how to do so as if I was someone who fills supermarket shelves for a living.

    I'll get you those numbers as soon as I finalise the other 8 non-selectable deities.

    Edit: @Sitra Achara Apologies if that last comment came across a bit snipey, I think sometimes you assume I'm a better programmer than I actually am. Short, complicated/vague explanations don't always help me to understand what I'm meant to be doing with the information you provided.
     
    Last edited: Jun 7, 2017
  9. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,009
    Likes Received:
    254
    1 Waukeen NN - Knowledge, Protection, Travel
    2 Corellon Larethian (Elf) CG - Chaos, Good, Protection, War - Longsword preferred weapon
    3 Chauntea NG - Animal, Good, Plant, Sun
    4 Talos CE - Chaos, Evil, Destruction, Fire
    5 Silvanus NN - Animal, Plant, Protection
    6 Garl Glittergold (Gnome) NG - Good, Protection, Trickery
    7 Gruumsh (Orc) CE - Chaos, Evil, Strength, War - Spear preferred weapon
    8 Tyr LG - Good, Law, War, Knowledge - Longsword preferred weapon
    9 Bane LE - Destruction, Evil, Law, War - Spiked Gauntlet preferred weapon
    10 Selûne CG - Protection, Travel, Chaos, Good
    11 Moradin (Dwarf) LG - Earth, Good, Law, Protection
    12 Auril NE - Water, Evil, Air
    13 Oghma NN - Knowledge, Luck, Trickery, Travel
    14 Tempus CN - Protection, War, Chaos - Battleaxe preferred weapon
    15 Lathander NG - Good, Protection, Strength, Sun
    16 Helm LN - Law, Protection, Strength
    17 Myrkul NE - Evil, Luck, Death
    18 Mystra LN - Knowledge, Good, Magic
    19 Brandobaris (Halfling) NN - Travel, Trickery, Luck

    ---------- With Temple Plus ----------
    20 Urdlen (Gnome) CE - Chaos, Earth, Evil
    21 Avoreen (Halfling) LG - Good, Law, War, Protection - Shortsword preferred weapon
    22 Bhaal LE - Death, Destruction, Evil
    23 Lolth (Elf) CE - Chaos, Evil, Destruction, Trickery
    24 Ilmatar LG - Good, Law, Healing, Strength
    25 Dumathoin (Dwarf) NN - Earth, Knowledge, Protection
    26 Umberlee CE - Chaos, Evil, Destruction, Water
    27 Yurtrus (Orc) NE - Death, Evil, Destruction
     
    Last edited: Jun 7, 2017
  10. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,740
    Likes Received:
    374
    Actually Al I was going to just do that by-the-by, if you like, since I might need it in the dlgs I am converting.

    Sitra, it will be in scripts.py.
     
  11. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,009
    Likes Received:
    254
    By all means Ted, be my guest. :)
     
  12. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    Great!
    If you don't mind, can you put it in a separate file and import from it into scripts.py?
    That way I can override just that without worrying about the rest of scripts.py.

    I'll send the hex edits for preferred weapons this weekend.
     
    Last edited: Jun 7, 2017
  13. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,740
    Likes Received:
    374
    Yeah all right, I will just do an IWD .py file as you suggested, that does make sense.
     
  14. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,009
    Likes Received:
    254
    Sorry, last final edit to the list, promise. Brandobaris NN - Travel, Trickery, Luck replacing Tymora/Yondala,
    I'll stop tweaking it now and leave it alone.
     
  15. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    Ok, here's the rest of the hex edits:

    Tempus:
    Change Heavy Flail → Battleaxe (used to be Hextor's Heavy Flail code)
    Code:
        004AC4D | 3D F5 00 00 00     // cmp     eax, FEAT_MARTIAL_WEAPON_PROFICIENCY_HEAVY_FLAIL ; case 0x9
        change to:
        004AC4D | 3D EB 00 00 00     // cmp     eax, FEAT_MARTIAL_WEAPON_PROFICIENCY_BATTLEAXE ; case 0x9
    
        and
    
        004AC54 | 3D C5 01 00 00     // cmp     eax, FEAT_WEAPON_FOCUS_HEAVY_FLAIL
        change to:
        004AC54 | 3D BB 01 00 00     // cmp     eax, FEAT_WEAPON_FOCUS_BATTLEAXE
    

    Add case 14 (was Olidammara, now Tempus - Battleaxe): jump to where case 9 was (Heavy Flail)
    Code:
    original:
    4AC0F | 77 50       // ja      short retun_0 ; default
    change to:
    4AC0F | 77 73       // ja      jump short 0x50 + (0x84 - 0x61) (changed the jump offset to new code)
    
    original: (nop's)
    4AC84 | 90 90 90
    4AC87 | 90 90    
    4AC89 | 90 90  
    4AC8B | 90        
    change to:
    4AC84 | 83 f9 0c   // cmp ecx, 12
    4AC87 | 74 C4      // jz    (jumps to 1004AC4D - where the Heavy Flail section was)
    4AC89 | 33 c0       // xor eax,eax
    4AC8B | c3           // ret
    
    Change Olidammara (now Tempus) domains to Chaos, Protection, War:
    Code:
    was:
    272D20 | 0D // Luck
    272D24 | 14 // Trickery
    new:
    272D20 | 10 // Protection
    272D24 | 15 // War
    
    Bane:
    Change Morningstar → Spiked Gauntlet (used to be Erythnul's Morningstar code)
    Code:
         
        004AC2C |  3D AC 01 00 00    // cmp     eax, FEAT_WEAPON_FOCUS_MORNINGSTAR ; case 0x4
        change to:
        004AC2C |  3D A6 01 00 00    // cmp     eax, FEAT_WEAPON_FOCUS_SPIKED_GAUNTLET ; case 0x4
    
    Change case 9 (was Hextor, now Bane - Spiked Gauntlets):
    Code:
    original:
    4AC80 | 4D AC 04 10
    change to:
    4AC80 | 2C AC 04 10   // will jump to the old case 4 (Erythnul - Morningstar) since it was a Simple weapon (i.e. no need for weapon proficiency, just weapon focus)
    

    Gruumsh, Corellon Larethian remain the same, and Tyr matches Heironeous in the preferred weapon so no change there either.
    I didn't remove case 4 (now Talos) since after editing his deity specs, he shouldn't have the War Domain anyway.
     
Our Host!