Jump to content


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



10 replies to this topic

#1 aVENGER_(RR)

    Sneaksie!

  • Fixpackers
  • 1008 posts
  • Gender:Male

Posted 14 February 2012 - 11:29 AM

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.

Edited by aVENGER_(RR), 14 February 2012 - 11:51 AM.

Retired modder

Rogue Rebalancing - Author
aTweaks - Author
Wizard Slayer Rebalancing - Co-Author
BG2 Fixpack - Contributor

#2 Daulmakan

    Comfortably numb

  • Members
  • 529 posts
  • Location:The Houses of the Holy

Posted 14 February 2012 - 02:21 PM

Maybe ask Ascension to do something about it?
I ain't evil, I'm just good looking.


#3 aVENGER_(RR)

    Sneaksie!

  • Fixpackers
  • 1008 posts
  • Gender:Male

Posted 14 February 2012 - 09:39 PM

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

Rogue Rebalancing - Author
aTweaks - Author
Wizard Slayer Rebalancing - Co-Author
BG2 Fixpack - Contributor

#4 Avenger

  • Modders
  • 3364 posts
  • Gender:Male
  • Location:Hungary

Posted 15 February 2012 - 12:16 AM

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.

Edited by Avenger, 15 February 2012 - 12:20 AM.


#5 aVENGER_(RR)

    Sneaksie!

  • Fixpackers
  • 1008 posts
  • Gender:Male

Posted 15 February 2012 - 12:35 AM

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.

Edited by aVENGER_(RR), 15 February 2012 - 12:40 AM.

Retired modder

Rogue Rebalancing - Author
aTweaks - Author
Wizard Slayer Rebalancing - Co-Author
BG2 Fixpack - Contributor

#6 Avenger

  • Modders
  • 3364 posts
  • Gender:Male
  • Location:Hungary

Posted 15 February 2012 - 09:09 AM

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.

Edited by Avenger, 15 February 2012 - 09:10 AM.


#7 Avenger

  • Modders
  • 3364 posts
  • Gender:Male
  • Location:Hungary

Posted 15 February 2012 - 12:37 PM

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.

Edited by Avenger, 15 February 2012 - 12:42 PM.


#8 Ardanis

    A very GAR character

  • Members
  • 2192 posts
  • Gender:Male
  • Location:Saint-Petersburg, Russia

Posted 15 February 2012 - 02:00 PM

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).
For a reason I can no longer remember it applies the resistance modifier via external EFF, not directly, but in any case it bypasses the magic damage resistance correctly.

Edited by Ardanis, 15 February 2012 - 02:03 PM.

"Uguu~ Boku Ayu."

Before you start breaking wall tiles with your bare fists, ask yourself first - do you truly need it?

#9 aVENGER_(RR)

    Sneaksie!

  • Fixpackers
  • 1008 posts
  • Gender:Male

Posted 15 February 2012 - 03:06 PM

View PostAvenger, on 15 February 2012 - 12:37 PM, said:

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.


View PostArdanis, on 15 February 2012 - 02:00 PM, said:

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

Rogue Rebalancing - Author
aTweaks - Author
Wizard Slayer Rebalancing - Co-Author
BG2 Fixpack - Contributor

#10 Avenger

  • Modders
  • 3364 posts
  • Gender:Male
  • Location:Hungary

Posted 15 February 2012 - 10:54 PM

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.

#11 igi

    IESDP Guardian

  • Gibberlings
  • 1208 posts
  • Gender:Male

Posted 22 April 2012 - 07:30 AM

To summarize: for statistic modifier effects, the application order is by param2 descending (i.e. param2=0 always gets applied last)?




Reply to this topic



  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users