Object scripts
From GECK
Object scripts are scripts that are attached to objects such as NPCs, Creatures, Activators and so on. Unlike quest scripts and effect scripts, object scripts can use almost all kinds of script blocks and have the biggest amount of them available.
Basic facts
- Object scripts must first be attached to an object in order to have any effect. They contain script blocks - a block is a piece of script meant to fire when a certain event related to the object happens, such as death, loading 3D data, being dropped, entering combat and so on.
- GameMode and MenuMode blocks inside object scripts will be executed every frame and the delay between reoccuring execution cycles cannot be modified, unlike quest scripts.
- A reference must be marked as persistent in order for its object script variables to be accessible outside of themselves.
- Every reference has its own, independent values from other references with the same object script.
- You can use the following syntax in order to access the variables of a given reference:
MyRef.MyVar
- You can use the following syntax in order to access the variables of a given reference:
- Object script variables can be used as dialogue conditions by using GetScriptVariable.
- Object scripts are running even for disabled references.
- User Defined Functions must be saved as object scripts in order to work.,