Jump to content

Scripting event help please!


DMan1629

Recommended Posts

I want a specific script to run whenever the maximum value of one of the 3 attributes (Health, Magicka, Stamina) is updated.
Examples: equipping a Fortify Health item, drinking a Fortify Magicka potion, etc.

I know how to get the maximum value if I wish:

ActorValueInfo.GetActorValueInfoByName(Attribute).GetMaximumValue(akTarget)

and I've tried using reoccurring updates every 1/2 seconds with that command, but it presents a challenge in the long run so I prefer to avoid it.


Does anyone know of an event or any other method to monitor attributes without updates?

Thanks in advance!

Link to comment
Share on other sites

Here is a list of all the "On" commands, under O ... LINK ... from the Creation Kit site.
Possibly have an item the player interacts with in some way that holds the script for a simple 3 attribute check to kick off your custom event.

Edited by NexusComa
Link to comment
Share on other sites

Maybe try placing a magic effect on the actor that has a condition that checks GetActorValue for a specific range of values.

 

Or maybe place a magic effect on the actor, with a script which extends the vanilla Actor functions that modify actor values (

DamageActorValue, ForceActorValue, RestoreActorValue, SetActorValue). You would need to call the parent functions listed above, then call a new custom function that checks if the values have changed in the way that you require.

 

Still, I'm not sure how well that would work, or if it would detect changes made by perks, for example.

 

Either way, it still relies on constant polling and would be impractical/costly if you want to apply this to many actors at once.

Link to comment
Share on other sites

Here is a list of all the "On" commands, under O ... LINK ... from the Creation Kit site.

Possibly have an item the player interacts with in some way that holds the script for a simple 3 attribute check to kick off your custom event.

 

I already checked all of those, but it's not possible because the only way to get the maximum value is via an SKSE script command.

 

I managed to find a solution, unfortunately it's with updates:

Created a global variable to hold the current max attribute, every 2 seconds it checks if the maximum value is different - if so, the function runs.

 

Thanks for the help!

Link to comment
Share on other sites

  • Recently Browsing   0 members

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