Jump to content

Recommended Posts

Posted

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()?

Posted

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

Posted (edited)
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
Posted (edited)

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

 

 

  Reveal hidden contents

 

 

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
  • 6 years later...
Posted
  On 10/3/2018 at 8:13 PM, romantiker12 said:

That simple script is a perfect helper !!! ;-))))))))))

 

You necro a 6 1/2 years old post to point to a script snippet which doesn't do what was asked?

 

lol

  • Recently Browsing   0 members

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