Difference between revisions of "OnAnimationEvent - Form"

Jump to navigation Jump to search
773 bytes added ,  04:07, 30 November 2013
imported>GigaPoint
imported>GigaPoint
Line 25: Line 25:
     Debug.Trace("We got the reset animation graph event from ourselves that we were looking for!")
     Debug.Trace("We got the reset animation graph event from ourselves that we were looking for!")
   endIf
   endIf
endEvent
</source>
=== Another example: checking events through script ===
<source lang="papyrus">
Scriptname DetectCastEventScript extends Quest
Event OnInit()
    RegisterForAnimationEvent(Game.GetPlayer(), "BeginCastRight")
    RegisterForAnimationEvent(Game.GetPlayer(), "BeginCastLeft")
    RegisterForAnimationEvent(Game.GetPlayer(), "MRh_SpellFire_Event")
endEvent
Event OnAnimationEvent(ObjectReference akSource, string asEventName)
if (akSource == Game.GetPlayer()) && (asEventName == "BeginCastRight")
  Debug.MessageBox("BeginCastRight Registered!")
endIf
if (akSource == Game.GetPlayer()) && (asEventName ==  "MRh_SpellFire_Event")
      castTime = GetCurrentRealTime() - startTime
  Debug.MessageBox("SpellFire_Event Registered!")
endIf
endEvent
endEvent
</source>
</source>
Anonymous user

Navigation menu