Hello.
I would like to patch the Dimension Door spell to use the BG1 VFX and new SFX made available by chimeric on the Beamdog boards, but I'm having some trouble figuring out the code that will let me do that.
Let's start from the basics:
ACTION_FOR_EACH spell IN ~[list of file names that pertain to Dimension Door spells]~
ACTION_IF (FILE_EXISTS_IN_GAME ~%spell%.spl~) THEN BEGIN
COPY_EXISTING ~%spell%.spl~ ~override~
READ_SHORT 0x72 ability
All Dimension Door spells appear to only have one Spell Ability field, so I should be safe reading 0x72 directly, which is its offset. At this point, however, I'm not sure how to continue.
Let's start with SFX. The sound effect played by the spell is the second effect (EFFECT 01) in 0x72, which is found at 0xca—but how do I instruct WeiDU to read offsets inside 0x72? I will then need to patch offset 0xde (RESOURCE) inside 0xca.
From
this previous thread, I seem to understand the following code does something similar:
COPY_EXISTING_REGEXP GLOB ~.*\.cre~ ~override~
SET validslot = 0
READ_LONG 0x2bc itemsoffset
READ_LONG 0x2b8 itemslot
READ_LONG 0x2c0 itemnumber
READ_SSHORT (itemslot + 0x04) shieldslot
PATCH_IF (shieldslot > "0") BEGIN
READ_ASCII ((LONG_AT 0x2bc) + %shieldslot% * 0x14) itemname
I reckon the last bit that sets variable itemname is doing exactly that—reading a specific offset within another offset, but I don't have a good understanding of how it works and, therefore, of how to adapt it to different scenarios.
As for VFX, the spell appears to play an effect called Hit Door but I can't seem to find any reference to a BAM or VVC in the SPL structure. Now, obviously there's a DDOORH.VVC file that is probably what I want to target, so I suppose I could just rename the VVC and BAM I have to DDOORH and put them in the override. But what if I wanted to add this VFX to the game without overriding the existing one? Which fields of the SPL should I be patching?
Thanks in advance!