Open main menu
Home
Random
Log in
Settings
About the CreationKit Wiki
Disclaimers
the CreationKit Wiki
Search
Editing
OnLoad - ObjectReference
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
[[Category:Scripting]] [[Category:Papyrus]] [[Category:Events]] '''Member of:''' [[ObjectReference Script]] Event called when the object's 3d is loaded and ready. At this point you should be able to animate the object, or manipulate it in other ways without issues. This event is sent every time the 3d is loaded, which may happen multiple times in a single game session. == Syntax == <syntaxhighlight lang="papyrus"> Event OnLoad() </syntaxhighlight> == Parameters == None. == Examples == <syntaxhighlight lang="papyrus"> Event OnLoad() Debug.Trace("This object is loaded, playing animations should work now") endEvent </syntaxhighlight> == Notes == *This event is only sent when an object's 3d is loaded. This may or may not have anything to do with its parent cell and/or the player's location in the world. *To be clear: For interiors, it often looks like this event fires whenever the player enters the cell. '''''It doesn't.''''' If you leave a cell, the cell may or may not have unloaded by the time you return, which means this event may or may not fire again. If you need a reliable event every time the player enters a cell, try attaching an [[OnCellAttach_-_ObjectReference|OnCellAttach]] event to any [[Object Reference]] in the cell instead. *This event will NOT ever fire if used in a Player Alias script. The only event related to cell attachment or 3D-loading that the Player themselves seems to trigger is [[OnCellLoad - ObjectReference|OnCellLoad]]. * This event doesn't fire reliably for references that load 3D while or immediately after the player loads a savegame. * This event '''will not''' fire for disabled objects. == See Also == *[[ObjectReference Script]] *[[OnUnload - ObjectReference]]
Summary:
Please note that all contributions to the CreationKit Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see
CreationKit:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)