Jump to content

Special protections in Shadows of Amn-period engine


temnix

Recommended Posts

In the Enhanced Edition, for the first game in the BG series, some items, monster weapons, for instance, use advanced opcodes. The spit of the green slime, for example, starts with an effect 318 to exclude targets with Poison resistance >= 100. I like my mods compatible with "classic" installations, when that's not too difficult, but I'm struggling to represent this protection with "classic" opcodes. And this monster weapon must be different in Shadows of Amn, if there are any green slimes there, because 318 will cause a crash. So, how does the old engine go about these exclusions and protections?

Link to comment

Mostly it doesn't: the 318 family of opcodes is a really substantial expansion of the capacity of the engine, basically porting into BG2 the very expanded functionality of IWD's opcodes 206/290. (These opcodes were introduced in IWDEE for that reason). There are workarounds (IWD-in-BG2 used many of them) but they're often horribly clunky, and many things can't be worked around at all.)

If you want to look at examples of how the various partial workarounds work, the best thing is to install Fixpack on old BG2 and then just look at oBG2 and BG2EE in parallel to see how a given resource in EE (like green slime) is handled in oBG2. The fixpack makes a much more systematic attempt than the original game to catch problems that 318/321/324/326 is best at dealing with, but you'll still see lots of cases where it can't be done.

An example: the EE games mostly remove previous instances of a spell whenever a new instance is applied to prevent spells stacking, via 321. There's no simple way to do that in oBG2 (you can do it with a custom sectype and opcode 221, but that can get unmanageable without fairly sophisticated code). In unmodded oBG2 the issue is mostly ignored. The Fixpack uses opcode 206 to give immunity to further iterations of the spell while the first one is running, but that's nonideal because you can't rebuff until your old buff has expired.

Link to comment

This is unnecessarily detailed. To say that the SoA engine mostly doesn't have these extras would have been enough. I know some of the workarounds myself - using EFF files with opcode 177 instead of 318 and 324 for some parameters. But the absence of effect removal is a big problem with the old engine. It is making half of the things I can make limited to the EE. For this case I don't need any more information. I changed green slimes to be closer to the pen-and-paper version, removable with Cure Disease and not related to poison. Although Cure Disease patching still involved opcode 321, so this had to be restricted to the EEs again, to BG:EE in particular. I'm going to make it possible to save the innkeeper of Ye Olde Inn.

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...