Difference between revisions of "OnCellAttach - ObjectReference"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Egocarib
m (Add note that OnCellAttach DOES fire for disabled objects.)
 
(2 intermediate revisions by 2 users not shown)
Line 26: Line 26:
*For notes on the meaning of attachment, see the [[Talk:OnCellAttach_-_ObjectReference|talk]] page.
*For notes on the meaning of attachment, see the [[Talk:OnCellAttach_-_ObjectReference|talk]] page.
*This event will NOT ever fire if used in a Player Alias script. The only cell attachment-related event that the Player seems to trigger is [[OnCellLoad - ObjectReference|OnCellLoad]]
*This event will NOT ever fire if used in a Player Alias script. The only cell attachment-related event that the Player seems to trigger is [[OnCellLoad - ObjectReference|OnCellLoad]]
*However, if you want to use this to track the player that is involved in a quest(not as an alias) you can make an xmarker and place it in the cell where you expect the player to be and attach a script containing this event, and check against the cell the player is in. This will work in conjunction with [[OnCellDetach - ObjectReference|OnCellDetach]].
* This event fires before [[OnReset - ObjectReference]].
* This event '''will''' fire for disabled objects.


== See Also ==
== See Also ==

Latest revision as of 21:04, 23 October 2023

Member of: ObjectReference Script

Event called when this reference's parent cell is attached.

Syntax[edit | edit source]

Event OnCellAttach()

Parameters[edit | edit source]

None.

Examples[edit | edit source]

Event OnCellAttach()
  Debug.Trace("Our parent cell has attached")
endEvent

Notes[edit | edit source]

  • This event seems to be reliably called before OnCellLoad.
  • This event will NOT fire in the first cell(s) loaded while loading from a save game.
  • For notes on the meaning of attachment, see the talk page.
  • This event will NOT ever fire if used in a Player Alias script. The only cell attachment-related event that the Player seems to trigger is OnCellLoad
  • However, if you want to use this to track the player that is involved in a quest(not as an alias) you can make an xmarker and place it in the cell where you expect the player to be and attach a script containing this event, and check against the cell the player is in. This will work in conjunction with OnCellDetach.
  • This event fires before OnReset - ObjectReference.
  • This event will fire for disabled objects.

See Also[edit | edit source]