Jump to content

[LE] OnEffectStart() and Peak Value Modifier effects


Recommended Posts

I have a magic effect with peak value modifier, and a script attached to that effect that detects OnEffectStart, and I have made 5 potions with that effect. I don't want these potions to stack (hence why I used Peak Vaue modifier) but I still want the OnEffectStart event to trigger.

 

My issue is that when the player drinks a potion with, let's say, 5 magnitude, and then drink another with 4 magnitude, the second effect will not trigger OnEffectStart. Is there anyway to detect that effect while still getting the ActiveMagicEffect so I can use GetMagnitude() ?

 

I tried OnInit, OnEffectStart and even OnEffectFinish, none of them seem to trigger when the 2nd potion in drunk, even though the effect does appear as inactive in More Informative Console, so it's definitely there!

Link to comment
Share on other sites

Seems like the problem you're encountering lies in the magic effect itself, not the script. Is the magic effect has "No Recast" flag? If it has, then remove it. Also, if the effect won't stack, then only the one which has the highest magnitude will prevail. In other words, only a single OnEffectStart will be triggered. So i think this usage of Peak Value Modifier is counterproductive/contradicting with what you want to aim here.

Edited by qwertypol012
Link to comment
Share on other sites

"So i think this usage of Peak Value Modifier is counterproductive/contradicting with what you want to aim here."

 

Yeah the issue here is I want to keep Peak Value modifier so that the effect doesn't actually stack. I just want the script to still trigger :/

Link to comment
Share on other sites

Try this:

create a copy of the magic effect and set it to script type

this will be a dummy effect and will only be used to trigger the script events

remove the scripts from the original effect

leave the old effect as peak value modifier

 

add both of your magic effects to the potion

both with the same magnitude

set the condition on the dummy to hasMagiceffect(originalEffect) > 0

 

This means whenever you already drank the potion (and thus receive the originalEffect) only your dummy effect will trigger and you can use the script Events

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...