You are here

Apply non-standard idle animation?

7 posts / 0 new
Last post
rjshae
Apply non-standard idle animation?

Is there a way to force a character to perform a specific animation as though it were their idle animation? I.e. without a heartbeat script. I don't want to override the standard humanoid idle animation(s) for obvious reasons, but I'd like to be able to apply this to any humanoid character. Thanks.

  • up
    50%
  • down
    50%
rjshae

Hmm, perhaps then a looping PlayCustomAnimation, accompanied by a really long ActionWait with SetCommandable set to false? Plus removing all its scripts, of course.

  • up
    50%
  • down
    50%
4760

Do you need the other animations? If not, you could change the p_hh?_skel to p_rj?_skel, and name the new idle animation p_rj?_idle and p_rj?_una_idle.

Another possibilty could be to use scripted waypoints, and when the character reaches the waypoint he/she'll play the specific animation. But that would mean a short walk between the two idle animations.

  • up
    50%
  • down
    50%
rjshae

No, I want to be able to apply it to normal humanoid characters (with a reskin) but avoid the overhead of a heartbeat script.

  • up
    50%
  • down
    50%
Trinital

If you copy the the Human Entry in the 2DA to something like Human_Two or Human_NewIdle.. then override their idle animation (unarmed_idle) then they will behave identical to whatever race you copied (Human in this case) and play that new idle.

All you need to script is changing their appearance to the new version of Human.

This is how Swimming / Mount Riding / Flying and a few other things function. This really only is optimal if their Walk / Idle demand a new state though.

The other option is to convert them to a animated placeable / VFX and have that animation loop.. If you want.

Or set the animation to play looping OnPerception / OnClientEnter / OnSpawn then setup their OnDialogue Event to never cancel it.

  • up
    50%
  • down
    50%
4760

In that case, I suggest to create a script:

void PlayCustomAnim(object oObj, string sAnim, int iLoop, float fSpeed = 1.0f)

// needed because AssignCommand only accepts "void" actions

{

     PlayCustomAnimation(oObj, sAnim, iLoop, fSpeed);

}

void main()

{

    object oNPC=GetObjectByTag("bob");

    AssignCommand(oNPC, PlayCustomAnim(oNPC, "new idle", TRUE));

}

which you can launch via the area OnEnter or at the end of a conversation.

You may have to give the full name of the animation, instead of "new_idle", if the naming convention is not followed.

  • up
    50%
  • down
    50%
rjshae

Thanks for the suggestions. I'll probably try both options to see which work best. I am a little concerned that the game may hiccup at some point and knock the figure out of its animation, but I suppose I can lay down a trigger region to reset it when the PC approaches.

  • up
    50%
  • down
    50%