Difference between revisions of "ObjectReference Script"

7,256 bytes added ,  04:32, 24 October 2013
m
Formatting Change
imported>CraftySentinel
m (Formatting Change)
imported>CraftySentinel
m (Formatting Change)
Line 29: Line 29:
== Global Functions ==
== Global Functions ==
None
None
|}
|}


Line 544: Line 543:
|[[WaitForAnimationEvent - ObjectReference|Bool '''WaitForAnimationEvent'''(String ''asEventName'')]]
|[[WaitForAnimationEvent - ObjectReference|Bool '''WaitForAnimationEvent'''(String ''asEventName'')]]
|Waits for the animation graph to send the specified event.
|Waits for the animation graph to send the specified event.
|-
|}
== SKSE Member Functions ==
{|class="wikitable" width =100%
!style="text-align:left;"|Function
!style="text-align:left;"|Description
|-
|[[GetNumItems - ObjectReference|Int '''GetNumItems'''()]]
| (Container only) Returns the number of forms in the container.
|-
|[[GetNthForm - ObjectReference|Form '''GetNthForm'''(Int ''index'')]]
| (Container only) Returns the specified form from the container.
|-
|[[GetTotalItemWeight - ObjectReference|Float '''GetTotalItemWeight'''()]]
| (Container only - perhaps Player only) Returns the total weight of all items held in the container.
|-
|[[GetTotalArmorWeight - ObjectReference|Float '''GetTotalArmorWeight'''()]]
| (Container only - perhaps Player only) Returns the total weight of the armor in the container.
|-
|[[IsHarvested - ObjectReference|Bool '''IsHarvested'''()]]
| (Flora and Tree only) Returns whether the flora has been harvested or not.
|-
|[[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.
|-
|[[GetItemMaxCharge - ObjectReference|Float '''GetItemMaxCharge'''()]]
| Gets the maximum charge of the item.
|-
|[[GetItemCharge - ObjectReference|Float '''GetItemCharge'''()]]
| Gets the current charge of the item.
|-
|[[SetItemCharge - ObjectReference|'''SetItemCharge'''(Float ''charge'')]]
|Sets the item's charge to the specified amount.
|-
|}
== Events ==
{|class="wikitable" width =100%
!style="text-align:left;"|Function
!style="text-align:left;"|Description
|-
|[[OnActivate - ObjectReference|'''OnActivate'''(ObjectReference ''akActionRef'')]]
|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.
|-
|[[OnCellDetach - ObjectReference|'''OnCellDetach'''()]]
|Event received when this reference's parent cell detaches.
|-
|[[OnCellLoad - ObjectReference|'''OnCellLoad'''()]]
|Event received when everything in the cell that holds this reference has loaded.
|-
|[[OnClose - ObjectReference|'''OnClose'''(ObjectReference ''akActionRef'')]]
|Event received when this object is finished closing.
|-
|[[OnContainerChanged - ObjectReference|'''OnContainerChanged'''(ObjectReference ''akNewContainer'', ObjectReference ''akOldContainer'')]]
|Event received when an object moves into/out of/between containers.
|-
|[[OnDestructionStageChanged - ObjectReference|'''OnDestructionStageChanged'''(Int ''aiOldStage'', Int ''aiCurrentStage'')]]
|Event received when this object's destruction stage has worsened.
|-
|[[OnDetachedFromCell - ObjectReference|'''OnDetachedFromCell'''()]]
|Event received when this object moves from an attached cell to a detached cell.
|-
|[[OnEquipped - ObjectReference|'''OnEquipped'''(Actor ''akActor'')]]
|Event received when this object is equipped by an actor.
|-
|[[OnGrab - ObjectReference|'''OnGrab'''()]]
|Event received when this object is grabbed (z-keyed) by the player.
|-
|[[OnHit - ObjectReference|'''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 - ObjectReference|'''OnItemAdded'''(Form ''akBaseItem'', Int ''aiItemCount'', ObjectReference ''akItemReference'', ObjectReference ''akSourceContainer'')]]
|Event received when an item is inserted into this object's container.
|-
|[[OnItemRemoved - ObjectReference|'''OnItemRemoved'''(Form ''akBaseItem'', Int ''aiItemCount'', ObjectReference ''akItemReference'', ObjectReference ''akDestContainer'')]]
|Event received when an item is removed from this object's container.
|-
|[[OnLoad - ObjectReference|'''OnLoad'''()]]
|Event received when this object's 3d is loaded and ready.
|-
|[[OnLockStateChanged - ObjectReference|'''OnLockStateChanged'''()]]
|Event received when the lock on this object changes its state.
|-
|[[OnMagicEffectApply - ObjectReference|'''OnMagicEffectApply'''(ObjectReference ''akCaster'', MagicEffect ''akEffect'')]]
|Event received when a magic effect is attempting to be applied to this reference.
|-
|[[OnOpen - ObjectReference|'''OnOpen'''(ObjectReference ''akActionRef'')]]
|Event received when this object is fully opened.
|-
|[[OnRead - ObjectReference|'''OnRead'''()]]
|Event received when this object is read. (Only applies to books)
|-
|[[OnRelease - ObjectReference|'''OnRelease'''()]]
|Event received when this object is released by the player (stopped z-keying).
|-
|[[OnReset - ObjectReference|'''OnReset'''()]]
|Event received when this object is reset.
|-
|[[OnSell - ObjectReference|'''OnSell'''(Actor ''akSeller'')]]
|Event received when this object is sold by someone.
|-
|[[OnSpellCast - ObjectReference|'''OnSpellCast'''(Form ''akSpell'')]]
|Event received when this object casts a spell.
|-
|[[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 trap object hits a target.
|-
|[[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 starts colliding with a target.
|-
|[[OnTrapHitStop - ObjectReference|'''OnTrapHitStop'''(ObjectReference ''akTarget'')]]
|Event received when this trap object stops colliding with a target.
|-
|[[OnTranslationAlmostComplete - ObjectReference|'''OnTranslationAlmostComplete'''()]]
|Event received when a translation request is almost complete.
|-
|[[OnTranslationComplete - ObjectReference|'''OnTranslationComplete'''()]]
|Event received when a translation request is complete.
|-
|[[OnTranslationFailed - ObjectReference|'''OnTranslationFailed'''()]]
|Event received when a translation request has failed.
|-
|[[OnTrigger - ObjectReference|'''OnTrigger'''(ObjectReference ''akActionRef'')]]
|Event received when this object is triggered.
|-
|[[OnTriggerEnter - ObjectReference|'''OnTriggerEnter'''(ObjectReference ''akActionRef'')]]
|Event received when this object's volume is entered.
|-
|[[OnTriggerLeave - ObjectReference|'''OnTriggerLeave'''(ObjectReference ''akActionRef'')]]
|Event received when this object's volume is left.
|-
|[[OnUnequipped - ObjectReference|'''OnUnequipped'''(Actor ''akActor'')]]
|Event received when this object is unequipped by an actor.
|-
|[[OnUnload - ObjectReference|'''OnUnload'''()]]
|Event received when this object's 3d has been unloaded.
|-
|[[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.
|-
|-


|}
|}