Jump to content


Photo

BG1 sprite restoration - Issues in Siege of Dragonspear


  • Please log in to reply
7 replies to this topic

#1 Andrea C.

Andrea C.
  • Modder
  • 458 posts

Posted 15 April 2021 - 12:54 AM

Sup, everyone.

I've just gone through Siege of Dragonspear using my mod to restore character sprites from BG1 and I've encountered two issues I'm not sure how to address.

Here's a download link (it's on drop box; I'm very GitHub challenged) for the mod component in question—note that if you choose the option to patch your saved games too, they'll never work again without this mod (or they will, but everybody will look like Sarevok.) Either start a fresh game, or remove all but one of your saves before patching, so the rest remain serviceable.

My issues are as follows:

  • While both Khalid and Jaheira correctly have their sprite changed to the BG one in the initial dungeon, when you encounter them again in Coast Way Crossing (Jaheira) and Bridgefort (Khalid), they both have their BGII sprite on. I checked Near Infinity and I could not find any CRE files for them that would still be set to use a BGII sprite. How can I make them use the BG sprite in all cases?
  • Both Kahlid and Jaheira are wielding shields when you encounter them, and both suffer from a graphical glitch while in their BGII sprite: When facing east, they fail to assume their combat stance and appear as lying on the ground instead, with only their weapon, shield, and helmet staying in the combat stance. This can be easily tested by making them fact east, then talking to them; they'll assume the combat stance while waiting for your character to catch up to them to initiate a conversation.


Any idea what might be going wrong here?

 

Thanks,

Andrea



#2 Argent77

Argent77
  • Administrator
  • 1398 posts

Posted 15 April 2021 - 01:37 AM

Both Jaheira and Khalid are handled by script in SoD. If Jaheira was in your party before then her creature file from the saved game is used. If she was never in your party before then JAHEIR7.CRE is spawned. Khalid is handled similarly. If he was never in your party then KHALID7.CRE is spawned.

The script applied two spells to them which might have side effects. The first one (BDRESURR.SPL) applies the raise dead effect which also restores their original creature animation (to fix chunked characters I guess). This is the most likely candidate for restoring their animations to their original form. The second spell (BDREJUVE.SPL) simply cures a couple of bad states and should not affect the creature animation.
 
I guess you could use the Polymorph() script action to apply their BG1 animations after the resurrection spell was applied. The responsible scripts are BD7100.BCS (for Jaheira) and BD2000.BCS (for Khalid).

Edited by Argent77, 15 April 2021 - 01:37 AM.


#3 Andrea C.

Andrea C.
  • Modder
  • 458 posts

Posted 15 April 2021 - 04:56 AM

Thank you, Argent.

 

What is the code to inject text into BCS files? It's not something I've ever done before.

 

I assume it would start with the usual ACTION_IF and if the files exists, it gets copied over to the override folder. From that point on, all I know how to do with BCS files is a REPLACE_TEXTUALLY, which I reckon won't help me in this case.



#4 Argent77

Argent77
  • Administrator
  • 1398 posts

Posted 15 April 2021 - 05:44 AM

Using REPLACE_TEXTUALLY is probably the quickest option and should work well enough in this case:

COPY_EXISTING ~BD2000.BCS~ ~override~
  DECOMPILE_AND_PATCH BEGIN
    REPLACE_TEXTUALLY ~\(ApplySpellRES("bdrejuve","khalid")\)~
                      ~ActionOverride("khalid",Polymorph(ANIMATION_NAME)) \1~
  END
BUT_ONLY


Replace ANIMATION_NAME by the symbolic name of your new creature animation from ANIMATE.IDS.

 

I'd advise against inserting the new command directly after the resurrection spell since that spell might take a few ticks to complete.



#5 Andrea C.

Andrea C.
  • Modder
  • 458 posts

Posted 15 April 2021 - 06:40 AM

Thank you very much!

 

I could make it work for Jaheira but not for Khalid, for some reason.

 

The code itself works as I can see BD2000.BCS was altered in the same way as BD7100.BCS was—I also double-checked the name for my animation in ANIMATE.IDS and it's the one I used. :wacko:

 

Would you mind having a look locally and see if you spot anything obviously wrong?


Edited by Andrea C., 15 April 2021 - 06:41 AM.


#6 Argent77

Argent77
  • Administrator
  • 1398 posts

Posted 15 April 2021 - 07:10 AM

Difficult to say what didn't work on your side. A quick test on my local game installation confirmed that the code did exactly what it should and applied the new animation to Jaheira and Khalid.



#7 Andrea C.

Andrea C.
  • Modder
  • 458 posts

Posted 15 April 2021 - 07:14 AM

Thank you for checking.

 

I'll leave it as is for now; hopefully it's just a bug with my save game.



#8 Andrea C.

Andrea C.
  • Modder
  • 458 posts

Posted 18 April 2021 - 08:13 AM

Argent, while I have you here—as you might have seen, I picked a specific interval of animation slots to nest my BG sprites in for the Enhanced Editions.

 

I understand you wrote code a few years ago that enables WeiDU mods to dynamically search for unused animation slots so as to ensure compatibility across mods that add animations. I would like to adopt that for this mod, with the caveat of course that I specifically need "old" type slots for these sprites, but the code is rather advanced for me.

 

Would you be so kind as to walk me through it so I can learn how to use it? (My WeiDU is really, really basic so I'll need the for dummies version.)


Edited by Andrea C., 18 April 2021 - 08:14 AM.