Script Processing
Revision as of 07:56, 21 April 2006 by imported>Kkuhlmann
How often scripts are processed:
- Quest scripts: processed every 5 seconds (by default) when the quest is running. You can change how often quest scripts are processed by changing a default variable in the quest's script.
- Scripts on actors (Creatures and NPCs): processed every time the actor's AI is processed. In high process (the loaded area around the player), this is every frame. When the actor is not in high, this is much less often (down to once every 15 minutes of game time at the lowest process level). But these are still the only scripts (aside from quest scripts) that are processed when the player is not around.
- Scripts on references: processed every frame when its cell is loaded, not at all when the cell is not loaded. So these scripts run only when the player is nearby (which means these are often a good place to put relatively expensive scripts, doing things like distance checks).
- Scripts on objects in containers: these are processed when the container's script is processed -- so, items on actors are processed when the actor is processed; items in other containers are processed every frame when the cell is loaded.
- Scripts on doors: a bit of a special case, these scripts are processed like other scripts on references (every frame when loaded), but they will also be processed once any time an actor activates the door.