Create action on move?

Hi all,
As you may have seen I’m implementing Palmweaver’s mocap animations in TOUD and I had something I wanted to do … namely, I want the animation to play, until such time as the player moves. I have see this done elsewhere so I know its possible but I’m not finding an event to attach it to? How would I accomplish this?

  • May

I use this snippet in the OnHeartbeat to make PC get prone when not in movement and in stalth mode… perhaps it’s of some use for you:

 if (GetActionMode (oPC, 1) && GetCurrentAction (oPC) ==  65535 && !HorseGetIsMounted(oPC)) {
            AssignCommand(oPC, PlayAnimation (30 ,0.5, 600.0));
            int iHide = 4;
            effect eHide = EffectSkillIncrease(SKILL_HIDE, iHide);
            eHide = ExtraordinaryEffect(eHide);
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eHide, oPC, 6.1f);
}

The script also applies a temporary bonus to hide for a round (what makes me remember that I have to adjust that bonus to look after Class/Ambient/Daylight/Whatever), but you can remove it.

Where can I get those animations? Cause I’m not too confortable with the “prone” one I’m using (GetLow)

B.

These ones here:
https://neverwintervault.org/project/nwn1/module/mocap-animations

My specific application is wanting them to break the animation when theyre kneeling if they try to move.

Well, that’s my code would do. Break the animation as soon as player moves.

If you want the PC to get stuck until the animation finishes… Perhaps apply a paralizelike effect right after the animation begins?

Yeah my reservation with that is usually those will stop a player from moving… there has to be a way to figure it out though, hmm.

I do that sort of things like Baireswolf, but use pseudo-heartbeats in place of heartbeats because i find the non adjustable 6 sec tick annoying (too slow) in a lot of cases.

If you need one, i used this pseudoHB system with good success in my mods:
https://neverwintervault.org/project/nwn1/script/heartlib

CG

Can’t you just replace some existing animation and then use ActionPlayAnimation? If the PC moves it’ll auto cancel it.

Eg:

ReplaceObjectAnimation(oPC, “worship”, “thecustomanim”);
AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_WORSHIP, …));

I’m doing something like this already but it just continues to play the animation after:

else if (sAnimation=="nicewave") {
         // one shot anim of length 4.6
         ReplaceObjectAnimation(oPC, "pause1", "nicewave");
         DelayCommand(4.6, ReplaceObjectAnimation(oPC, "pause1", ""));
         AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_PAUSE));
}

It may be because I replace the idle animation, I’ll try another looping animation.

Reporting back: yeah, the animation just starts looping again once you stop moving.

This seems very useful. I can make a script that checks every second or couple of seconds if they’re moving and if so reset the animation - that should do it.

I’ve been trying to use that one but my heartbeat script doesn’t seem to be running, not sure why.
If I want to attach a script to players, is ClientEnter a good hook, or how would I see to it?