BGforgeNet / bg2-tweaks-and-tricks

Tweaks and Tricks mod for Baldur's Gate 2
https://forums.bgforge.net/viewforum.php?f=31
26 stars 5 forks source link

Issues with the Sensible Otiluke's Sphere component #60

Closed eyre-j closed 2 years ago

eyre-j commented 2 years ago

I would like to report a couple of issues with this component that I noticed in my BGT game.

First, the hold effect is not actually being removed. After investigating, I noticed that the DELETE_SPELL_EFFECT call is passing an incorrect opcode of 175 as the opcode_to_delete argument; it should pass opcode 185 instead in order to match the hold effect used for the spell.

After making the above change locally and testing, the version of the spell that is targeted at creatures other than the caster indeed no longer causes the target to be held; however, if the caster targets himself, he is still held. After I changed the code to patch spwi413c in addition to spwi413a, the caster is no longer held after targeting himself with the spell.

burner1024 commented 2 years ago

what's your weidu.log

eyre-j commented 2 years ago

WeiDU.log:

// Log of Currently Installed WeiDU Mods
// The top of the file is the 'oldest' mod
// ~TP2_File~ #language_number #component_number // [Subcomponent Name -> ] Component Name [ : Version]
~TOBEX/TOBEX.TP2~ #0 #100 // TobEx - Core: v28
~TOBEX/TOBEX.TP2~ #0 #101 // Apply Concentration Check On Damage [WIP]: v28
~TOBEX/TOBEX.TP2~ #0 #102 // Awaken On Damage: v28
~TOBEX/TOBEX.TP2~ #0 #103 // Blindness As Spell Description: v28
~TOBEX/TOBEX.TP2~ #0 #104 // Disable Stoneskin Grey Colour [C]: v28
~TOBEX/TOBEX.TP2~ #0 #105 // No Spell Interruption On Zero Damage: v28
~TOBEX/TOBEX.TP2~ #0 #106 // Use Caster Level On Mirror Image [C]: v28
~TOBEX/TOBEX.TP2~ #0 #107 // Allow All Races to Dual Class: v28
~TOBEX/TOBEX.TP2~ #0 #109 // Disable Experience Boost: v28
~TOBEX/TOBEX.TP2~ #0 #111 // Disable Silence On Charm: v28
~TOBEX/TOBEX.TP2~ #0 #112 // Level One Proficiency Restrictions: v28
~TOBEX/TOBEX.TP2~ #0 #113 // Remain Hidden On Pickpocket Success [C]: v28
~TOBEX/TOBEX.TP2~ #0 #115 // Dialogue Greeting Subtitles: v28
~TOBEX/TOBEX.TP2~ #0 #116 // Enable Animation Attack Sounds: v28
~TOBEX/TOBEX.TP2~ #0 #117 // Universal Four Inventory Weapon Slots: v28
~TOBEX/TOBEX.TP2~ #0 #118 // Subtitles For Standard Soundsets: v28
~TOBEX/TOBEX.TP2~ #0 #119 // Remove all race-class restrictions: v28
~TOBEX/TOBEX.TP2~ #0 #120 // Drop Inventory on Disintegrate: v28
~TOBEX/TOBEX.TP2~ #0 #121 // Drop Inventory on Frozen Death: v28
~TOBEX/TOBEX.TP2~ #0 #122 // Drop Inventory on Stone Death: v28
~TOBEX/TOBEX.TP2~ #0 #123 // Enable Auto-Pause On All Screens: v28
~TOBEX/TOBEX.TP2~ #0 #124 // Make All Attack Animations Genuine Attacks: v28
~BG2FIXPACK/SETUP-BG2FIXPACK.TP2~ #0 #0 // BG2 Fixpack - Core Fixes: v13
~BG2FIXPACK/SETUP-BG2FIXPACK.TP2~ #0 #1001 // BG2 Fixpack - Game Text Update -> GTU Classic (from Baldurdash, by Kevin Dorner): v13
~BGT/BGT.TP2~ #0 #0 // Baldur's Gate Trilogy - Core: v1.21
~SETUP-BGTMUSIC.TP2~ #0 #2 // Baldur's Gate Trilogy - Music -> Full Baldur's Gate/Shadows of Amn/Throne of Bhaal Music (WARNING: patches BGMain.exe)
~TNT/TNT.TP2~ #0 #46 // Sensible Otiluke's Resilient Sphere: v8.18

Result: otiluke_bgt_still_held

eyre-j commented 2 years ago

Further investigation reveals that the main component of BG2Fixpack changes spwi413.spl with the addition of the spwi413a, spwi413a, and spwi413c sub-spells. Vanilla BG2 has only spwi413.spl. All versions of the spell use opcode 185 for the hold effect, as highlighted in the screen shots below.

Vanilla BG2 Otiluke's Resilient Sphere: bg2_vanilla_otiluke

BG2Fixpack Otiluke's Resilient Sphere: bg2_bgfixpack_corefixes_otiluke

TNT code is attempting to patch spwi413a only, and is passing opcode 175 rather than opcode 185: tnt_ors_component tnt_opcode_defs

burner1024 commented 2 years ago

OK, I see that opcode is a typo in the underlying library.

spwi413c appears to be a more recent addition to bg2fixpack. There's also a number of other shell spells mentioned. Could you check those too for the opcodes?

eyre-j commented 2 years ago

The other spells (spcl415.spl, spcl415a-c.spl) are related to the Set Special Snare ability. In vanilla, only spcl415.spl exists; fixpack adds spcl415a. The spell itself uses opcode 175 for the first ranged ability, and opcode 185 for the second ranged ability; opcode 185 appears to be used as part of a ORS-like set of effects defined in the second ranged ability. See the NI screenshots below:

Vanilla:

Fixpack:

burner1024 commented 2 years ago

ok I'll just wipe 175 and 185 everywhere

eyre-j commented 2 years ago

It turns out that spwi413bhas no hold effect (it only protects against a concurrent ORS), so only spwi413aand spwi413c need to be patched. Also, I think 175 should be kept for the first Set Special Snare (spcl415, spcl415a) ranged ability, since it appears to be unrelated to ORS. See here for more details.

burner1024 commented 2 years ago

Right. And EE appears to use a shell spell too, but only a, no c. What a mess.

burner1024 commented 2 years ago

Ok, should be working now. Thanks for detailed report.