Jump to content

How to do animation transitions by script? (Papyrus)


Recommended Posts

Posted

I want to make NPCs go into an idle animation, but the transition is extremely harsh (from standing to lying in a second, for example).

Also, when I e.g. do a power attack on a lying opponent, the stagger animation triggers - is there a way of preventing that?

If possible, I only want to use scripts and not alter game files (in order to stay most compatible with other mods).

 

Best Regards

HJ

Posted

Some animations I've used (such as the drunk idle) have multiple animations: IdleDrunkStart and IdleDrunkStop. These seem to blend properly.

Posted
4 hours ago, traison said:

Some animations I've used (such as the drunk idle) have multiple animations: IdleDrunkStart and IdleDrunkStop. These seem to blend properly.

I'm using, for example, IdleWounded_02, which does not seem to blend properly - is there any way to do the blending by script? (e.g. animations made for transitioning from standing to lying)

Also how do I stop the stagger and other animations from playing?

Posted

Seems like the guy didn't do it via script.

This is the script:

Scriptname SOS_StaggerDetectionScript extends ActiveMagicEffect

Spell Property StaggerCooldown auto

Event OnAnimationEventUnregistered(ObjectReference akSource, string asEventName)
	if akSource && akSource.Is3DLoaded()
		AnimRegistrations(akSource)
	endif
EndEvent

Event OnEffectStart(Actor akTarget, Actor akCaster)
	AnimRegistrations(akTarget)
EndEvent

Event OnRaceSwitchComplete()
	Utility.Wait(3.0)
	AnimRegistrations(GetTargetActor())
EndEvent

Function AnimRegistrations(ObjectReference akTarget)
	if akTarget
		RegisterForAnimationEvent(akTarget, "staggerStop")
	endif
EndFunction

Event OnAnimationEvent(ObjectReference akSource, string asEventName)
	StaggerCooldown.Cast(akSource)
EndEvent

 

Seems the StaggerCooldown is the thing keeping the NPCs from staggering, is this correct?

 

 

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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