Difference between revisions of "Script Processing"

Jump to navigation Jump to search
251 bytes added ,  19:50, 7 March 2009
imported>Wrye
imported>Wrye
 
== Remote Ref Heartbeat ==
Whenever a local variable on a persistent ref is set, the script of that reference will be run forin atthe least onenext frame after the setting. This means thatHence if, in that one frame, the referencea script againcontinually sets a variable on itself, then theit processwill iscontinue selfto continuingrun 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.
On the positive side, this means that it's possible to make a remote reference act as if is in scope for a prolonged period of time -- which is useful for remote containers. On the negative side, always in scope references will of course be a performance drain and should not happen unless necessary.
;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.)
 
Unanswered Notes/Questions:
* DoesThis thisdoes worknot appear for non-persistent objects? (I think notrefs.)
* How about actors with no low level processing?
* Does the heartbeat survive cell transitions and reloads?
** Keep in mind that if the heartbeat doesn't run during a frame (e.g. during menuMode), it should die.
 
[[Category:Scripting]]
Anonymous user

Navigation menu