Difference between revisions of "OnAnimationEvent - Form"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Antares
(→‎Notes: Slight update to info RE: valid animation events.)
imported>Antares
(→‎Notes: Linking to discussion page)
Line 32: Line 32:
*This event is '''not''' relayed to any aliases or magic effects attached to the form.
*This event is '''not''' relayed to any aliases or magic effects attached to the form.
*This event '''is''' relayed to other scripts attached to the same object.  eg. On a quest form with 2 main quest scripts and a fragment script,  an update event registered by one will be received by all three.
*This event '''is''' relayed to other scripts attached to the same object.  eg. On a quest form with 2 main quest scripts and a fragment script,  an update event registered by one will be received by all three.
*The game will allow you to register ANY animation event, valid or invalid. Though they may register successfully not all of them will necessarily generate events. See the discussion page for more information.
*The game will allow you to register ANY animation event, valid or invalid. Though they may register successfully not all of them will necessarily generate events. [[Talk:RegisterForAnimationEvent_-_Form|See the discussion page for more information.]]


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

Revision as of 08:33, 20 November 2012

Member of: ActiveMagicEffect Script, Alias Script, and Form Script

Event called when the active magic effect/alias/form receives one of the animation events it was listening for.

Syntax

Event OnAnimationEvent(ObjectReference akSource, string asEventName)

Parameters

  • akSource: The ObjectReference that sent the event.
  • asEventName: The event that was received.

Examples

Function SomeFunction()
  RegisterForAnimationEvent(JoeBob, "IdleFurnitureExit") ; Before we can use OnAnimationEvent we must register.
EndFunction

Event OnAnimationEvent(ObjectReference akSource, string asEventName)
  if (akSource == self) && (asEventName == "Reset")
    Debug.Trace("We got the reset animation graph event from ourselves that we were looking for!")
  endIf
endEvent

Notes

  • Aliases and quests will automatically unregister for this event when the quest stops. Active magic effects will automatically unregister when they are removed.
  • This event is not relayed to any aliases or magic effects attached to the form.
  • This event is relayed to other scripts attached to the same object. eg. On a quest form with 2 main quest scripts and a fragment script, an update event registered by one will be received by all three.
  • The game will allow you to register ANY animation event, valid or invalid. Though they may register successfully not all of them will necessarily generate events. See the discussion page for more information.

See Also