Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
gc8

Play animation on player

Recommended Posts

Hi

I'm trying to play repair vehicle animation on player but don't know how to do that. I tried probably all the animation commands there are but nothing happens

 

I tried these from console:

 

[] spawn { sleep 2; player playMove "inbasemoves_assemblingvehicleerc"; };



[] spawn { sleep 2; player playMoveNow "inbasemoves_assemblingvehicleerc"; };



[] spawn { sleep 2; player playAction  "inbasemoves_assemblingvehicleerc"; };



[] spawn { sleep 2; player playActionNow   "inbasemoves_assemblingvehicleerc"; };



[] spawn { sleep 2; player switchAction  "inbasemoves_assemblingvehicleerc"; };



[] spawn { sleep 2; player switchMove   "inbasemoves_assemblingvehicleerc"; };


 

How do you make it work? Any tips are welcome as I am lost with these animation things 🙂

 

thx!

Share this post


Link to post
Share on other sites
5 minutes ago, phronk said:

@gc8 switchMove

 

You may also need to add player disableAI "anim" and maybe "teamSwitch" but I think that only works on AI. 

 

switchmove doesn't work. I tried:

 

[] spawn { sleep 2; player disableAI "anim"; player switchMove   "inbasemoves_assemblingvehicleerc"; };

 

Share this post


Link to post
Share on other sites

I believe some animations are specifically configured to not work on players. The workaround is to make the player unit an AI. You can do this sort of seamlessly by unselecting the player's current unit as player, using selectPlayer if I remember right, and forcing the player's camera to the old unit. Then play animation. I'm at work but it'd be written sorta like this:

 

 

private _oldUnit=vehicle player;

 

selectPlayer objNull; //May be better to select an actual disabled simulation unit that already exists

 

_oldUnit disableAI"anim";

_oldUnit switchCamera "INTERNAL";

 

_oldUnit switchMove"inbasemoves_assemblingvehicleerc";

 

_oldUnit addEventHandler["AnimDone",{

if(_this#1=="inbasemoves_assemblingvehicleerc")then{

removeEventHandler["AnimDone",_thisEventHandler];

selectPlayer(_this#0);(_this#0)switchCamera"INTERNAL";}

}];

Share this post


Link to post
Share on other sites

@phronk wow that's complicated. All I want is to play repair animation or whatever build animation there are available for the player

Share this post


Link to post
Share on other sites

Is there a list of animations that can be played on player? (Like first aid animation.)

if not some one should definitely make one 🙂

Share this post


Link to post
Share on other sites

×