Difference between revisions of "OnEquipped - ObjectReference"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Tunaisafish
(→‎Notes: native functions -> Member Functions)
imported>Shirakami
m (→‎Notes: added some information about the event and when it doesnt fire. see the discussion page for more information)
 
Line 25: Line 25:
== Notes ==
== Notes ==
*When an object is equipped it is inside a container, which means that you cannot call Member Functions on it. (Unless it is a persistent reference)
*When an object is equipped it is inside a container, which means that you cannot call Member Functions on it. (Unless it is a persistent reference)
*This event wont always fire. If the item is being equipped normally through the Inventory it works as intended. If it equipped through the console or papyrus calls instead, the event will not fire.


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

Latest revision as of 13:06, 2 February 2017

Member of: ObjectReference Script

Event called when the object reference has been equipped by an actor.

Syntax[edit | edit source]

Event OnEquipped(Actor akActor)

Parameters[edit | edit source]

  • akActor: The actor that equipped this object.

Examples[edit | edit source]

Event OnEquipped(Actor akActor)
  if akActor == Game.GetPlayer()
    Debug.Trace("We were equipped by the player!")
  endIf
endEvent

Notes[edit | edit source]

  • When an object is equipped it is inside a container, which means that you cannot call Member Functions on it. (Unless it is a persistent reference)
  • This event wont always fire. If the item is being equipped normally through the Inventory it works as intended. If it equipped through the console or papyrus calls instead, the event will not fire.

See Also[edit | edit source]