Difference between revisions of "ObjectReference Script"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Behippo
(→‎SKSE Member Functions: Added SKSE Member Function list)
(→‎SKSE Member Functions: added note that actor's inventories ARE containers)
 
(17 intermediate revisions by 9 users not shown)
Line 1: Line 1:
[[Category:Scripting]]
[[Category:Papyrus]]
[[Category:Script Objects]]
'''Extends:''' [[Form Script]]
'''Extends:''' [[Form Script]]


Line 17: Line 13:
*float Y [read-only]: The current Y position of the reference.
*float Y [read-only]: The current Y position of the reference.
*float Z [read-only]: The current Z position of the reference.
*float Z [read-only]: The current Z position of the reference.
These properties are meant to be used when calling [[SetMotionType - ObjectReference|SetMotionType]]:
*int Motion_Dynamic [read-only]: 1
*int Motion_SphereInertia [read-only]: 2
*int Motion_BoxInertia [read-only]: 3
*int Motion_Keyframed [read-only]: 4
*int Motion_Fixed [read-only]: 5
*int Motion_ThinBoxInertia [read-only]: 6
*int Motion_Character [read-only]: 7


== Global Functions ==
== Global Functions ==
Line 22: Line 26:


== Member Functions ==
== Member Functions ==
'''Function [[Activate - ObjectReference|Activate]](ObjectReference akActivator)'''
*Have the passed in reference activate this object.


'''Function [[AddInventoryEventFilter - ObjectReference|AddInventoryEventFilter]](Form akFilter)'''
:'''[[Activate - ObjectReference|Activate]](ObjectReference ''akActivator'')'''
*Adds an inventory event filter to this reference.
:*Have the passed in reference activate this object.
 
:'''[[AddInventoryEventFilter - ObjectReference|AddInventoryEventFilter]](Form ''akFilter'')'''
:*Adds an inventory event filter to this reference.
 
:'''[[AddItem - ObjectReference|AddItem]](Form ''akItemToAdd'', Int ''aiCount'', Bool ''abSilent'')'''
:*Adds the passed in item to this object's inventory.
 
:'''[[AddKeyIfNeeded - ObjectReference|AddKeyIfNeeded]](ObjectReference ''ObjectWithNeededKey'')'''
:*Adds the key to ObjectWithNeededKey if this object's inventory does not contain it already.


'''Function [[AddItem - ObjectReference|AddItem]](Form akItemToAdd, int aiCount, bool abSilent)'''
:'''[[AddToMap - ObjectReference|AddToMap]](Bool ''abAllowFastTravel'')'''
*Adds the passed in item to this object's inventory.
:*Adds this map marker to the map, optionally making it available for fast travel.


'''Function [[AddKeyIfNeeded - ObjectReference|AddKeyIfNeeded]](ObjectReference ObjectWithNeededKey)'''
:'''[[ApplyHavokImpulse - ObjectReference|ApplyHavokImpulse]](Float ''afX'', Float ''afY'', Float ''afZ'', Float ''afMagnitude'')'''
*Adds the key to ObjectWithNeededKey if this object's inventory does not contain it already.
:*Apply a Havok impulse force to this object.


'''Function [[AddToMap - ObjectReference|AddToMap]](bool abAllowFastTravel)'''
:'''[[BlockActivation - ObjectReference|BlockActivation]](Bool ''abBlocked'')'''
*Adds this map marker to the map, optionally making it available for fast travel.
:*Blocks normal activation processing for this reference.


'''Function [[ApplyHavokImpulse - ObjectReference|ApplyHavokImpulse]](float afX, float afY, float afZ, float afMagnitude)'''
:'''Int [[CalculateEncounterLevel - ObjectReference|CalculateEncounterLevel]](Int ''aiDifficulty'')'''
*Apply a Havok impulse force to this object.
:*Calculate this object's encounter level, using the specified difficulty.


'''Function [[BlockActivation - ObjectReference|BlockActivation]](bool abBlocked)'''
:'''Bool [[CanFastTravelToMarker - ObjectReference|CanFastTravelToMarker]]()'''
*Blocks (or unblocks) normal activation processing for this reference.
:*Can the player fast travel to this map marker?


'''int Function [[CalculateEncounterLevel - ObjectReference|CalculateEncounterLevel]](int aiDifficulty)'''
:'''[[ClearDestruction - ObjectReference|ClearDestruction]]()'''
*Calculate this object's encounter level, using the specified difficulty.
:*Clears all effects of destruction from this object.


'''bool Function [[CanFastTravelToMarker - ObjectReference|CanFastTravelToMarker]]()'''
:'''Int [[CountLinkedRefChain - ObjectReference|CountLinkedRefChain]](Keyword ''apKeyword'', Int ''maxExpectedLinkedRefs'')'''
*Can the player fast travel to this map marker?
:*Counts the number of linked refs that are in a linked Ref chain


'''Function [[ClearDestruction - ObjectReference|ClearDestruction]]()'''
:'''[[CreateDetectionEvent - ObjectReference|CreateDetectionEvent]](Actor ''akOwner'', Int ''aiSoundLevel'')'''
*Clears all effects of destruction from this object.
:*Create a detection event at this reference, with the specified owner.


'''int Function [[CountLinkedRefChain - ObjectReference|CountLinkedRefChain]](keyword apKeyword, int maxExpectedLinkedRefs)'''
:'''[[DamageObject - ObjectReference|DamageObject]](Float ''afDamage'')'''
*Counts the number of linked refs that are in a linked Ref chain
:*Damages this object and advances the destruction stage.


'''Function [[CreateDetectionEvent - ObjectReference|CreateDetectionEvent]](Actor akOwner, int aiSoundLevel)'''
:'''[[Delete - ObjectReference|Delete]]()'''
*Create a detection event at this reference, with the specified owner.
:*Deletes this object.


'''Function [[DamageObject - ObjectReference|DamageObject]](float afDamage)'''
:'''[[DeleteWhenAble - ObjectReference|DeleteWhenAble]]()'''
*Damages this object and advances the destruction stage.
:*Waits until this reference is out of the loaded area and then deletes it


'''Function [[Delete - ObjectReference|Delete]]()'''
:'''[[Disable - ObjectReference|Disable]](Bool ''abFadeOut'')'''
*Deletes this object.
:*Disables this object.


'''Function [[DeleteWhenAble - ObjectReference|DeleteWhenAble]]()'''
:'''[[DisableLinkChain - ObjectReference|DisableLinkChain]](Keyword ''apKeyword'', Bool ''abFadeOut'')'''
*Waits until this reference is out of the loaded area and then deletes it
:*Disables all of the references that are linked, in a chain, to this one.


'''Function [[Disable - ObjectReference|Disable]](bool abFadeOut)'''
:'''[[DisableNoWait - ObjectReference|DisableNoWait]](Bool ''abFadeOut'')'''
*Disables this object.
:*Disables this object and does not wait for the object to be disable or faded out.


'''Function [[DisableLinkChain - ObjectReference|DisableLinkChain]](Keyword apKeyword, bool abFadeOut)'''
:'''[[DropObject - ObjectReference|DropObject]](Form ''akObject'', Int ''aiCount'')'''
*Disables all of the references that are linked, in a chain, to this one.
:*Drops the specified object from this object's inventory.


'''Function [[DisableNoWait - ObjectReference|DisableNoWait]](bool abFadeOut)'''
:'''[[Enable - ObjectReference|Enable]](Bool ''abFadeIn'')'''
*Disables this object and does not wait for the object to be disable or faded out.
:*Enables this object.


'''Function [[DropObject - ObjectReference|DropObject]](Form akObject, int aiCount)'''
:'''[[EnableFastTravel - ObjectReference|EnableFastTravel]](Bool ''abEnable'')'''
*Drops the specified object from this object's inventory.
:*Enables or disables fast travel to this map marker.


'''Function [[Enable - ObjectReference|Enable]](bool abFadeIn)'''
:'''[[EnableLinkChain - ObjectReference|EnableLinkChain]](Keyword ''apKeyword'')'''
*Enables this object.
:*Enables all of the references that are linked, in a chain, to this one.


'''Function [[EnableFastTravel - ObjectReference|EnableFastTravel]](bool abEnable) native'''
:'''[[EnableNoWait - ObjectReference|EnableNoWait]](Bool ''abFadeIn'')'''
*Enables or disables fast travel to this map marker.
:*Enables this object and does not wait for the object to be enabled or faded in.


'''Function [[EnableLinkChain - ObjectReference|EnableLinkChain]](Keyword apKeyword)'''
:'''[[ForceAddRagdollToWorld - ObjectReference|ForceAddRagdollToWorld]]()'''
*Enables all of the references that are linked, in a chain, to this one.
:*Forcibly adds the ragdoll of a reference to the world


'''Function [[EnableNoWait - ObjectReference|EnableNoWait]](bool abFadeIn)'''
:'''[[ForceRemoveRagdollFromWorld - ObjectReference|ForceRemoveRagdollFromWorld]]()'''
*Enables this object and does not wait for the object to be enabled or faded in.
:*Forcibly removes the ragdoll of a reference from the world


'''Function [[ForceAddRagdollToWorld - ObjectReference|ForceAddRagdollToWorld]]() native'''
:'''ActorBase [[GetActorOwner - ObjectReference|GetActorOwner]]()'''
*Forcibly adds the ragdoll of a reference to the world
:*Obtains the actor base that owns this object.


'''Function [[ForceRemoveRagdollFromWorld - ObjectReference|ForceRemoveRagdollFromWorld]]() native'''
:'''Float [[GetAngleX - ObjectReference|GetAngleX]]()'''
*Forcibly removes the ragdoll of a reference from the world
:*Obtains this object's rotation around the x axis.


'''ActorBase Function [[GetActorOwner - ObjectReference|GetActorOwner]]()'''
:'''Float [[GetAngleY - ObjectReference|GetAngleY]]()'''
*Obtains the actor base that owns this object.
:*Obtains this object's rotation around the y axis.


'''float Function [[GetAngleX - ObjectReference|GetAngleX]]()'''
:'''Float [[GetAngleZ - ObjectReference|GetAngleZ]]()'''
*Obtains this object's rotation around the x axis.
:*Obtains this object's rotation around the z axis.


'''float Function [[GetAngleY - ObjectReference|GetAngleY]]()'''
:'''Bool [[GetAnimationVariableBool - ObjectReference|GetAnimationVariableBool]](String ''asVariableName'')'''
*Obtains this object's rotation around the y axis.
:*Fetches the value of a variable on the reference's animation graph (bool version).


'''float Function [[GetAngleZ - ObjectReference|GetAngleZ]]()'''
:'''Float [[GetAnimationVariableFloat - ObjectReference|GetAnimationVariableFloat]](String ''asVariableName'')'''
*Obtains this object's rotation around the z axis.
:*Fetches the value of a variable on the reference's animation graph (float version).


'''bool Function [[GetAnimationVariableBool - ObjectReference|GetAnimationVariableBool]](string asVariableName)'''
:'''Int [[GetAnimationVariableInt - ObjectReference|GetAnimationVariableInt]](String ''asVariableName'')'''
*Fetches the value of a variable on the reference's animation graph (bool version).
:*Fetches the value of a variable on the reference's animation graph (int version).


'''float Function [[GetAnimationVariableFloat - ObjectReference|GetAnimationVariableFloat]](string asVariableName)'''
:'''Form [[GetBaseObject - ObjectReference|GetBaseObject]]()'''
*Fetches the value of a variable on the reference's animation graph (float version).
:*Obtains this reference's base object.


'''int Function [[GetAnimationVariableInt - ObjectReference|GetAnimationVariableInt]](string asVariableName)'''
:'''Int [[GetCurrentDestructionStage - ObjectReference|GetCurrentDestructionStage]]()'''
*Fetches the value of a variable on the reference's animation graph (int version).
:*Gets the object's current stage of destruction.


'''Form Function [[GetBaseObject - ObjectReference|GetBaseObject]]()'''
:'''Location [[GetCurrentLocation - ObjectReference|GetCurrentLocation]]()'''
*Obtains this reference's base object.
:*Obtains this reference's current location.


'''int Function [[GetCurrentDestructionStage - ObjectReference|GetCurrentDestructionStage]]()'''
:'''Scene [[GetCurrentScene - ObjectReference|GetCurrentScene]]()'''
*Gets the object's current stage of destruction.
:*Obtains the scene that this reference is currently participating in, if any.


'''Location Function [[GetCurrentLocation - ObjectReference|GetCurrentLocation]]()'''
:'''Float [[GetDistance - ObjectReference|GetDistance]](ObjectReference ''akOther'')'''
*Obtains this reference's current location.
:*Calculates the distance between this object and the passed in one.


'''Scene Function [[GetCurrentScene - ObjectReference|GetCurrentScene]]()'''
:'''Location [[GetEditorLocation - ObjectReference|GetEditorLocation]]()'''
*Obtains the scene that this reference is currently participating in, if any.
:*Obtains this reference's editor location.


'''float Function [[GetDistance - ObjectReference|GetDistance]](ObjectReference akOther)'''
:'''Faction [[GetFactionOwner - ObjectReference|GetFactionOwner]]()'''
*Calculates the distance between this object and the passed in one.
:*Gets the faction that owns this reference.


'''Location Function [[GetEditorLocation - ObjectReference|GetEditorLocation]]()'''
:'''Float [[GetHeadingAngle - ObjectReference|GetHeadingAngle]](ObjectReference ''akOther'')'''
*Obtains this reference's editor location.
:*Gets the angle between this object's heading, and the direction the other object is in.


'''Faction Function [[GetFactionOwner - ObjectReference|GetFactionOwner]]()'''
:'''Float [[GetHeight - ObjectReference|GetHeight]]()'''
*Gets the faction that owns this reference.
:*Gets the height of this object


'''float Function [[GetHeadingAngle - ObjectReference|GetHeadingAngle]](ObjectReference akOther)'''
:'''Int [[GetItemCount - ObjectReference|GetItemCount]](Form ''akItem'')'''
*Gets the angle between this object's heading, and the direction the other object is in.
:*Returns how many of the specified item is in this object's inventory.


'''float Function [[GetHeight - ObjectReference|GetHeight]]()'''
:'''Float [[GetItemHealthPercent - ObjectReference|GetItemHealthPercent]]()'''
*Gets the height of this object
:*Returns the item health percent of this object (1.0 == 100%).


'''int Function [[GetItemCount - ObjectReference|GetItemCount]](Form akItem)'''
:'''Key [[GetKey - ObjectReference|GetKey]]()'''
*Returns how many of the specified item is in this object's inventory.
:*Obtains the key that unlocks this object (if any).


'''float Function [[GetItemHealthPercent - ObjectReference|GetItemHealthPercent]]()'''
:'''Float [[GetLength - ObjectReference|GetLength]]()'''
*Returns the item health percent of this object (1.0 == 100%).
:*Obtains the length of this object.


'''Key Function [[GetKey - ObjectReference|GetKey]]()'''
:'''ObjectReference [[GetLinkedRef - ObjectReference|GetLinkedRef]](Keyword ''apKeyword'')'''
*Obtains the key that unlocks this object (if any).
:*Returns our linked reference for the given Keyword, if any.


'''float Function [[GetLength - ObjectReference|GetLength]]()'''
:'''Int [[GetLockLevel - ObjectReference|GetLockLevel]]()'''
*Obtains the length of this object.
:*Obtains the level of the lock on this object.


'''ObjectReference Function [[GetLinkedRef - ObjectReference|GetLinkedRef]](Keyword apKeyword)'''
:'''Float [[GetMass - ObjectReference|GetMass]]()'''
*Returns our linked reference for the given Keyword, if any.
:*Obtains this object's mass in Havok.


'''int Function [[GetLockLevel - ObjectReference|GetLockLevel]]()'''
:'''ObjectReference [[GetNthLinkedRef - ObjectReference|GetNthLinkedRef]](Int ''aiLinkedRef'')'''
*Obtains the level of the lock on this object.
:*Obtains the nth linked ref from this object.


'''float Function [[GetMass - ObjectReference|GetMass]]()'''
:'''Int [[GetOpenState - ObjectReference|GetOpenState]]()'''
*Obtains this object's mass in Havok.
:*Obtains this object's current "open state".


'''ObjectReference Function [[GetNthLinkedRef - ObjectReference|GetNthLinkedRef]](int aiLinkedRef)'''
:'''Cell [[GetParentCell - ObjectReference|GetParentCell]]()'''
*Obtains the nth linked ref from this object.
:*Obtains the cell this object is currently in.


'''int Function [[GetOpenState - ObjectReference|GetOpenState]]()'''
:'''Float [[GetPositionX - ObjectReference|GetPositionX]]()'''
*Obtains this object's current "open state".
:*Returns this object's current X position.


'''Cell Function [[GetParentCell - ObjectReference|GetParentCell]]()'''
:'''Float [[GetPositionY - ObjectReference|GetPositionY]]()'''
*Obtains the cell this object is currently in.
:*Returns this object's current Y position.


'''float Function [[GetPositionX - ObjectReference|GetPositionX]]()'''
:'''Float [[GetPositionZ - ObjectReference|GetPositionZ]]()'''
*Returns this object's current X position.
:*Returns this object's current Z position.


'''float Function [[GetPositionY - ObjectReference|GetPositionY]]()'''
:'''Float [[GetScale - ObjectReference|GetScale]]()'''
*Returns this object's current Y position.
:*Get this object's current scale.


'''float Function [[GetPositionZ - ObjectReference|GetPositionZ]]()'''
:'''Int [[GetTriggerObjectCount - ObjectReference|GetTriggerObjectCount]]()'''
*Returns this object's current Z position.
:*Returns the number of objects inside this trigger volume.


'''float Function [[GetScale - ObjectReference|GetScale]]()'''
:'''VoiceType [[GetVoiceType - ObjectReference|GetVoiceType]]()'''
*Get this object's current scale.
:*Obtains the [[VoiceType Script|VoiceType]] for this actor or talking activator.


'''int Function [[GetTriggerObjectCount - ObjectReference|GetTriggerObjectCount]]()'''
:'''Float [[GetWidth - ObjectReference|GetWidth]]()'''
*Returns the number of objects inside this trigger volume.
:*Get the current width of the object.


'''VoiceType function [[GetVoiceType - ObjectReference|GetVoiceType]]()'''
:'''Worldspace [[GetWorldSpace - ObjectReference|GetWorldSpace]]()'''
*Obtains the [[VoiceType Script|VoiceType]] for this actor or talking activator.
:*Returns the worldspace this reference is in.


'''float Function [[GetWidth - ObjectReference|GetWidth]]()'''
:'''Bool [[HasEffectKeyword - ObjectReference|HasEffectKeyword]](Keyword ''akKeyword'')'''
*Get the current width of the object.
:*Returns if this reference has an active effect coming from a magic effect with the specified keyword attached


'''Worldspace Function [[GetWorldSpace - ObjectReference|GetWorldSpace]]()'''
:'''Bool [[HasNode - ObjectReference|HasNode]](String ''asNodeName'')'''
*Returns the worldspace this reference is in.
:*Returns if this reference has the specified name node in its 3D.


'''bool Function [[HasEffectKeyword - ObjectReference|HasEffectKeyword]](Keyword akKeyword)'''
:'''Bool [[HasRefType - ObjectReference|HasRefType]](LocationRefType ''akRefType'')'''
*Returns if this reference has an active effect coming from a magic effect with the specified keyword attached
:*Returns if this reference has the specified [[LocationRefType Script|LocationRefType]] attached.


'''bool Function [[HasNode - ObjectReference|HasNode]](string asNodeName)'''
:'''[[IgnoreFriendlyHits - ObjectReference|IgnoreFriendlyHits]](Bool ''abIgnore'')'''
*Returns if this reference has the specified name node in its 3D.
:*Flags this reference as ignoring (or not ignoring) friendly hits


'''bool Function [[HasRefType - ObjectReference|HasRefType]](LocationRefType akRefType)'''
:'''[[InterruptCast - ObjectReference|InterruptCast]]()'''
*Returns if this reference has the specified [[LocationRefType Script|LocationRefType]] attached.
:*Interrupts any spellcasting this object may be doing.


'''Function [[IgnoreFriendlyHits - ObjectReference|IgnoreFriendlyHits]](bool abIgnore)'''
:'''Bool [[IsActivateChild - ObjectReference|IsActivateChild]](ObjectReference ''akChild'')'''
*Flags this reference as ignoring (or not ignoring) friendly hits
:*Returns whether the passed in reference is an activate child of this reference.


'''Function [[InterruptCast - ObjectReference|InterruptCast]]()'''
:'''Bool [[IsActivationBlocked - ObjectReference|IsActivationBlocked]]()'''
*Interrupts any spellcasting this object may be doing.
:*Returns whether normal activation processing is currently blocked on this reference or not.


'''bool Function [[IsActivateChild - ObjectReference|IsActivateChild]](ObjectReference akChild)'''
:'''Bool [[Is3DLoaded - ObjectReference|Is3DLoaded]]()'''
*Returns whether the passed in reference is an activate child of this reference.
:*Checks to see if this reference's 3D data is currently loaded or not.


'''bool Function [[IsActivationBlocked - ObjectReference|IsActivationBlocked]]()'''
:'''Bool [[IsDeleted - ObjectReference|IsDeleted]]()'''
*Returns whether normal activation processing is currently blocked on this reference or not.
:*Checks to see if this object is currently flagged for delete.  


'''bool Function [[Is3DLoaded - ObjectReference|Is3DLoaded]]()'''
:'''Bool [[IsDisabled - ObjectReference|IsDisabled]]()'''
*Checks to see if this reference's 3D data is currently loaded or not.
:*Is this object currently disabled?


'''bool Function [[IsDisabled - ObjectReference|IsDisabled]]()'''
:'''Bool [[IsEnabled - ObjectReference|IsEnabled]]()'''
*Is this object currently disabled?
:*Is this object currently enabled?


'''bool Function [[IsEnabled - ObjectReference|IsEnabled]]()'''
:'''Bool [[IsFurnitureInUse - ObjectReference|IsFurnitureInUse]](Bool ''abIgnoreReserved'')'''
*Is this object currently enabled?
:*Is any furniture marker on this object in use?


'''bool Function [[IsFurnitureInUse - ObjectReference|IsFurnitureInUse]](bool abIgnoreReserved)'''
:'''Bool [[IsFurnitureMarkerInUse - ObjectReference|IsFurnitureMarkerInUse]](Int ''aiMarker'', Bool ''abIgnoreReserved'')'''
*Is any furniture marker on this object in use?
:*Is the specified furniture marker on this object in use?


'''bool Function [[IsFurnitureMarkerInUse - ObjectReference|IsFurnitureMarkerInUse]](int aiMarker, bool abIgnoreReserved)'''
:'''Bool [[IsIgnoringFriendlyHits - ObjectReference|IsIgnoringFriendlyHits]]()'''
*Is the specified furniture marker on this object in use?
:*Is this object ignoring friendly hits?


'''bool Function [[IsIgnoringFriendlyHits - ObjectReference|IsIgnoringFriendlyHits]]()'''
:'''Bool [[IsInDialogueWithPlayer - ObjectReference|IsInDialogueWithPlayer]]()'''
*Is this object ignoring friendly hits?
:*Is this actor or talking activator currently talking to the player?


'''bool Function [[IsInDialogueWithPlayer - ObjectReference|IsInDialogueWithPlayer]]()'''
:'''Bool [[IsInInterior - ObjectReference|IsInInterior]]()'''
*Is this actor or talking activator currently talking to the player?
:*Returns true if the object is in an interior cell.


'''bool Function [[IsInInterior - ObjectReference|IsInInterior ]] ()'''
:'''Bool [[IsInLocation - ObjectReference|IsInLocation]](Location ''akLocation'')'''
*Returns true if the object is in an interior cell.
:*Returns true if the object is currently in that location or a child of that location.


'''bool Function [[IsInLocation - ObjectReference|IsInLocation]] (Location akLocation)'''
:'''Bool [[IsLocked - ObjectReference|IsLocked]]()'''
*Returns true if the object is currently in that location or a child of that location.
:*Is the lock on this object locked?


'''bool Function [[IsLocked - ObjectReference|IsLocked]]()'''
:'''Bool [[IsMapMarkerVisible - ObjectReference|IsMapMarkerVisible]]()'''
*Is the lock on this object locked?
:*Is this map marker visible to the player?


'''bool Function [[IsMapMarkerVisible - ObjectReference|IsMapMarkerVisible]]()'''
:'''Bool [[IsNearPlayer - ObjectReference|IsNearPlayer]]()'''
*Is this map marker visible to the player?
:*A quick-and-dirty function to tell if this object is safe to enable or disable


'''bool Function [[IsNearPlayer - ObjectReference|IsNearPlayer]]()'''
:'''[[KnockAreaEffect - ObjectReference|KnockAreaEffect]](Float ''afMagnitude'', Float ''afRadius'')'''
*A quick-and-dirty function to tell if this object is safe to enable or disable
:*Executes a knock effect to an area


'''Function [[KnockAreaEffect - ObjectReference|KnockAreaEffect]](float afMagnitude, float afRadius)'''
:'''[[Lock - ObjectReference|Lock]](Bool ''abLock'', Bool ''abAsOwner'')'''
*Executes a knock effect to an area
:*Locks or unlocks this object.


'''Function [[Lock - ObjectReference|Lock]](bool abLock, bool abAsOwner)'''
:'''[[MoveTo - ObjectReference|MoveTo]](ObjectReference ''akTarget'', Float ''afXOffset'', Float ''afYOffset'', Float ''afZOffset'', Bool ''abMatchRotation'')'''
*Locks or unlocks this object.
:*Moves this object to the same location as the passed-in reference, offset by the specified amount.


'''Function [[MoveTo - ObjectReference|MoveTo]](ObjectReference akTarget, float afXOffset, float afYOffset, float afZOffset, bool abMatchRotation)'''
:'''Bool [[MoveToIfUnloaded - ObjectReference|MoveToIfUnloaded]](ObjectReference ''akTarget'', Float ''afXOffset'', Float ''afYOffset'', Float ''afZOffset'')'''
*Moves this object to the same location as the passed-in reference, offset by the specified amount.
:*Moves this object to the same location as the passed-in reference, offset by the specified amount, IF this object is not currently loaded.


'''bool Function [[MoveToIfUnloaded - ObjectReference|MoveToIfUnloaded]](ObjectReference akTarget, float afXOffset, float afYOffset, float afZOffset)'''
:'''[[MoveToInteractionLocation - ObjectReference|MoveToInteractionLocation]](ObjectReference ''akTarget'')'''
*Moves this object to the same location as the passed-in reference, offset by the specified amount, IF this object is not currently loaded.
:*Moves this object to the specified object's interaction location.


'''Function [[MoveToInteractionLocation - ObjectReference|MoveToInteractionLocation]](ObjectReference akTarget)'''
:'''[[MoveToMyEditorLocation - ObjectReference|MoveToMyEditorLocation]]()'''
*Moves this object to the specified object's interaction location.
:*Moves this object to its own editor location.


'''Function [[MoveToMyEditorLocation - ObjectReference|MoveToMyEditorLocation]]()'''
:'''[[MoveToNode - ObjectReference|MoveToNode]](ObjectReference ''akTarget'', String ''asNodeName'')'''
*Moves this object to its own editor location.
:*Moves this object to the position (and rotation) of the specified node on the specified object's 3D


'''Function [[MoveToNode - ObjectReference|MoveToNode]](ObjectReference akTarget, string asNodeName)'''
:'''Actor [[PlaceActorAtMe - ObjectReference|PlaceActorAtMe]](ActorBase ''akActorToPlace'', Int ''aiLevelMod'', EncounterZone ''akZone'')'''
*Moves this object to the position (and rotation) of the specified node on the specified object's 3D
:*Create an actor at this object's location.


'''Actor Function [[PlaceActorAtMe - ObjectReference|PlaceActorAtMe]](ActorBase akActorToPlace, int aiLevelMod, EncounterZone akZone)'''
:'''ObjectReference [[PlaceAtMe - ObjectReference|PlaceAtMe]](Form ''akFormToPlace'', Int ''aiCount'')'''
*Create an actor at this object's location.
:*Places x copies of the passed in form at this object's current position, returning the last one created.


'''ObjectReference Function [[PlaceAtMe - ObjectReference|PlaceAtMe]](Form akFormToPlace, int aiCount)'''
:'''Bool [[PlayAnimation - ObjectReference|PlayAnimation]](String ''asAnimation'')'''
*Places x copies of the passed in form at this object's current position, returning the last one created.
:*Plays the specified animation on this object, returning immediately.


'''bool Function [[PlayAnimation - ObjectReference|PlayAnimation]](string asAnimation)'''
:'''Bool [[PlayAnimationAndWait - ObjectReference|PlayAnimationAndWait]](String ''asAnimation'', String ''asEventName'')'''
*Plays the specified animation on this object, returning immediately.
:*Plays the specified animation on this object and waits for the specified event before returning. (latent)


'''bool Function [[PlayAnimationAndWait - ObjectReference|PlayAnimationAndWait]](string asAnimation, string asEventName)'''
:'''Bool [[PlayGamebryoAnimation - ObjectReference|PlayGamebryoAnimation]](String ''asAnimation'', Bool ''abStartOver'', Float ''afEaseInTime'')'''
*Plays the specified animation on this object and waits for the specified event before returning. (latent)
:*Plays a legacy nif file based animation


'''bool Function [[PlayGamebryoAnimation - ObjectReference|PlayGamebryoAnimation]](string asAnimation, bool abStartOver, float afEaseInTime)'''
:'''Bool [[PlayImpactEffect - ObjectReference|PlayImpactEffect]](ImpactDataSet ''akImpactEffect'', String ''asNodeName'', Float ''afPickDirX'', Float ''afPickDirY'', Float ''afPickDirZ'', Float ''afPickLength'', Bool ''abApplyNodeRotation'', Bool ''abUseNodeLocalRotation'')'''
*Plays a legacy nif file based animation
:*Plays an impact effect.


'''bool Function [[PlayImpactEffect - ObjectReference|PlayImpactEffect]] (ImpactDataSet akImpactEffect, string asNodeName, float afPickDirX, float afPickDirY, float afPickDirZ, float afPickLength, bool abApplyNodeRotation, bool abUseNodeLocalRotation)'''
:'''Bool [[PlaySyncedAnimationAndWaitSS - ObjectReference|PlaySyncedAnimationAndWaitSS]](String ''asAnimation1'', String ''asEvent1'', ObjectReference ''akObj2'', String ''asAnimation2'', String ''asEvent2'')'''
*Plays an impact effect.
:*Plays two animations simultaneously, waiting for events from both.


'''bool Function [[PlaySyncedAnimationAndWaitSS - ObjectReference|PlaySyncedAnimationAndWaitSS]](string asAnimation1, string asEvent1, ObjectReference akObj2, string asAnimation2, string asEvent2)'''
:'''Bool [[PlaySyncedAnimationSS - ObjectReference|PlaySyncedAnimationSS]](String ''asAnimation1'', ObjectReference ''akObj2'', String ''asAnimation2'')'''
*Plays two animations simultaneously, waiting for events from both.
:*Plays two animations simultaneously.


'''bool Function [[PlaySyncedAnimationSS - ObjectReference|PlaySyncedAnimationSS]](string asAnimation1, ObjectReference akObj2, string asAnimation2)'''
:'''[[PlayTerrainEffect - ObjectReference |PlayTerrainEffect]](String ''asEffectModelName'', String ''asAttachBoneName'')'''
*Plays two animations simultaneously.
:*Plays a terrain effect.


'''Function [[PlayTerrainEffect - ObjectReference | PlayTerrainEffect]] (string asEffectModelName, string asAttachBoneName)'''
:'''[[ProcessTrapHit - ObjectReference|ProcessTrapHit]](ObjectReference ''akTrap'', Float ''afDamage'', Float ''afPushback'', Float ''afXVel'', Float ''afYVel'', Float ''afZVel'', Float ''afXPos'', Float ''afYPos'', Float ''afZPos'', Int ''aeMaterial'', Float ''afStagger'')'''
*Plays a terrain effect.
:*Tells this object to handle the specified trap object hitting it.


'''Function [[ProcessTrapHit - ObjectReference|ProcessTrapHit]](ObjectReference akTrap, float afDamage, float afPushback, float afXVel, float afYVel, float afZVel, float afXPos, float afYPos, float afZPos, int aeMaterial, float afStagger)'''
:'''[[PushActorAway - ObjectReference|PushActorAway]](Actor ''akActorToPush'', Int ''aiKnockbackDamage'')'''
*Tells this object to handle the specified trap object hitting it.
:*Pushes the other actor away from this object as if hit by the specified amount of knockback damage.


'''Function [[PushActorAway - ObjectReference|PushActorAway]](Actor akActorToPush, int aiKnockbackDamage)'''
:'''Bool [[RampRumble - ObjectReference|RampRumble]](Float ''power'', Float ''duration'', Float ''falloff'')'''
*Pushes the other actor away from this object as if hit by the specified amount of knockback damage.
:*Shakes cam/controller based on distance from player


'''bool Function [[RampRumble - ObjectReference|RampRumble]](float power, float duration, float falloff)'''
:'''[[RemoveAllInventoryEventFilters - ObjectReference|RemoveAllInventoryEventFilters]]()'''
*Shakes cam/controller based on distance from player
:*Remove all inventory event filters on this reference.


'''Function [[RemoveAllInventoryEventFilters - ObjectReference|RemoveAllInventoryEventFilters]]()'''
:'''[[RemoveAllItems - ObjectReference|RemoveAllItems]](ObjectReference ''akTransferTo'', Bool ''abKeepOwnership'', Bool ''abSilent'')'''
*Remove all inventory event filters on this reference.
:*Removes all items from this container, optionall transferring them to another one.


'''Function [[RemoveAllItems - ObjectReference|RemoveAllItems]](ObjectReference akTransferTo, bool abKeepOwnership, bool abSilent)'''
:'''[[RemoveInventoryEventFilter - ObjectReference|RemoveInventoryEventFilter]](Form ''akFilter'')'''
*Removes all items from this container, optionall transferring them to another one.
:*Remove a specific inventory event filter.


'''Function [[RemoveInventoryEventFilter - ObjectReference|RemoveInventoryEventFilter]](Form akFilter)'''
:'''[[RemoveItem - ObjectReference|RemoveItem]](Form ''akItemToRemove'', Int ''aiCount'', Bool ''abSilent'', ObjectReference ''akOtherContainer'')'''
*Remove a specific inventory event filter.
:*Removes the passed in item from this object's inventory.


'''Function [[RemoveItem - ObjectReference|RemoveItem]](Form akItemToRemove, int aiCount, bool abSilent)'''
:'''[[Reset - ObjectReference|Reset]](ObjectReference ''akTarget'')'''
*Removes the passed in item from this object's inventory.
:*Resets this object reference, optionally placing the object at the new target.


'''Function [[Reset - ObjectReference|Reset]](ObjectReference akTarget)'''
:'''[[Say - ObjectReference|Say]](Topic ''akTopicToSay'', Actor ''akActorToSpeakAs'', Bool ''abSpeakInPlayersHead'')'''
*Resets this object reference, optionally placing the object at the new target.
:*Causes this reference to speak a topic as if it were the specified actor.


'''Function [[Say - ObjectReference|Say]](Topic akTopicToSay, Actor akActorToSpeakAs, bool abSpeakInPlayersHead)'''
:'''[[SendStealAlarm - ObjectReference|SendStealAlarm]](Actor ''akThief'')'''
*Causes this reference to speak a topic as if it were the specified actor.
:*Sends a steal alarm as if this reference had just been stolen by the actor.


'''Function [[SendStealAlarm - ObjectReference|SendStealAlarm]](Actor akThief)'''
:'''[[SetActorCause - ObjectReference|SetActorCause]](Actor ''akActor'')'''
*Sends a steal alarm as if this reference had just been stolen by the actor.
:*Sets this actor as this object's actor cause.


'''Function [[SetActorCause - ObjectReference|SetActorCause]](Actor akActor)'''
:'''[[SetActorOwner - ObjectReference|SetActorOwner]](ActorBase ''akActorBase'')'''
*Sets this actor as this object's actor cause.
:*Sets this actor base as this object's owner.


'''Function [[SetActorOwner - ObjectReference|SetActorOwner]](ActorBase akActorBase)'''
:'''[[SetAngle - ObjectReference|SetAngle]](Float ''afXAngle'', Float ''afYAngle'', Float ''afZAngle'')'''
*Sets this actor base as this object's owner.
:*Sets this object's rotation. Angles are in degrees.


'''Function [[SetAngle - ObjectReference|SetAngle]](float afXAngle, float afYAngle, float afZAngle)'''
:'''[[SetAnimationVariableBool - ObjectReference|SetAnimationVariableBool]](String ''asVariableName'', Bool ''abNewValue'')'''
*Sets this object's rotation. Angles are in degrees.
:*Sets the value of a variable on the reference's animation graph (bool version).


'''Function [[SetAnimationVariableBool - ObjectReference|SetAnimationVariableBool]](string asVariableName, bool abNewValue)'''
:'''[[SetAnimationVariableFloat - ObjectReference|SetAnimationVariableFloat]](String ''asVariableName'', Float ''afNewValue'')'''
*Sets the value of a variable on the reference's animation graph (bool version).
:*Sets the value of a variable on the reference's animation graph (float version).


'''Function [[SetAnimationVariableFloat - ObjectReference|SetAnimationVariableFloat]](string asVariableName, float afNewValue)'''
:'''[[SetAnimationVariableInt - ObjectReference|SetAnimationVariableInt]](String ''asVariableName'', Int ''aiNewValue'')'''
*Sets the value of a variable on the reference's animation graph (float version).
:*Sets the value of a variable on the reference's animation graph (int version).


'''Function [[SetAnimationVariableInt - ObjectReference|SetAnimationVariableInt]](string asVariableName, int aiNewValue)'''
:'''[[SetDestroyed - ObjectReference|SetDestroyed]](Bool ''abDestroyed'')'''
*Sets the value of a variable on the reference's animation graph (int version).
:*Sets or clears this object's destroyed flag.


'''Function [[SetDestroyed - ObjectReference|SetDestroyed]](bool abDestroyed)'''
:'''[[SetFactionOwner - ObjectReference|SetFactionOwner]](Faction ''akFaction'')'''
*Sets or clears this object's destroyed flag.
:*Sets this faction as this object's owner.


'''Function [[SetFactionOwner - ObjectReference|SetFactionOwner]](Faction akFaction)'''
:'''[[SetLockLevel - ObjectReference|SetLockLevel]](Int ''aiLockLevel'')'''
*Sets this faction as this object's owner.
:*Sets the lock level on this object.


'''Function [[SetLockLevel - ObjectReference|SetLockLevel]](int aiLockLevel)'''
:'''[[SetMotionType - ObjectReference|SetMotionType]](Int ''aiMotionType'', Bool ''abAllowActivate'')'''
*Sets the lock level on this object.
:*Sets the havok motion type on this object.


'''Function [[SetMotionType - ObjectReference|SetMotionType]](int aiMotionType, bool abAllowActivate)'''
:'''[[SetNoFavorAllowed - ObjectReference|SetNoFavorAllowed]](Bool ''abNoFavor'')'''
*Sets the havok motion type on this object.
:*Sets or clears this object's ability to be not used by a teammate for a favor


'''Function [[SetNoFavorAllowed - ObjectReference|SetNoFavorAllowed]](bool abNoFavor)'''
:'''[[SetOpen - ObjectReference|SetOpen]](Bool ''abOpen'')'''
*Sets or clears this object's ability to be not used by a teammate for a favor
:*Opens or closes this object.


'''Function [[SetOpen - ObjectReference|SetOpen]](bool abOpen)'''
:'''[[SetPosition - ObjectReference|SetPosition]](Float ''afX'', Float ''afY'', Float ''afZ'')'''
*Opens or closes this object.
:*Sets this object's position.


'''Function [[SetPosition - ObjectReference|SetPosition]](float afX, float afY, float afZ)'''
:'''[[SetScale - ObjectReference|SetScale]](Float ''afScale'')'''
*Sets this object's position.
:*Set the current scale of the object


'''Function [[SetScale - ObjectReference|SetScale]](float afScale)'''
:'''[[SplineTranslateTo - ObjectReference|SplineTranslateTo]](Float ''afX'', Float ''afY'', Float ''afZ'', Float ''afAngleX'', Float ''afAngleY'', Float ''afAngleZ'', Float ''afSplineCurve'', Float ''afSpeed'')'''
*Set the current scale of the object
:*Makes the object translate to the given pos/orient on a spline.


'''Function [[SplineTranslateTo - ObjectReference|SplineTranslateTo]](float afX, float afY, float afZ, float afAngleX, float afAngleY, float afAngleZ, float afSplineCurve, float afSpeed)'''
:'''[[SplineTranslateToRef - ObjectReference|SplineTranslateToRef]](ObjectReference ''arTarget'', Float ''afTangentMagnitude'', Float ''afSpeed'', Float ''afMaxRotationSpeed'')'''
*Makes the object translate to the given pos/orient on a spline.
:*Makes the reference translate to the target ref position/orient on a spline at the given speed


'''Function [[SplineTranslateToRef - ObjectReference|SplineTranslateToRef]](ObjectReference arTarget, float afTangentMagnitude, float afSpeed, float afMaxRotationSpeed)'''
:'''[[SplineTranslateToRefNode - ObjectReference|SplineTranslateToRefNode]](ObjectReference ''arTarget'', String ''arNodeName'', Float ''afTangentMagnitude'', Float ''afSpeed'', Float ''afMaxRotationSpeed'')'''
*Makes the reference translate to the target ref position/orient on a spline at the given speed
:*Makes the reference translate to the target node's position/orient on a spline at the given speed


'''Function [[SplineTranslateToRefNode - ObjectReference|SplineTranslateToRefNode]](ObjectReference arTarget, string arNodeName, float afTangentMagnitude, float afSpeed, float afMaxRotationSpeed)'''
:'''[[StopTranslation - ObjectReference|StopTranslation]]()'''
*Makes the reference translate to the target node's position/orient on a spline at the given speed
:*Stops any translation on the object.


'''Function [[StopTranslation - ObjectReference|StopTranslation]]()'''
:'''[[TetherToHorse - ObjectReference|TetherToHorse]](ObjectReference ''akHorse'')'''
*Stops any translation on the object.
:*Tether a prisoner cart to the given horse.


'''Function [[TetherToHorse - ObjectReference|TetherToHorse]](ObjectReference akHorse)'''
:'''[[TranslateTo - ObjectReference|TranslateTo]](Float ''afX'', Float ''afY'', Float ''afZ'', Float ''afAngleX'', Float ''afAngleY'', Float ''afAngleZ'', Float ''afSpeed'', Float ''afMaxRotationSpeed'')'''
*Tether a prisoner cart to the given horse.
:*Makes the object translate to the given pos/orient.


'''Function [[TranslateTo - ObjectReference|TranslateTo]](float afX, float afY, float afZ, float afAngleX, float afAngleY, float afAngleZ, float afSpeed, float afMaxRotationSpeed)'''
:'''[[TranslateToRef - ObjectReference|TranslateToRef]](ObjectReference ''arTarget'', Float ''afSpeed'', Float ''afMaxRotationSpeed'')'''
*Makes the object translate to the given pos/orient.
:*Makes the reference translate to the target ref position/orient at the given speed


'''Function [[TranslateToRef - ObjectReference|TranslateToRef]](ObjectReference arTarget, float afSpeed, float afMaxRotationSpeed)'''
:'''Bool [[WaitForAnimationEvent - ObjectReference|WaitForAnimationEvent]](String ''asEventName'')'''
*Makes the reference translate to the target ref position/orient at the given speed
:*Waits for the animation graph to send the specified event.


'''bool Function [[WaitForAnimationEvent - ObjectReference|WaitForAnimationEvent]](string asEventName)'''
*Waits for the animation graph to send the specified event.


== SKSE Member Functions ==
== SKSE Member Functions ==
'''int Function [[GetNumItems - ObjectReference|GetNumItems]]()'''
* (Container only) Returns the number of forms in the container.


'''Form Function [[GetNthForm - ObjectReference|GetNthForm]](int index)'''
:'''Form[] [[GetContainerForms - ObjectReference|GetContainerForms]]()'''
* (Container only) Returns the specified form from the container.
:* (Container only) Returns an array of the forms in a container. (Actor ObjectReferences are containers)
 
:'''Int [[GetNumItems - ObjectReference|GetNumItems]]()'''
:* (Container only) Returns the number of forms in the container. (Actor ObjectReferences are containers)
 
:'''Form [[GetNthForm - ObjectReference|GetNthForm]](Int ''index'')'''
:* (Container only) Returns the specified form from the container. (Actor ObjectReferences are containers)
 
:'''Float [[GetTotalItemWeight - ObjectReference|GetTotalItemWeight]]()'''
:* (Container only - perhaps Player only) Returns the total weight of all items held in the container.
 
:'''Float [[GetTotalArmorWeight - ObjectReference|GetTotalArmorWeight]]()'''
:* (Container only - perhaps Player only) Returns the total weight of the armor in the container.
 
:'''Bool [[IsHarvested - ObjectReference|IsHarvested]]()'''
:* (Flora and Tree only) Returns whether the flora has been harvested or not.
 
:'''[[SetHarvested - ObjectReference|SetHarvested]](Bool ''harvested'')'''
:*Sets whether the Reference has been harvested.
 
:'''[[SetItemHealthPercent - ObjectReference|SetItemHealthPercent]](Float ''health'')'''
:* Set the item's tempering. 1.0 is no tempering, 1.6 appears to be legendary. Values below 1.0 do nothing.
 
:''' [[SetItemMaxCharge - ObjectReference|SetItemMaxCharge]](Float ''maxCharge'')'''
:*Sets the maximum charge of the item.(Only works on player enchants)


'''float Function [[GetTotalItemWeight - ObjectReference|GetTotalItemWeight]]()'''
:'''Float [[GetItemMaxCharge - ObjectReference|GetItemMaxCharge]]()'''
* (Container only - perhaps Player only) Returns the total weight of all items held in the container.
:* Gets the maximum charge of the item.


'''float Function [[GetTotalArmorWeight - ObjectReference|GetTotalArmorWeight]]()'''
:'''Float [[GetItemCharge - ObjectReference|GetItemCharge]]()'''
* (Container only - perhaps Player only) Returns the total weight of the armor in the container.
:* Gets the current charge of the item.


'''bool Function [[IsHarvested - ObjectReference|IsHarvested]]()'''
:'''[[SetItemCharge - ObjectReference|SetItemCharge]](Float ''charge'')'''
* (Flora and Tree only) Returns whether the flora has been harvested or not.
:*Sets the item's charge to the specified amount.
 
:'''[[ResetInventory - ObjectReference|ResetInventory]]()'''
:*Resets the References inventory.
 
:'''Bool [[IsOffLimits - ObjectReference|IsOffLimits]]()'''
:*
 
:'''String [[GetDisplayName - ObjectReference|GetDisplayName]]()'''
:*Returns the name of the reference (This is the name that is displayed)
 
:'''Bool [[SetDisplayName - ObjectReference|SetDisplayName]](String ''name'', Bool ''force'')'''
:*Sets the reference's display name.
 
:'''ObjectReference [[GetEnableParent - ObjectReference|GetEnableParent]]()'''
:*Returns the enable parent of the object.
 
:'''Enchantment [[GetEnchantment- ObjectReference|GetEnchantment]]()'''
:*Returns the player-made enchantment of the object (if there is one)
 
:'''[[SetEnchantment - ObjectReference|SetEnchantment]](Enchantment ''source'', Float ''maxCharge'')'''
:*Changes an item's player-made enchantment to another.
 
:'''[[CreateEnchantment - ObjectReference|CreateEnchantment]](Float ''maxCharge'', MagicEffect[] ''effects'', Float[] ''magnitudes'', Int[] ''areas'', Int[] ''durations'')'''
:*Creates a new Enchantment on the item with the specified parameters.
 
:'''Int [[GetNumReferenceAliases - ObjectReference|GetNumReferenceAliases]]()'''
:*Returns the number of reference aliases holding this reference.
 
:'''ReferenceAlias [[GetNthReferenceAlias - ObjectReference|GetNthReferenceAlias]](Int ''n'')'''
:*Returns the nth Reference alias holding this reference.


== Events ==
== Events ==
'''Event [[OnActivate - ObjectReference|OnActivate]](ObjectReference akActionRef)'''
*Event received when this object is activated.


'''Event [[OnAttachedToCell - ObjectReference|OnAttachedToCell]]()'''
:'''[[OnActivate - ObjectReference|OnActivate]](ObjectReference ''akActionRef'')'''
*Event received when this reference moves from a detached cell to an attached one.
:*Event received when this object is activated.
 
:'''[[OnAttachedToCell - ObjectReference|OnAttachedToCell]]()'''
:*Event received when this reference moves from a detached cell to an attached one.
 
:'''[[OnCellAttach - ObjectReference|OnCellAttach]]()'''
:*Event received when this reference's parent cell attaches.


'''Event [[OnCellAttach - ObjectReference|OnCellAttach]]()'''
:'''[[OnCellDetach - ObjectReference|OnCellDetach]]()'''
*Event received when this reference's parent cell attaches.
:*Event received when this reference's parent cell detaches.


'''Event [[OnCellDetach - ObjectReference|OnCellDetach]]()'''
:'''[[OnCellLoad - ObjectReference|OnCellLoad]]()'''
*Event received when this reference's parent cell detaches.
:*Event received when everything in the cell that holds this reference has loaded.


'''Event [[OnCellLoad - ObjectReference|OnCellLoad]]()'''
:'''[[OnClose - ObjectReference|OnClose]](ObjectReference ''akActionRef'')'''
*Event received when everything in the cell that holds this reference has loaded.
:*Event received when this object is finished closing.


'''Event [[OnClose - ObjectReference|OnClose]](ObjectReference akActionRef)'''
:'''[[OnContainerChanged - ObjectReference|OnContainerChanged]](ObjectReference ''akNewContainer'', ObjectReference ''akOldContainer'')'''
*Event received when this object is finished closing.
:*Event received when an object moves into/out of/between containers.


'''Event [[OnContainerChanged - ObjectReference|OnContainerChanged]](ObjectReference akNewContainer, ObjectReference akOldContainer)'''
:'''[[OnDestructionStageChanged - ObjectReference|OnDestructionStageChanged]](Int ''aiOldStage'', Int ''aiCurrentStage'')'''
*Event received when an object moves into/out of/between containers.
:*Event received when this object's destruction stage has worsened.


'''Event [[OnDestructionStageChanged - ObjectReference|OnDestructionStageChanged]](int aiOldStage, int aiCurrentStage)'''
:'''[[OnDetachedFromCell - ObjectReference|OnDetachedFromCell]]()'''
*Event received when this object's destruction stage has worsened.
:*Event received when this object moves from an attached cell to a detached cell.


'''Event [[OnDetachedFromCell - ObjectReference|OnDetachedFromCell]]()'''
:'''[[OnEquipped - ObjectReference|OnEquipped]](Actor ''akActor'')'''
*Event received when this object moves from an attached cell to a detached cell.
:*Event received when this object is equipped by an actor.


'''Event [[OnEquipped - ObjectReference|OnEquipped]](Actor akActor)'''
:'''[[OnGrab - ObjectReference|OnGrab]]()'''
*Event received when this object is equipped by an actor.
:*Event received when this object is grabbed (z-keyed) by the player.


'''Event [[OnGrab - ObjectReference|OnGrab]]()'''
:'''[[OnHit - ObjectReference|OnHit]](ObjectReference ''akAggressor'', Form ''akSource'', Projectile ''akProjectile'', Bool ''abPowerAttack'', Bool ''abSneakAttack'', Bool ''abBashAttack'', Bool ''abHitBlocked'')'''
*Event received when this object is grabbed (z-keyed) by the player.
:*Event received when this object is hit with a weapon or projectile.


'''Event [[OnHit - ObjectReference|OnHit]](ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)'''
:'''[[OnItemAdded - ObjectReference|OnItemAdded]](Form ''akBaseItem'', Int ''aiItemCount'', ObjectReference ''akItemReference'', ObjectReference ''akSourceContainer'')'''
*Event received when this object is hit with a weapon or projectile.
:*Event received when an item is inserted into this object's container.


'''Event [[OnItemAdded - ObjectReference|OnItemAdded]](Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)'''
:'''[[OnItemRemoved - ObjectReference|OnItemRemoved]](Form ''akBaseItem'', Int ''aiItemCount'', ObjectReference ''akItemReference'', ObjectReference ''akDestContainer'')'''
*Event received when an item is inserted into this object's container.
:*Event received when an item is removed from this object's container.


'''Event [[OnItemRemoved - ObjectReference|OnItemRemoved]](Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer)'''
:'''[[OnLoad - ObjectReference|OnLoad]]()'''
*Event received when an item is removed from this object's container.
:*Event received when this object's 3d is loaded and ready.


'''Event [[OnLoad - ObjectReference|OnLoad]]()'''
:'''[[OnLockStateChanged - ObjectReference|OnLockStateChanged]]()'''
*Event received when this object's 3d is loaded and ready.
:*Event received when the lock on this object changes its state.


'''Event [[OnLockStateChanged - ObjectReference|OnLockStateChanged]]()'''
:'''[[OnMagicEffectApply - ObjectReference|OnMagicEffectApply]](ObjectReference ''akCaster'', MagicEffect ''akEffect'')'''
*Event received when the lock on this object changes its state.
:*Event received when a magic effect is attempting to be applied to this reference.


'''Event [[OnMagicEffectApply - ObjectReference|OnMagicEffectApply]](ObjectReference akCaster, MagicEffect akEffect)'''
:'''[[OnOpen - ObjectReference|OnOpen]](ObjectReference ''akActionRef'')'''
*Event received when a magic effect is attempting to be applied to this reference.
:*Event received when this object is fully opened.


'''Event [[OnOpen - ObjectReference|OnOpen]](ObjectReference akActionRef)'''
:'''[[OnRead - ObjectReference|OnRead]]()'''
*Event received when this object is fully opened.
:*Event received when this object is read. (Only applies to books)


'''Event [[OnRead - ObjectReference|OnRead]]()'''
:'''[[OnRelease - ObjectReference|OnRelease]]()'''
*Event received when this object is read. (Only applies to books)
:*Event received when this object is released by the player (stopped z-keying).


'''Event [[OnRelease - ObjectReference|OnRelease]]()'''
:'''[[OnReset - ObjectReference|OnReset]]()'''
*Event received when this object is released by the player (stopped z-keying).
:*Event received when this object is reset.


'''Event [[OnReset - ObjectReference|OnReset]]()'''
:'''[[OnSell - ObjectReference|OnSell]](Actor ''akSeller'')'''
*Event received when this object is reset.
:*Event received when this object is sold by someone.


'''Event [[OnSell - ObjectReference|OnSell]](Actor akSeller)'''
:'''[[OnSpellCast - ObjectReference|OnSpellCast]](Form ''akSpell'')'''
*Event received when this object is sold by someone.
:*Event received when this object casts a spell.


'''Event [[OnSpellCast - ObjectReference|OnSpellCast]](Form akSpell)'''
:'''[[OnTrapHit - ObjectReference|OnTrapHit]](ObjectReference ''akTarget'', Float ''afXVel'', Float ''afYVel'', Float ''afZVel'', Float ''afXPos'', Float ''afYPos'', Float ''afZPos'', Int ''aeMaterial'', Bool ''abInitialHit'', Int ''aeMotionType'')'''
*Event received when this object casts a spell.
:*Event received when this trap object hits a target.


'''Event [[OnTrapHit - ObjectReference|OnTrapHit]](ObjectReference akTarget, float afXVel, float afYVel, float afZVel, float afXPos, float afYPos, float afZPos, int aeMaterial, bool abInitialHit, int aeMotionType)'''
:'''[[OnTrapHitStart - ObjectReference|OnTrapHitStart]](ObjectReference ''akTarget'', Float ''afXVel'', Float ''afYVel'', Float ''afZVel'', Float ''afXPos'', Float ''afYPos'', Float ''afZPos'', Int ''aeMaterial'', Bool ''abInitialHit'', Int ''aeMotionType'')'''
*Event received when this trap object hits a target.
:*Event received when this trap object starts colliding with a target.


'''Event [[OnTrapHitStart - ObjectReference|OnTrapHitStart]](ObjectReference akTarget, float afXVel, float afYVel, float afZVel, float afXPos, float afYPos, float afZPos, int aeMaterial, bool abInitialHit, int aeMotionType)'''
:'''[[OnTrapHitStop - ObjectReference|OnTrapHitStop]](ObjectReference ''akTarget'')'''
*Event received when this trap object starts colliding with a target.
:*Event received when this trap object stops colliding with a target.


'''Event [[OnTrapHitStop - ObjectReference|OnTrapHitStop]](ObjectReference akTarget)'''
:'''[[OnTranslationAlmostComplete - ObjectReference|OnTranslationAlmostComplete]]()'''
*Event received when this trap object stops colliding with a target.
:*Event received when a translation request is almost complete.


'''Event [[OnTranslationAlmostComplete - ObjectReference|OnTranslationAlmostComplete]]()'''
:'''[[OnTranslationComplete - ObjectReference|OnTranslationComplete]]()'''
*Event received when a translation request is almost complete.
:*Event received when a translation request is complete.


'''Event [[OnTranslationComplete - ObjectReference|OnTranslationComplete]]()'''
:'''[[OnTranslationFailed - ObjectReference|OnTranslationFailed]]()'''
*Event received when a translation request is complete.
:*Event received when a translation request has failed.


'''Event [[OnTranslationFailed - ObjectReference|OnTranslationFailed]]()'''
:'''[[OnTrigger - ObjectReference|OnTrigger]](ObjectReference ''akActionRef'')'''
*Event received when a translation request has failed.
:*Event received when this object is triggered.


'''Event [[OnTrigger - ObjectReference|OnTrigger]](ObjectReference akActionRef)'''
:'''[[OnTriggerEnter - ObjectReference|OnTriggerEnter]](ObjectReference ''akActionRef'')'''
*Event received when this object is triggered.
:*Event received when this object's volume is entered.


'''Event [[OnTriggerEnter - ObjectReference|OnTriggerEnter]](ObjectReference akActionRef)'''
:'''[[OnTriggerLeave - ObjectReference|OnTriggerLeave]](ObjectReference ''akActionRef'')'''
*Event received when this object's volume is entered.
:*Event received when this object's volume is left.


'''Event [[OnTriggerLeave - ObjectReference|OnTriggerLeave]](ObjectReference akActionRef)'''
:'''[[OnUnequipped - ObjectReference|OnUnequipped]](Actor ''akActor'')'''
*Event received when this object's volume is left.
:*Event received when this object is unequipped by an actor.


'''Event [[OnUnequipped - ObjectReference|OnUnequipped]](Actor akActor)'''
:'''[[OnUnload - ObjectReference|OnUnload]]()'''
*Event received when this object is unequipped by an actor.
:*Event received when this object's 3d has been unloaded.


'''Event [[OnUnload - ObjectReference|OnUnload]]()'''
:'''[[OnWardHit - ObjectReference|OnWardHit]](ObjectReference ''akCaster'', Spell ''akSpell'', Int ''aiStatus'')'''
*Event received when this object's 3d has been unloaded.
:*Event called when the object reference is using a ward that is hit by a spell.


'''Event [[OnWardHit - ObjectReference|OnWardHit]](ObjectReference akCaster, Spell akSpell, int aiStatus)'''
 
*Event called when the object reference is using a ward that is hit by a spell.
[[Category:Scripting]]
[[Category:Papyrus]]
[[Category:Script Objects]]
[[Category:SKSE]]

Latest revision as of 08:48, 21 March 2022

Extends: Form Script

Script for the manipulation of object instances.
If you are adding a script to an object that is going to be a reference in the world (like a button for example) your script will need to extend this script.

Definition[edit | edit source]

ScriptName ObjectReference extends Form

Properties[edit | edit source]

  • float X [read-only]: The current X position of the reference.
  • float Y [read-only]: The current Y position of the reference.
  • float Z [read-only]: The current Z position of the reference.

These properties are meant to be used when calling SetMotionType:

  • int Motion_Dynamic [read-only]: 1
  • int Motion_SphereInertia [read-only]: 2
  • int Motion_BoxInertia [read-only]: 3
  • int Motion_Keyframed [read-only]: 4
  • int Motion_Fixed [read-only]: 5
  • int Motion_ThinBoxInertia [read-only]: 6
  • int Motion_Character [read-only]: 7

Global Functions[edit | edit source]

None

Member Functions[edit | edit source]

Activate(ObjectReference akActivator)
  • Have the passed in reference activate this object.
AddInventoryEventFilter(Form akFilter)
  • Adds an inventory event filter to this reference.
AddItem(Form akItemToAdd, Int aiCount, Bool abSilent)
  • Adds the passed in item to this object's inventory.
AddKeyIfNeeded(ObjectReference ObjectWithNeededKey)
  • Adds the key to ObjectWithNeededKey if this object's inventory does not contain it already.
AddToMap(Bool abAllowFastTravel)
  • Adds this map marker to the map, optionally making it available for fast travel.
ApplyHavokImpulse(Float afX, Float afY, Float afZ, Float afMagnitude)
  • Apply a Havok impulse force to this object.
BlockActivation(Bool abBlocked)
  • Blocks normal activation processing for this reference.
Int CalculateEncounterLevel(Int aiDifficulty)
  • Calculate this object's encounter level, using the specified difficulty.
Bool CanFastTravelToMarker()
  • Can the player fast travel to this map marker?
ClearDestruction()
  • Clears all effects of destruction from this object.
Int CountLinkedRefChain(Keyword apKeyword, Int maxExpectedLinkedRefs)
  • Counts the number of linked refs that are in a linked Ref chain
CreateDetectionEvent(Actor akOwner, Int aiSoundLevel)
  • Create a detection event at this reference, with the specified owner.
DamageObject(Float afDamage)
  • Damages this object and advances the destruction stage.
Delete()
  • Deletes this object.
DeleteWhenAble()
  • Waits until this reference is out of the loaded area and then deletes it
Disable(Bool abFadeOut)
  • Disables this object.
DisableLinkChain(Keyword apKeyword, Bool abFadeOut)
  • Disables all of the references that are linked, in a chain, to this one.
DisableNoWait(Bool abFadeOut)
  • Disables this object and does not wait for the object to be disable or faded out.
DropObject(Form akObject, Int aiCount)
  • Drops the specified object from this object's inventory.
Enable(Bool abFadeIn)
  • Enables this object.
EnableFastTravel(Bool abEnable)
  • Enables or disables fast travel to this map marker.
EnableLinkChain(Keyword apKeyword)
  • Enables all of the references that are linked, in a chain, to this one.
EnableNoWait(Bool abFadeIn)
  • Enables this object and does not wait for the object to be enabled or faded in.
ForceAddRagdollToWorld()
  • Forcibly adds the ragdoll of a reference to the world
ForceRemoveRagdollFromWorld()
  • Forcibly removes the ragdoll of a reference from the world
ActorBase GetActorOwner()
  • Obtains the actor base that owns this object.
Float GetAngleX()
  • Obtains this object's rotation around the x axis.
Float GetAngleY()
  • Obtains this object's rotation around the y axis.
Float GetAngleZ()
  • Obtains this object's rotation around the z axis.
Bool GetAnimationVariableBool(String asVariableName)
  • Fetches the value of a variable on the reference's animation graph (bool version).
Float GetAnimationVariableFloat(String asVariableName)
  • Fetches the value of a variable on the reference's animation graph (float version).
Int GetAnimationVariableInt(String asVariableName)
  • Fetches the value of a variable on the reference's animation graph (int version).
Form GetBaseObject()
  • Obtains this reference's base object.
Int GetCurrentDestructionStage()
  • Gets the object's current stage of destruction.
Location GetCurrentLocation()
  • Obtains this reference's current location.
Scene GetCurrentScene()
  • Obtains the scene that this reference is currently participating in, if any.
Float GetDistance(ObjectReference akOther)
  • Calculates the distance between this object and the passed in one.
Location GetEditorLocation()
  • Obtains this reference's editor location.
Faction GetFactionOwner()
  • Gets the faction that owns this reference.
Float GetHeadingAngle(ObjectReference akOther)
  • Gets the angle between this object's heading, and the direction the other object is in.
Float GetHeight()
  • Gets the height of this object
Int GetItemCount(Form akItem)
  • Returns how many of the specified item is in this object's inventory.
Float GetItemHealthPercent()
  • Returns the item health percent of this object (1.0 == 100%).
Key GetKey()
  • Obtains the key that unlocks this object (if any).
Float GetLength()
  • Obtains the length of this object.
ObjectReference GetLinkedRef(Keyword apKeyword)
  • Returns our linked reference for the given Keyword, if any.
Int GetLockLevel()
  • Obtains the level of the lock on this object.
Float GetMass()
  • Obtains this object's mass in Havok.
ObjectReference GetNthLinkedRef(Int aiLinkedRef)
  • Obtains the nth linked ref from this object.
Int GetOpenState()
  • Obtains this object's current "open state".
Cell GetParentCell()
  • Obtains the cell this object is currently in.
Float GetPositionX()
  • Returns this object's current X position.
Float GetPositionY()
  • Returns this object's current Y position.
Float GetPositionZ()
  • Returns this object's current Z position.
Float GetScale()
  • Get this object's current scale.
Int GetTriggerObjectCount()
  • Returns the number of objects inside this trigger volume.
VoiceType GetVoiceType()
  • Obtains the VoiceType for this actor or talking activator.
Float GetWidth()
  • Get the current width of the object.
Worldspace GetWorldSpace()
  • Returns the worldspace this reference is in.
Bool HasEffectKeyword(Keyword akKeyword)
  • Returns if this reference has an active effect coming from a magic effect with the specified keyword attached
Bool HasNode(String asNodeName)
  • Returns if this reference has the specified name node in its 3D.
Bool HasRefType(LocationRefType akRefType)
IgnoreFriendlyHits(Bool abIgnore)
  • Flags this reference as ignoring (or not ignoring) friendly hits
InterruptCast()
  • Interrupts any spellcasting this object may be doing.
Bool IsActivateChild(ObjectReference akChild)
  • Returns whether the passed in reference is an activate child of this reference.
Bool IsActivationBlocked()
  • Returns whether normal activation processing is currently blocked on this reference or not.
Bool Is3DLoaded()
  • Checks to see if this reference's 3D data is currently loaded or not.
Bool IsDeleted()
  • Checks to see if this object is currently flagged for delete.
Bool IsDisabled()
  • Is this object currently disabled?
Bool IsEnabled()
  • Is this object currently enabled?
Bool IsFurnitureInUse(Bool abIgnoreReserved)
  • Is any furniture marker on this object in use?
Bool IsFurnitureMarkerInUse(Int aiMarker, Bool abIgnoreReserved)
  • Is the specified furniture marker on this object in use?
Bool IsIgnoringFriendlyHits()
  • Is this object ignoring friendly hits?
Bool IsInDialogueWithPlayer()
  • Is this actor or talking activator currently talking to the player?
Bool IsInInterior()
  • Returns true if the object is in an interior cell.
Bool IsInLocation(Location akLocation)
  • Returns true if the object is currently in that location or a child of that location.
Bool IsLocked()
  • Is the lock on this object locked?
Bool IsMapMarkerVisible()
  • Is this map marker visible to the player?
Bool IsNearPlayer()
  • A quick-and-dirty function to tell if this object is safe to enable or disable
KnockAreaEffect(Float afMagnitude, Float afRadius)
  • Executes a knock effect to an area
Lock(Bool abLock, Bool abAsOwner)
  • Locks or unlocks this object.
MoveTo(ObjectReference akTarget, Float afXOffset, Float afYOffset, Float afZOffset, Bool abMatchRotation)
  • Moves this object to the same location as the passed-in reference, offset by the specified amount.
Bool MoveToIfUnloaded(ObjectReference akTarget, Float afXOffset, Float afYOffset, Float afZOffset)
  • Moves this object to the same location as the passed-in reference, offset by the specified amount, IF this object is not currently loaded.
MoveToInteractionLocation(ObjectReference akTarget)
  • Moves this object to the specified object's interaction location.
MoveToMyEditorLocation()
  • Moves this object to its own editor location.
MoveToNode(ObjectReference akTarget, String asNodeName)
  • Moves this object to the position (and rotation) of the specified node on the specified object's 3D
Actor PlaceActorAtMe(ActorBase akActorToPlace, Int aiLevelMod, EncounterZone akZone)
  • Create an actor at this object's location.
ObjectReference PlaceAtMe(Form akFormToPlace, Int aiCount)
  • Places x copies of the passed in form at this object's current position, returning the last one created.
Bool PlayAnimation(String asAnimation)
  • Plays the specified animation on this object, returning immediately.
Bool PlayAnimationAndWait(String asAnimation, String asEventName)
  • Plays the specified animation on this object and waits for the specified event before returning. (latent)
Bool PlayGamebryoAnimation(String asAnimation, Bool abStartOver, Float afEaseInTime)
  • Plays a legacy nif file based animation
Bool PlayImpactEffect(ImpactDataSet akImpactEffect, String asNodeName, Float afPickDirX, Float afPickDirY, Float afPickDirZ, Float afPickLength, Bool abApplyNodeRotation, Bool abUseNodeLocalRotation)
  • Plays an impact effect.
Bool PlaySyncedAnimationAndWaitSS(String asAnimation1, String asEvent1, ObjectReference akObj2, String asAnimation2, String asEvent2)
  • Plays two animations simultaneously, waiting for events from both.
Bool PlaySyncedAnimationSS(String asAnimation1, ObjectReference akObj2, String asAnimation2)
  • Plays two animations simultaneously.
PlayTerrainEffect(String asEffectModelName, String asAttachBoneName)
  • Plays a terrain effect.
ProcessTrapHit(ObjectReference akTrap, Float afDamage, Float afPushback, Float afXVel, Float afYVel, Float afZVel, Float afXPos, Float afYPos, Float afZPos, Int aeMaterial, Float afStagger)
  • Tells this object to handle the specified trap object hitting it.
PushActorAway(Actor akActorToPush, Int aiKnockbackDamage)
  • Pushes the other actor away from this object as if hit by the specified amount of knockback damage.
Bool RampRumble(Float power, Float duration, Float falloff)
  • Shakes cam/controller based on distance from player
RemoveAllInventoryEventFilters()
  • Remove all inventory event filters on this reference.
RemoveAllItems(ObjectReference akTransferTo, Bool abKeepOwnership, Bool abSilent)
  • Removes all items from this container, optionall transferring them to another one.
RemoveInventoryEventFilter(Form akFilter)
  • Remove a specific inventory event filter.
RemoveItem(Form akItemToRemove, Int aiCount, Bool abSilent, ObjectReference akOtherContainer)
  • Removes the passed in item from this object's inventory.
Reset(ObjectReference akTarget)
  • Resets this object reference, optionally placing the object at the new target.
Say(Topic akTopicToSay, Actor akActorToSpeakAs, Bool abSpeakInPlayersHead)
  • Causes this reference to speak a topic as if it were the specified actor.
SendStealAlarm(Actor akThief)
  • Sends a steal alarm as if this reference had just been stolen by the actor.
SetActorCause(Actor akActor)
  • Sets this actor as this object's actor cause.
SetActorOwner(ActorBase akActorBase)
  • Sets this actor base as this object's owner.
SetAngle(Float afXAngle, Float afYAngle, Float afZAngle)
  • Sets this object's rotation. Angles are in degrees.
SetAnimationVariableBool(String asVariableName, Bool abNewValue)
  • Sets the value of a variable on the reference's animation graph (bool version).
SetAnimationVariableFloat(String asVariableName, Float afNewValue)
  • Sets the value of a variable on the reference's animation graph (float version).
SetAnimationVariableInt(String asVariableName, Int aiNewValue)
  • Sets the value of a variable on the reference's animation graph (int version).
SetDestroyed(Bool abDestroyed)
  • Sets or clears this object's destroyed flag.
SetFactionOwner(Faction akFaction)
  • Sets this faction as this object's owner.
SetLockLevel(Int aiLockLevel)
  • Sets the lock level on this object.
SetMotionType(Int aiMotionType, Bool abAllowActivate)
  • Sets the havok motion type on this object.
SetNoFavorAllowed(Bool abNoFavor)
  • Sets or clears this object's ability to be not used by a teammate for a favor
SetOpen(Bool abOpen)
  • Opens or closes this object.
SetPosition(Float afX, Float afY, Float afZ)
  • Sets this object's position.
SetScale(Float afScale)
  • Set the current scale of the object
SplineTranslateTo(Float afX, Float afY, Float afZ, Float afAngleX, Float afAngleY, Float afAngleZ, Float afSplineCurve, Float afSpeed)
  • Makes the object translate to the given pos/orient on a spline.
SplineTranslateToRef(ObjectReference arTarget, Float afTangentMagnitude, Float afSpeed, Float afMaxRotationSpeed)
  • Makes the reference translate to the target ref position/orient on a spline at the given speed
SplineTranslateToRefNode(ObjectReference arTarget, String arNodeName, Float afTangentMagnitude, Float afSpeed, Float afMaxRotationSpeed)
  • Makes the reference translate to the target node's position/orient on a spline at the given speed
StopTranslation()
  • Stops any translation on the object.
TetherToHorse(ObjectReference akHorse)
  • Tether a prisoner cart to the given horse.
TranslateTo(Float afX, Float afY, Float afZ, Float afAngleX, Float afAngleY, Float afAngleZ, Float afSpeed, Float afMaxRotationSpeed)
  • Makes the object translate to the given pos/orient.
TranslateToRef(ObjectReference arTarget, Float afSpeed, Float afMaxRotationSpeed)
  • Makes the reference translate to the target ref position/orient at the given speed
Bool WaitForAnimationEvent(String asEventName)
  • Waits for the animation graph to send the specified event.


SKSE Member Functions[edit | edit source]

Form[] GetContainerForms()
  • (Container only) Returns an array of the forms in a container. (Actor ObjectReferences are containers)
Int GetNumItems()
  • (Container only) Returns the number of forms in the container. (Actor ObjectReferences are containers)
Form GetNthForm(Int index)
  • (Container only) Returns the specified form from the container. (Actor ObjectReferences are containers)
Float GetTotalItemWeight()
  • (Container only - perhaps Player only) Returns the total weight of all items held in the container.
Float GetTotalArmorWeight()
  • (Container only - perhaps Player only) Returns the total weight of the armor in the container.
Bool IsHarvested()
  • (Flora and Tree only) Returns whether the flora has been harvested or not.
SetHarvested(Bool harvested)
  • Sets whether the Reference has been harvested.
SetItemHealthPercent(Float health)
  • Set the item's tempering. 1.0 is no tempering, 1.6 appears to be legendary. Values below 1.0 do nothing.
SetItemMaxCharge(Float maxCharge)
  • Sets the maximum charge of the item.(Only works on player enchants)
Float GetItemMaxCharge()
  • Gets the maximum charge of the item.
Float GetItemCharge()
  • Gets the current charge of the item.
SetItemCharge(Float charge)
  • Sets the item's charge to the specified amount.
ResetInventory()
  • Resets the References inventory.
Bool IsOffLimits()
String GetDisplayName()
  • Returns the name of the reference (This is the name that is displayed)
Bool SetDisplayName(String name, Bool force)
  • Sets the reference's display name.
ObjectReference GetEnableParent()
  • Returns the enable parent of the object.
Enchantment GetEnchantment()
  • Returns the player-made enchantment of the object (if there is one)
SetEnchantment(Enchantment source, Float maxCharge)
  • Changes an item's player-made enchantment to another.
CreateEnchantment(Float maxCharge, MagicEffect[] effects, Float[] magnitudes, Int[] areas, Int[] durations)
  • Creates a new Enchantment on the item with the specified parameters.
Int GetNumReferenceAliases()
  • Returns the number of reference aliases holding this reference.
ReferenceAlias GetNthReferenceAlias(Int n)
  • Returns the nth Reference alias holding this reference.

Events[edit | edit source]

OnActivate(ObjectReference akActionRef)
  • Event received when this object is activated.
OnAttachedToCell()
  • Event received when this reference moves from a detached cell to an attached one.
OnCellAttach()
  • Event received when this reference's parent cell attaches.
OnCellDetach()
  • Event received when this reference's parent cell detaches.
OnCellLoad()
  • Event received when everything in the cell that holds this reference has loaded.
OnClose(ObjectReference akActionRef)
  • Event received when this object is finished closing.
OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
  • Event received when an object moves into/out of/between containers.
OnDestructionStageChanged(Int aiOldStage, Int aiCurrentStage)
  • Event received when this object's destruction stage has worsened.
OnDetachedFromCell()
  • Event received when this object moves from an attached cell to a detached cell.
OnEquipped(Actor akActor)
  • Event received when this object is equipped by an actor.
OnGrab()
  • Event received when this object is grabbed (z-keyed) by the player.
OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, Bool abPowerAttack, Bool abSneakAttack, Bool abBashAttack, Bool abHitBlocked)
  • Event received when this object is hit with a weapon or projectile.
OnItemAdded(Form akBaseItem, Int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
  • Event received when an item is inserted into this object's container.
OnItemRemoved(Form akBaseItem, Int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer)
  • Event received when an item is removed from this object's container.
OnLoad()
  • Event received when this object's 3d is loaded and ready.
OnLockStateChanged()
  • Event received when the lock on this object changes its state.
OnMagicEffectApply(ObjectReference akCaster, MagicEffect akEffect)
  • Event received when a magic effect is attempting to be applied to this reference.
OnOpen(ObjectReference akActionRef)
  • Event received when this object is fully opened.
OnRead()
  • Event received when this object is read. (Only applies to books)
OnRelease()
  • Event received when this object is released by the player (stopped z-keying).
OnReset()
  • Event received when this object is reset.
OnSell(Actor akSeller)
  • Event received when this object is sold by someone.
OnSpellCast(Form akSpell)
  • Event received when this object casts a spell.
OnTrapHit(ObjectReference akTarget, Float afXVel, Float afYVel, Float afZVel, Float afXPos, Float afYPos, Float afZPos, Int aeMaterial, Bool abInitialHit, Int aeMotionType)
  • Event received when this trap object hits a target.
OnTrapHitStart(ObjectReference akTarget, Float afXVel, Float afYVel, Float afZVel, Float afXPos, Float afYPos, Float afZPos, Int aeMaterial, Bool abInitialHit, Int aeMotionType)
  • Event received when this trap object starts colliding with a target.
OnTrapHitStop(ObjectReference akTarget)
  • Event received when this trap object stops colliding with a target.
OnTranslationAlmostComplete()
  • Event received when a translation request is almost complete.
OnTranslationComplete()
  • Event received when a translation request is complete.
OnTranslationFailed()
  • Event received when a translation request has failed.
OnTrigger(ObjectReference akActionRef)
  • Event received when this object is triggered.
OnTriggerEnter(ObjectReference akActionRef)
  • Event received when this object's volume is entered.
OnTriggerLeave(ObjectReference akActionRef)
  • Event received when this object's volume is left.
OnUnequipped(Actor akActor)
  • Event received when this object is unequipped by an actor.
OnUnload()
  • Event received when this object's 3d has been unloaded.
OnWardHit(ObjectReference akCaster, Spell akSpell, Int aiStatus)
  • Event called when the object reference is using a ward that is hit by a spell.