Difference between revisions of "Script Processing"
→Remote Ref Heartbeat
imported>Wrye |
imported>Wrye |
||
Line 7: | Line 7: | ||
== Remote Ref Heartbeat == | == Remote Ref Heartbeat == | ||
Whenever a local variable on a persistent ref is set, the script of that reference will run | Whenever a local variable on a persistent ref is set, the script of that reference will be run in the next frame. Hence if a script continually sets a variable on itself, then it will continue to run every in every frame. | ||
;Positive: This can be used to effectively keep a remote reference in "high processing". E.g. if items are stored in a remote container, then ordinarily the OnDrop and OnUnequip blocks of those items will not be run since the container is not local, and thus not in high processing. But by "heartbeating" he remote container ref, the item blocks can be made to run. | |||
;Negative: Unintentional heartbeating of remote references will keep them permanently in high processing and thus hurt performance. Modders should ensure that script for persistent refs do not set a variable in every frame. (Be careful of this particularly in gameMode blocks, which are occasionally run even for out of scope persistent references.) | |||
Notes/Questions: | |||
* | * This does not appear for non-persistent refs. | ||
* | * How about actors with no low level processing? | ||
[[Category:Scripting]] | [[Category:Scripting]] |