Jump to content

Looking for the best way to prevent some effects from stacking


Recommended Posts

Hello, 

I want to introduce two changes, but I am not sure how to approach that and the vast knowledge of the users of these forums would help me tremendously with deciding what is the best course of action.

1. I want to remove that +4 bonus to saving throws from all spells/items that grant Improved Invisibility. In EE this bonus is linked to the STATE itself, so I can't just remove the bonus from all spells to achieve what I want. Right now I'm leaning towards making each spell that grants II dispel all such spells before applying its effects and ofc adding a -4 penalty to all spells. This should work and should not introduce any issues with durations, where for example II applied by one spell is finished, but ST penalty from another spell is still active. Unfortunately this might introduce some issues when done blindly, as there might be spells that grant other bonuses and we wouldn't want to overwrite them with other spells. Do you have any other suggestions for that?

2. I'd like to make all +X magical items (well, to be precise: rings, amulets and cloaks) to be wearable at the same time, but prevent them from providing too many ST/AC bonuses. For example if you have a ring +2, an amulet +1 and a cloak +3, you should only get a +3 bonus. My best shot at this is to externalize all bonuses to .EFF files, creating many .EFF files that each grant +1 to AC or ST, but each having a different parent_resource set. This allows me to make each +X item apply X .EFF files for ST/AC and protect from parent_resources of each of them via opcode 206. This works fine and dandy when I just want to equip items, but taking them off creates "gaps" in the bonuses, which I have no idea how to avoid.

To illustrate that, we have effects AC_X and ST_X, which all grant a +1 bonus and their parent resources are different. We have a ring +1 that we equip. This grants us effects AC_1 and ST_1 and protects us from effects AC_1 and ST_1. Then we equip a ring +3, it tries to apply AC_1, AC_2, AC_3, ST_1, ST_2 and ST_3, but since we already have a ring +1, only AC_2, AC_3, ST_2 and ST_3 are applied. Then when we remove ring +1 we also remove effects ST_1 and AC_1, which makes us get only a +2 bonus even though we are wearing a +3 ring. Even worse, since that ring+3 protects from all EFF files of up to +3, when we try to reequip that ring +1 we don't get any bonuses!

I hope I managed to convey my idea in an at least somewhat understandable manner :) and I still have a question - is there a better way to do this?

 

From IESDP I see that ToBEx had exactly what I needed with its 

present in .EFF files, but it seems that EE doesn't implement any similar mechanics...

Link to comment

The EE's main anti-stacking measure is opcode 321. Buffs that shouldn't stack 321 previous instances of themselves as their first effect.

Of course, this doesn't work so well for equip effects and EFFs. I don't think there really is a good way to do anti-stacking for effects with the "Equipped" timing mode.

Now, about your idea with improved invisibility ... there's another complication. You see, when invisibility effects are removed, that doesn't necessarily remove the whole spell they came from. So you cast II, get hit by a Detect Invisibility, and now you've got a +4 save penalty because the duration didn't expire and that effect's still around. It's fixable, at least; the II state doesn't get removed by game actions like attacking, so it needs an explicit reveal effect (opcode 47 or 116) to remove it without clearing the whole spell. You'd just need to patch everything that uses those two opcodes in addition to all of the improved/weak invisibility effects.

Link to comment

The improved invisibility thing might be problematic in another way, because IIRC any creatures with "invisibility detection by script" are not subject to II's 4-point AC bonus. So if you apply a penalty to cancel out the bonus, then those creatures will have a substantially easier time hitting improved invisible characters. Which seems quite backwards.

I like your idea for protection items, but here too, you are sinking your teeth into issues that the Infinity Engine does not make it easy to solve. To really get it done properly would probably require repeating effects. That way any 'gaps' in protection would be filled in a few seconds at most. But, I'm not sure you really want the overhead of repeating effects on every character wearing something as common as rings of protection...

Link to comment

Thank you for your comments!

Quote

Now, about your idea with improved invisibility ... there's another complication. You see, when invisibility effects are removed, that doesn't necessarily remove the whole spell they came from. So you cast II, get hit by a Detect Invisibility, and now you've got a +4 save penalty because the duration didn't expire and that effect's still around. It's fixable, at least; the II state doesn't get removed by game actions like attacking, so it needs an explicit reveal effect (opcode 47 or 116) to remove it without clearing the whole spell. You'd just need to patch everything that uses those two opcodes in addition to all of the improved/weak invisibility effects.

It's as you're saying, I need to be very careful, but that's at least manageable with proper patching, which I'm willing to do. Sadly those stacking issues are of greater importance but it seems that there is no "right" way to implement them and I will need to accept that...

Quote

The improved invisibility thing might be problematic in another way, because IIRC any creatures with "invisibility detection by script" are not subject to II's 4-point AC bonus. So if you apply a penalty to cancel out the bonus, then those creatures will have a substantially easier time hitting improved invisible characters. Which seems quite backwards.

Luckily that only applies to AC bonuses and not to Saving Throws, which are added directly and are visible in your character sheet. AC bonuses are acceptable to me, I don't want to make the spell too weak :) your argument also convinces me that changing AC would only bear bad results.

Quote

I like your idea for protection items, but here too, you are sinking your teeth into issues that the Infinity Engine does not make it easy to solve. To really get it done properly would probably require repeating effects. That way any 'gaps' in protection would be filled in a few seconds at most. But, I'm not sure you really want the overhead of repeating effects on every character wearing something as common as rings of protection...

I'm not a big fan of those repeating effects. I know that most stuff can be achieved through proper scripts and/or repeating opcodes (232, 272, 333), but I try everything I can to avoid using them and get instant changes. Unfortunately it seems that if I want to implement those non-stacking magical items, I'll have to resort to this OR just inform players that they have to reequip their items whenever something like that happens, potentially removing some memorized spells and in general forcing them to do more work than necessary...

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...