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.

ExampleEdit

Begin OnLoad
 placeatme GrenadeFragExplosion
end

NotesEdit

  • OnLoad blocks won't run on most disabled objects, because their 3D data isn't loaded.
  • 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 practise 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.

See AlsoEdit