Jump to content

Calling animation in scripts


philip141091

Recommended Posts

I cant for the life of me figure this one out, but here goes:

 

I have an animation, i want to run this animation on an npc using a script. (The animation works fine if i replace one of the default animation btw)

 

How do i go about creating a animation event that i can call with PlayAnimation()?

Link to comment
Share on other sites

Just found this thread after some time. I wonder if it's still open.

 

Anyway:

 

I checked out the Sawmill scripts in the CK, to check how they run animations, since I was checking them for info on another thing - and found out some interesting details.

 

The script in question is ResourceObjectSawmillScript.psc, and uses stuff like this:

 

Event OnLoad()
RegisterForAnimationEvent(self, "DestructionComplete")			; sabotage complete -- *** ALL children scripts of ResourceObjectScript MUST register for this animation

RegisterForAnimationEvent(self, "MillLogChuteIdle")			; log is loaded, ready to cut
RegisterForAnimationEvent(self, "MillLogIdleReset")			; log cutting animation complete
RegisterForAnimationEvent(self, "MillLogPileLoadStart")			; log loading animation started
endEvent

Link to comment
Share on other sites

Those just register the animations into the event system, if your looking to add new animations you would need to modify the master behavior files because that's where it seems all of the animations are referenced. The hkxcmd version I have does not reverse the behavior files, which is rather unfortunate because that file seems to be the only link to both the CK and animations. Edited by expired6978
Link to comment
Share on other sites

Those colored with orange you must include in your script to start an animation:

 

 

 

Idle Property MyAnimation AUTO

 

 

Event OnEffectStart(Actor akTarget, Actor akCaster)

if Game.GetPlayer().IsInCombat() == 0

Game.Getplayer().playidle(MyAnimation)

endif

 

EndEvent

 

 

 

The rest is just an example applied to an magiceffect. Don't forget to set the the property to your animation within the activator or whatever you use to start the script.

 

You can also use PlayAnimation instead of PlayIdle in case your animation is not a idle one. Replace the property too with the respective one, dunno if there's Animation.

Edited by omega2008
Link to comment
Share on other sites

  • 6 years later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...