Jump to content

Effects


Recommended Posts

Opcodes 126 and 176 use the exact same code. 176 is listed as slightly different (As #126, but unaffected by Free Action) so it must be a parameter if Free Action is ignored

They need not be different; the difference is simply that Free Action uses opcode 101 for immunity to opcode 126, but has no immunity to opcode 176. This way if the devs (or modders) want to stop movement in a way that Free Action can't overcome, they have that option.

Link to comment

 

Opcodes 126 and 176 use the exact same code. 176 is listed as slightly different (As #126, but unaffected by Free Action) so it must be a parameter if Free Action is ignored

They need not be different; the difference is simply that Free Action uses opcode 101 for immunity to opcode 126, but has no immunity to opcode 176. This way if the devs (or modders) want to stop movement in a way that Free Action can't overcome, they have that option.

 

Yeah, this. 126 and 176 are identical AFAIK; it's simply convention that 176 is reserved as the 'unblockable' movement rate opcode. It's like hold via ops 175 and 185--by convention 185 is the 'unblockable' hold, used to freeze your party member in the Hell selfish test or to hold undead.

Link to comment
On 11/2/2017 at 12:54 AM, kjeron said:

182 would be "Use EFF file if/while item resource equipped", except that its resource field does not work, so it cannot restrict itself to a specific item, and its EFF resource is specified in Resource2, so it must be used in V2 effects.

@kjeron @Bubb

Can you confirm this now works as expected...?

However, it seems it does not get removed when the specified item is unequipped...

I'm using it to make sure you have 5 pips in LONGSWORD upon equipping the Black Blade of Disaster, but it's not working as expected...

Spoiler
  • "blakblad.itm"
    • op232, timing=2, p1=0, p2=20, res="SPL", special=140 (some random value strictly greater than 100 and such that this is a fake contingency...)
  • "SPL"
    • op321, target=1, timing=1, res="SPL" // prevent self stacking
    • op177, target=1, p2=2, timing=0, duration=13, res="EFF1" // some random duration strictly greater than 200 ticks so as to rake into account Haste/Slow)
  • "EFF1"
    • effectID=182, prob1=100, res="blakblad", res2="EFF2"
  • "EFF2"
    • effectID=233, prob1=100, p1=5, p2=90

As soon as the op232 kicks in, I get 5 pips in LONGSWORD (regardless of my current value)... However, as soon as my item is unequipped (f.i. the spell expires / I polymorph into some creature / I cast Chill Touch / etc...), the value does get immediately reset...

Am I missing something...?

Link to comment
4 minutes ago, Luke said:

@kjeron @Bubb

Can you confirm this now works as expected...?

However, it seems it does not get removed when the specified item is unequipped...

I'm using it to make sure you have 5 pips in LONGSWORD upon equipping the Black Blade of Disaster, but it's not working as expected...

  Reveal hidden contents
  • "blakblad.itm"
    • op232, timing=2, p1=0, p2=20, res="SPL", special=140 (some random value strictly greater than 100 and such that this is a fake contingency...)
  • "SPL"
    • op321, target=1, timing=1, res="SPL" // prevent self stacking
    • op177, target=1, p2=2, timing=0, duration=13, res="EFF1" // some random duration strictly greater than 200 ticks so as to rake into account Haste/Slow)
  • "EFF1"
    • effectID=182, prob1=100, res="blakblad", res2="EFF2"
  • "EFF2"
    • effectID=233, prob1=100, p1=5, p2=90

As soon as the op232 kicks in, I get 5 pips in LONGSWORD (regardless of my current value)... However, as soon as my item is unequipped (f.i. the spell expires / I polymorph into some creature / I cast Chill Touch / etc...), the value does get immediately reset...

Am I missing something...?

Have you tried using opcode 177 instead of opcode 182? I do something similar with modifying apr when 2h weapons are equipped, and 177 works on updating apr when equipped and unequipped.

Link to comment
2 hours ago, Luke said:

Can you confirm this now works as expected...?

The opcode appears to function, it applies res2 if an item with res1 is currently equipped. I'll have to test your setup, though -- why is putting op233 on the ITM itself not a viable option?

Link to comment
2 hours ago, Bubb said:

why is putting op233 on the ITM itself not a viable option?

Timing mode 2 (Instant/while equipped) cannot bypass Character Creation weapon proficiecies (I need a limited timing mode for that...)

Link to comment

Ok, I see, op233 needs to be on the normal effects list to be evaluated after chargen proficiency effects and override them. There seems to be two (normal) ways to get a timed effect applied from an item, op232 and op272.

Is the op182 even necessary if the item is the source of the repeating EFF? I just tested an (Instant/while equipped) op272 applying the op233 EFF (duration=1), and everything seemed to work.

Link to comment
Posted (edited)

Easiest method is probably still using Opcode 177 (Use EFF file).

COPY ~moddirectory/mo5prof.eff~ ~override~ // name of the eff assigning 5 prof points

COPY_EXISTING ~blakblad.itm~ ~override~
	LPF ADD_ITEM_EQEFFECT INT_VAR opcode = 177 target = 1 parameter1 = 0 parameter2 = 2 timing = 2 resist_dispel = 0 probability1 = 100 STR_VAR resource = ~mo5prof~ END 

I do the exact same thing with adding apr on weapon equip, and the attached eff file and code above should work.

mo5prof.eff

Edited by morpheus562
Link to comment
Posted (edited)
8 hours ago, Bubb said:

The opcode appears to function, it applies res2 if an item with res1 is currently equipped. I'll have to test your setup, though -- why is putting op233 on the ITM itself not a viable option?

Here's the bug you get with the "while equipped" proficiency effect, as it is in the current (2.6) unmodded game. Dual-class while the Black Blade is equipped, and the character permanently gains grand mastery in long swords. It's difficult to exploit in the standard campaign because of how late the Black Blade scroll becomes available, but it's quite the bug.

Lesser "while equipped" proficiency effects are also subject to getting upgraded by level-ups. If, for example, you have a warrior with an item that grants dagger proficiency while equipped, they can then take dagger specialization at a level-up, remove the item, and keep the specialization permanently.

So we need something trickier for the Black Blade, and can then recommend the same for any mod-added weapon that grants a proficiency. If it fixes these bugs, anyway.

Edited by jmerry
Link to comment
5 hours ago, morpheus562 said:

Easiest method is probably still using Opcode 177 (Use EFF file).

This has the problem that Luke was warning about -- since op177 is coming from the equipment list it can't override proficiencies for characters that already have pips in the category. op232 / op272 is the only way around this.

1 hour ago, jmerry said:

Dual-class while the Black Blade is equipped, and the character permanently gains grand mastery in long swords.

Lesser "while equipped" proficiency effects are also subject to getting upgraded by level-ups.

Well, it doesn't even have to be a permanent effect. Since level-up pulls from the proficiency stats it's impossible to hide these "temporary" buffs from it. Pretty sure nothing short of a patch / EEex can fix this behavior.

Link to comment
Posted (edited)
5 hours ago, Bubb said:

This has the problem that Luke was warning about -- since op177 is coming from the equipment list it can't override proficiencies for characters that already have pips in the category. op232 / op272 is the only way around this.

Exactly.

5 hours ago, Bubb said:

Pretty sure nothing short of a patch / EEex can fix this behavior.

Not necessarily.

@kjeron showed me a way (LUA function) to prevent the player from clicking either the "Dual Class" button or the "Level Up" button in case of "temporary" proficiency bonuses (you just need a portrait icon).

11 hours ago, Bubb said:

Is the op182 even necessary if the item is the source of the repeating EFF? I just tested an (Instant/while equipped) op272 applying the op233 EFF (duration=1), and everything seemed to work.

Yes, technically speaking, op182 is not needed...

I wanted to use it so that the bonus is immediately removed upon unequipping the item (instead of waiting for 1 second or whatever duration you set in the EFF...). However, as I said, unlike op183, the bonus does not get removed 😕...

In the meantime, I'm using this new setup:

Spoiler
  • op272, timing=2, p1=1 (any non-zero value), p2=0 (once per second), res="EFF", special=0 (no icon)
  • "EFF"
    • op146, p2=1, timing=1, prob1=100, res="SPL"
  • "SPL"
    • op321, timing=1, res="SPL" // prevent self stacking (you know better than me that op272 can trigger multiple times under unintended circumstances...)
    • op233, p1=5, p2=90, timing=0, duration=2 (so as to take into account Slow, which doubles the timing rate of op272)
    • op142, p2="%my_icon%", timing=0, duration=2 (so as to take into account Slow, which doubles the timing rate of op272)

So basically the bonus will get removed after 1/2 seconds (depending on when the op272 effect triggered since the last time) instead of immediately... On reflection, I don't think it really matters... Having said that, I'm still wondering why op182 is not working...

Edited by Luke
Link to comment
13 hours ago, Luke said:

Having said that, I'm still wondering why op182 is not working...

After looking at it closer, there's multiple problems.

  • The function it uses to find the item, CGameSprite::FindItemPersonal(), doesn't consider SLOT_MISC19 as part of the "equipped" slots; this is probably intentional. So no detecting any magically-created weapons like the BBoD.
  • And the bug that makes it look like things are working: CGameSprite::FindItemPersonal() returns -1 on failure, but op182 takes any non-zero value to mean success. So op182 will always apply its EFF, making it useless.
Link to comment
On 5/13/2022 at 10:26 PM, jmerry said:

Here's the bug you get with the "while equipped" proficiency effect, as it is in the current (2.6) unmodded game. Dual-class

Yet Another Reason to have weapons that set their own proficiency stat to use a proficiency other than one of the normal ones. I (again) suggest stat 108.

And if you really want to get thorough about it, apply a spell in each trueclass CLAB table with op337 canceling any op233 effects setting stat 108.

Link to comment
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...