Jump to content

[BG2:ToB] - Behavior of opcodes #30 and #84 when param 2 isn't 0


aVENGER_(RR)

Recommended Posts

Apparently, the value of parameter 2 is irrelevant for these opcodes. To clarify, you can't set a creature's fire resistance to a specified amount nor can you modify it by a percentage of the original amount.

 

I've discovered this the hard way while trying the make a spell which would nullify a creature's fire resistance (i.e. set it to 0). It seems that this can't be done in the BG2 version of the IE.

Link to comment

After some more testing, it appears that opcodes #27, #28, #29, #30, #31, #84, #85, #86, #87, #88 and #89 all exhibit the same behaviour. In summary, all physical and elemental resistance altering opcodes can't be used to set the relevant stat to a fixed value nor do they accept a percentile modification of the original stat value.

 

I'll cross-post this in the TobEx wish thread.

Link to comment

I doubt that, they all start like this:

 

00513C07 89 4D EC mov dword ptr [ebp-14h],ecx

00513C0A 83 7D EC 00 cmp dword ptr [ebp-14h],0

00513C0E 74 19 je 00513C29

00513C10 83 7D EC 01 cmp dword ptr [ebp-14h],1

00513C14 0F 84 B8 00 00 00 je 00513CD2

00513C1A 83 7D EC 02 cmp dword ptr [ebp-14h],2

00513C1E 0F 84 72 01 00 00 je 00513D96

00513C24 E9 58 02 00 00 jmp 00513E81

 

ebp-14h is param2. Obviously 0,1,2 are all accepted.

 

You need to know that a permanent timing (1) will modify the base stat and won't stick around.

If you want that, you need to use the permanent after bonuses (9) timing method.

Link to comment

I don't know how the code is set up, but the fact is that these settings don't work in-game as advertised. Feel free to run your own in-game tests and check my findings.

 

For the record, I used timing mode 0 (duration) in my tests and I wasn't able to get the opcodes to behave as advertised when param 2 was set to either 1 or 2.

Link to comment

They work, but any bonuses are added to them, even when the timing mode is 'permanent after bonuses'.

What's worse, you cannot use negative values, though IESDP explicitly states that. I think negative resistances (vulnerabilities) work only in bg1.

 

I doubt, that these specific effects are special in this aspect. All modifiers behave the same way.

Link to comment

Actually, negative values work, the real problem is that cumulative modifiers also set the stat diff array, which makes sure that cumulative modifiers are always applied last effectively.

There is no way to clear this field, only to add (or subtract) values from it. It has no boundary check, so there is not even a modder level hack (like subtracting a large number from it) that is possible.

So, I was able to make a permanent -128 resistance (by setting a -255 cumulative 'bonus'), but never been able to stabilize it at 0.

 

Again, this feature is

1. not a bug, it is implemented so cumulative modifiers are working

2. not specific to these effects, all modifiers work this way

3. there is a bug with absolute values not signed, while cumulative values could be signed.

Link to comment

Actually, negative values work, the real problem is that cumulative modifiers also set the stat diff array, which makes sure that cumulative modifiers are always applied last effectively.

 

That's the issue which I'm experiencing. Let's say a creature has 50 fire resistance and I want to temporarily set it to 0, I can't do that using param 2 = 1. If that's not considered a bug, I'm cool with that, but the documentation needs to be a bit clearer about it.

 

 

I can assert that at least for 31th opcode the param2=1 works.

I've used it http://www.shsforums...revisions/]here[/url] to simulate the divine damage (ag#trh[1-7].spl, ag#trh.eff).

 

It seems to work for a split second but then it gets overridden. In your case, even such a short interval is enough since your goal is to deal damage without resistance. But I want to set the resistance to 0 for several rounds and that unfortunately doesn't work.

Link to comment

Yes, if you just want to deal damage without resistance, in the same spell, this will work.

 

@Ardanis: i have absolutely no idea why you needed an external eff. If you manage to remember, tell me :)

 

More about why this isn't a bug: if there are 2 flat fire resistance settings, 10 and 20. And a fire resistance bonus: 30. This system will make it 40 or 50 depending on which flat resistance is first. At least, the bonus resistances won't be overwritten by the flat resistances.

If the system would work like you want, it could set the fire resistance to anything like 40, 50, 10 or 20, depending on processing order.

Actually, i gotta check GemRB to see if it screws up like this.

 

It is difficult to have a correct system, because a flat resistance of 10 could be a bonus or a penalty, depending on previous values.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...