Jump to content

Detecting Changes in Actor Values


psychoorc99

Recommended Posts

This is a topic I'm interested in for future use, but for now I'm specifically modifying HP regeneration with a scripted usage of Player.ModAV HealRate whenever certain MCM options are changed (I'm keeping track of the total change in a quest variable for compatibility/resetting purposes). The basic idea is to be able to set a base HP regeneration rate and an END-dependent HP regeneration rate through an MCM and regenerate HP at the combined rate in-game. That all works fine right now, but the regeneration doesn't change when the player's Endurance value does since the script isn't called again unless a relevant MCM option is changed.

 

Is there any way to detect changes in SPECIAL and other actor values with an event handler, etc. without creating a quest script to do so? A quest script would work but I thought it seemed excessive to run a script every frame for something that doesn't happen very often, especially since I read somewhere that Get functions are relatively intensive. An event handler would be ideal but I haven't found one that does what I want with browsing the GECK wiki and googling things.

Edited by psychoorc99
Link to comment
Share on other sites

Suggest you look into the added functionality of the other "NVSE Extenders" such as "JohnnyGuitar NVSE" and "lStewieAl's Tweaks". The problem is that an "event" as defined in the GECKWiki doesn't really apply to changes to "Actor Values". You would have to intercept all possible events where a script might modify an AV (which is pretty much all of them), just to check for that series of functions and then apply your own logic to it.

 

I'm not quite following your logic here as MCM is an interface to essentially INI changes. They only are applied upon the game load; not dynamically during play. The crux of your problem seems to be that the script calculating your HP regen (dependent upon the END value) needs to run when the END changes. A simple "IF CurrEND <> PrevEND" conditional test that then calls your script will have minimal impact running every frame. (Just get "CurrEND" before the test, as that is more efficient than "inline".) When you think about it, an "EventHandler" has to run a check every frame as well, just to be able to detect the "event" has occurred.

 

Functional first; efficient second. "Efficiently nonfunctional" is an oxymoronic design.

 

-Dubious-

Link to comment
Share on other sites

 

Suggest you look into the added functionality of the other "NVSE Extenders" such as "JohnnyGuitar NVSE" and "lStewieAl's Tweaks". The problem is that an "event" as defined in the GECKWiki doesn't really apply to changes to "Actor Values". You would have to intercept all possible events where a script might modify an AV (which is pretty much all of them), just to check for that series of functions and then apply your own logic to it.

I'm not quite following your logic here as MCM is an interface to essentially INI changes. They only are applied upon the game load; not dynamically during play. The crux of your problem seems to be that the script calculating your HP regen (dependent upon the END value) needs to run when the END changes. A simple "IF CurrEND <> PrevEND" conditional test that then calls your script will have minimal impact running every frame. (Just get "CurrEND" before the test, as that is more efficient than "inline".) When you think about it, an "EventHandler" has to run a check every frame as well, just to be able to detect the "event" has occurred.

Functional first; efficient second. "Efficiently nonfunctional" is an oxymoronic design.

-Dubious-

 

Thanks, this pretty much answers my question. I was essentially looking for the most efficient way to run the script again whenever the END value changes and it sounds like a quest script is the way to go. Thanks also for the heads up not to oneline the getting and checking of END.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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