SendAnimationEvent and the Player

Post » Sat Oct 31, 2015 5:34 pm

Hello :)

I'm using http://www.creationkit.com/SendAnimationEvent_-_Debug to play idle animation to the Player. Some of these idles are looped like "IdlePray". If I use this idle to the Player then it will stuck on this animation unless you jump. I solved this by adding another animation like "IdleTake" after few seconds, however it's ugly to see because of different animations.

The question is: how can I stop a looped animation?

Many thanks.

User avatar
Damian Parsons
 
Posts: 3375
Joined: Wed Nov 07, 2007 6:48 am

Post » Sat Oct 31, 2015 11:45 am

Maybe use IdleKneelEnter and IdleKneelExit? Would make for a smoother transition. I don't believe there's any other way to interupt a looped idle but to make them do something else.

User avatar
Angel Torres
 
Posts: 3553
Joined: Thu Oct 25, 2007 7:08 am

Post » Sat Oct 31, 2015 8:32 pm

Doesn't works. The Player don't does any animation... Are these event names correct?

User avatar
Lance Vannortwick
 
Posts: 3479
Joined: Thu Sep 27, 2007 5:30 pm

Post » Sat Oct 31, 2015 1:00 pm

To get the proper names of the animevents, from the gameplay menu, go to animations. Find 0_Master.hkx.
Any event u want to use is listed under the drop down menus. The event will have a corresponding "Anim Event" to the right. Using that value always works.

Do note that initiating an anim event will make the behaviour tied to it actually happen (for example, Bleedout start will actually cause the NPC to go into Bleedout mode)

User avatar
Horse gal smithe
 
Posts: 3302
Joined: Wed Jul 05, 2006 9:23 pm

Post » Sat Oct 31, 2015 12:04 pm

Duplicate post.

User avatar
Michael Russ
 
Posts: 3380
Joined: Thu Jul 05, 2007 3:33 am

Post » Sat Oct 31, 2015 4:10 pm

Sorry Manny, I was just looking in the character\animations folder and saw it, not the CK. The actual AnimEvent looks to be IdleKneelingEnter and Exit.

Or maybe try IdleGreybeardMeditateEnter and IdleGreybeardMeditateExit if this is for your power stones mod.

User avatar
Chris BEvan
 
Posts: 3359
Joined: Mon Jul 02, 2007 4:40 pm

Post » Sat Oct 31, 2015 4:33 pm

Manny, thank you for actually posting a question I know something about! :smile: I've been researching this for a mod I'm making. You made me so happy!

Ok, what Di0 said is correct, sometimes the actual Anim Event will have a slightly different name than the "Idle Animation". For instance, if you wanted to play "IdleBookSitting_Reading" via SendAnimationEvent, it wouldn't work, because that anim event is actually called "ChairReadingStart". These names can be found in the CK by going to Gameplay (up in the file menu) > Animations > Actors\Character\Behaviors\0_Master.hkx > LOOSE and look at where it says "Anim Event". Like others have said, if there's a corresponding "End" or "Exit" animation event for the one you want to use, that may be your solution.

But how to get ANY animation to stop playing? I'm working on this currently myself, and the best way I've found to do it, is to send another animation event called "IdleStop_Loose". This seems to stop any current animation and return the player to the normal idle state. I plan to make it work by using RegisterForControl("Move") right after playing the animation, and OnControlDown() send the idle stop, and quickly un-register for control. No idea if it will work or not, as I have yet to test it in game. My fear is that the unregister won't be fast enough and weird stuff will happen, but we'll see!

I'm sure you've figured out that PlayIdle doesn't work sometimes because the Idles all have conditions tied to them, which is probably why you're using SendAnimationEvent. I'm including my conditions I run before using SendAnimationEvent to prevent unexpected behavior, in case they're helpful.

Spoiler

; Get equipped items so we can check for torch
Int lefthand = PlayerRef.GetEquippedItemType(0)
Int righthand = PlayerRef.GetEquippedItemType(1)
; Make sure character isn't seated before playing animation
If (PlayerRef.GetSitState() != 0)
Debug.Notification("Stand up first")
; Make sure character isn't on horse before playing animation
ElseIf PlayerRef.IsOnMount()
Debug.Notification("Dismount first")
; Make sure character doesn't have torch out
ElseIf (lefthand == 11 || righthand == 11)
Debug.Notification("Unequip torch first")
; Make sure weapons are sheathed before playing animation
ElseIf PlayerRef.IsWeaponDrawn()
Debug.Notification("Sheathe weapons first")
; Play the animation
Else

SendAnimationEvent(PlayerRef, "YourAnimEvent")

EndIf

Finally, in case you didn't know, this has been super helpful for me: You can send animation events using the console, by clicking on your character and typing "SAE ChairReadingStart" or whatever the name of the anim event is, minus the quotes. SAE = SendAnimationEvent to the console. Super helpful for testing in game.

User avatar
Honey Suckle
 
Posts: 3425
Joined: Wed Sep 27, 2006 4:22 pm

Post » Sun Nov 01, 2015 1:16 am

Thank you very much, guys! :)

Lastly I used "IdleRitualSkull3" only. It's simply perfect with timing.

IdleGreybeardMeditateEnter doesn't have IdleGreybeardMeditateExit

And yes, it's for my Power Stone mod :D and it have a Framework for modders too ;)

User avatar
-__^
 
Posts: 3420
Joined: Mon Nov 20, 2006 4:48 pm


Return to V - Skyrim