OnLoad

From GECK
Jump to: navigation, search

This block will be run once whenever the scripted object's 3D loads, i.e. whenever the player enters the cell (interior) or the object's cell is loaded in the 5x5 grid of exterior cells around the player.

Example

Begin OnLoad
 placeatme GrenadeFragExplosion
end

Notes

  • OnLoad blocks won't run on most disabled objects, because their 3D data isn't loaded.
  • OnLoad blocks will not run if the 3D data is buffered in memory. Do not expect the blocks to fire every time the player enters a cell with the actor/object that has an OnLoad block.
  • OnLoad blocks won't run if you are entering a cell in which you have just left.
  • OnLoad blocks will run on disabled triggers, which is a side effect of the fact that they don't have regular 3D data.
  • OnLoad blocks shouldn't in practice be used for actors, especially if there is a large number of them present. Using OnLoad effectively stops the game engine for a brief number of ticks, and having dozens of OnLoad blocks being run at the same time can cause the game to "hang" for a brief second.
  • OnLoad blocks appear to only run the first time a reference is loaded in a session.

See Also