Jump to content
Sign in to follow this  
RS30002

How to actually move deck crew with animations?

Recommended Posts

Here is a part of code i got from a carrier crew composition off of steam...i think this is the bit that makes the person in front of the nose of the aircraft move to his right, out of the way.

 

[crewS,"Acts_JetsShooterIdleMoveaway_loop"] remoteExec ['playmovenow',0];
sleep 4.3;
if (CarrCataReset) exitWith { [] spawn _Prc_CataReset; };
[crewS,"Acts_JetsShooterIdleMoveaway_out"] remoteExec ['playmove',0];

I tried to implement a similar thing into a bit of code i got off this forum in one of my earlier threads, the basic need is the same, the person in front of the nose (pic below) needs to move out of the way and i wanted it to be signalled by the player.

 

but, I don't know how to incorporate the 4.3 seconds lasting loop of an animation that (i think) actually does the moving bit into this code. into the {} brackets where there's a hint

[  
 f35,             
 "Signal Taxying",            
 "\a3\ui_f\data\igui\cfg\holdactions\holdAction_thumbsup_ca.paa",   
 "\a3\ui_f\data\igui\cfg\holdactions\holdAction_thumbsup_ca.paa",   
 "_this distance _target < 20 AND (driver (f35)) isEqualTo player AND isengineOn f35",  
 "_caller distance _target < 20 AND (driver (f35)) isEqualTo player AND isengineOn f35",  
 {},               
 {},               
 {hint "Working", marshal switchmove "Acts_JetsShooterIdleMoveaway_loop", marshal switchmove "Acts_JetsShooterIdleMoveaway_out"},  
 {},               
 [],               
 3,               
 999,               
 true,              
 false              
] call BIS_fnc_holdActionAdd;

 

To make matters even more complicated for my noob skills, the npc in question is under a repeatable trigger that controls his signalling when im in the aircraft...code that i also got off of steam is

 

call{marshal switchMove "Acts_JetsMarshallingStraight_loop";   
[] spawn   
{  
 sleep 1;   
 marshal playMove "Acts_JetsMarshallingStraight_in"; 
 marshal playMove "Acts_JetsMarshallingStraight_loop";  
 sleep 1;   
};}

 

So, i'd presumably have to stop this code and make him take input from the code at the top that actually should move him out of the way to his right down the deck. Somehow. 🤷‍♂️

 

Any thoughts on how i might go about doing that? 

 

Thanks in advance

 

deckmngmt.jpg

 

Share this post


Link to post
Share on other sites
3 hours ago, Rok Stuhne said:

{hint "Working", marshal switchmove "Acts_JetsShooterIdleMoveaway_loop", marshal switchmove "Acts_JetsShooterIdleMoveaway_out"},

This should have ; not ,

{hint "Working"; marshal switchmove "Acts_JetsShooterIdleMoveaway_loop"; marshal switchmove "Acts_JetsShooterIdleMoveaway_out"},

Another issue you're probably having is because switchMove instantly plays the animation, depending on it's current status a unit will jerk upright, weapon magically goes on his back, etc, and animation plays. This would also interrupt a currently playing animation, which is happening here. The first animation would play, but it gets near-instantly overwritten with the next animation. playMove will add an animation to the units queue, to be played once the current animation is complete; it will also smoothly transition the unit, eg holster weapon, transition from prone/crouch to standing, etc

  • Like 1

Share this post


Link to post
Share on other sites
3 hours ago, dreadedentity said:

This should have ; not ,


{hint "Working"; marshal switchmove "Acts_JetsShooterIdleMoveaway_loop"; marshal switchmove "Acts_JetsShooterIdleMoveaway_out"},

Another issue you're probably having is because switchMove instantly plays the animation, depending on it's current status a unit will jerk upright, weapon magically goes on his back, etc, and animation plays. This would also interrupt a currently playing animation, which is happening here. The first animation would play, but it gets near-instantly overwritten with the next animation. playMove will add an animation to the units queue, to be played once the current animation is complete; it will also smoothly transition the unit, eg holster weapon, transition from prone/crouch to standing, etc

 

Hi, thanks for the quick reply.

 

i had it with playmove initially, what i posted was the last attempt out of many combinations of playmove, switchmove, playmovenow. Tried again to see if the ; make any difference and sadly they don't, he still doesn't move.

 

Is it important that he is doing an anim from a repeating trigger and the code i want him to do is pasted in airplane init and starts on mission start? Like, does the repeat triggering overwrite it? 

Share this post


Link to post
Share on other sites

If I had to guess, the failure is probably due to doing too many things right from the start. Start off small with just a regular addAction, see if you can get the animations to play. Then add on the hold key thing; after that see if you can make it repeatable. Then bring in the trigger. There are a lot of places where something could be wrong the way you're doing it, so I'd suggest stripping back some of the layers and making sure they work the way you want, then add more layers

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, Rok Stuhne said:

Tried again to see if the ; make any difference

 

Just to be clear, you must use semi-colons. Commas are incorrect syntax in this case.

  • Like 1

Share this post


Link to post
Share on other sites
2 hours ago, dreadedentity said:

If I had to guess, the failure is probably due to doing too many things right from the start. Start off small with just a regular addAction, see if you can get the animations to play. Then add on the hold key thing; after that see if you can make it repeatable. Then bring in the trigger. There are a lot of places where something could be wrong the way you're doing it, so I'd suggest stripping back some of the layers and making sure they work the way you want, then add more layers

 

When i remove the trigger, that makes him wave all the time and code is like this

{hint "Working"; marshal switchmove "Acts_JetsShooterIdleMoveaway_loop"; marshal playmove "Acts_JetsShooterIdleMoveaway_out"}, 

He moves 3 steps in the right direction, then the animation glitches out, he puts his hands on back and slides back to original position.

 

I need "Acts_JetsShooterIdleMoveaway_loop" to last longer ...i think the 4.3 seconds of sleep in the original code were for that purpose....if i put sleep in between both animations, the first one lasts longer, but he still doesn't make it the right distance out of the way and still glitches out in the end, returning to original position with  hand behind his back...

 

...idk...without the trigger governing prior animations it technically shouldn't be any more complicated than the send off scripts i have working on the catapult which i got from here

 

https://steamcommunity.com/sharedfiles/filedetails/?id=2512049036

 

{hint "Working"; marshal switchmove "Acts_JetsShooterIdleMoveaway_loop"; sleep 4.3; marshal switchmove "Acts_JetsShooterIdleMoveaway_out"}

This version has the animations working as smoothly as the steam example, but the problem is he physically doesn't move out of the way like the one from the steam template does. He just prances on the spot.

 

idk

Share this post


Link to post
Share on other sites

Here are some experiments I was playing around with. The animation stuff in arma is pretty complicated:

player addAction ["animate guy", {
	marshal switchMove "Acts_JetsShooterIdle";
	sleep 2;
	systemChat "sleep done";
	marshal playMove "Acts_JetsShooterNavigate_in";
	marshal playMove "Acts_JetsShooterNavigate_stop";
	marshal playMove "Acts_JetsShooterNavigate_stop";
	marshal playMove "Acts_JetsShooterNavigate_stop";
	sleep 9;
	marshal playMove "Acts_JetsShooterNavigate_out";
	sleep 2;
	marshal switchMove "Acts_JetsShooterNavigate_out";
	sleep 2;
	systemChat "sleep";
	marshal switchMove "Acts_JetsShooterIdleMoveaway_loop";
	marshal playMove "Acts_JetsShooterIdleMoveaway_loop";
	marshal playMove "Acts_JetsShooterIdleMoveaway_out";
}, nil, 10, false, true];

 

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, dreadedentity said:

Here are some experiments I was playing around with. The animation stuff in arma is pretty complicated:


player addAction ["animate guy", {
	marshal switchMove "Acts_JetsShooterIdle";
	sleep 2;
	systemChat "sleep done";
	marshal playMove "Acts_JetsShooterNavigate_in";
	marshal playMove "Acts_JetsShooterNavigate_stop";
	marshal playMove "Acts_JetsShooterNavigate_stop";
	marshal playMove "Acts_JetsShooterNavigate_stop";
	sleep 9;
	marshal playMove "Acts_JetsShooterNavigate_out";
	sleep 2;
	marshal switchMove "Acts_JetsShooterNavigate_out";
	sleep 2;
	systemChat "sleep";
	marshal switchMove "Acts_JetsShooterIdleMoveaway_loop";
	marshal playMove "Acts_JetsShooterIdleMoveaway_loop";
	marshal playMove "Acts_JetsShooterIdleMoveaway_out";
}, nil, 10, false, true];

 

 

Hmmm...well interesting thing, at first i got the same result with your code as i did with what i was working with before, few steps out of the way, hands on back, slide to initial position...

 

I figured then something is wrong on my end and the only thing i could think of was the ship...so i turned both the plane and the handler 90 degrees (nose towards the bow) and it worked on the first attempt. Will try with the old hand action code now, i have hopes it will work.

Dont really understand why it doesnt work at a perpendicular angle or idk maybe the ship's surface for that specific walk i had in mind isn't good enough idk.

 

Kinda messes up the shortest path to the catapult tho, but i can at least work with this now. Will try more 90 degree positions for the plane to see if the error only appears where i had it initially.

 

Many thanks for your time and help  🍻

 

#edit: OK, problem solved, the plane is now in the place of the green crane/container thingy on the pic in the previous post and the handler moves down towards the stern np. 

 

So yaaaay!!!! 🙂

Share this post


Link to post
Share on other sites

Combined code..basically what you wrote in the hold action interface...

..am very satisfied with the result 😊 it's a very homogenous thing, you ask for clearance through the hold action menu, npcs move, you get positioned and launched through the hold action menu , npcs move...feels pro 🙂

 

Thank you again!

 

[   
 f35,              
 "Signal Taxiing",             
 "\a3\ui_f\data\igui\cfg\holdactions\holdAction_thumbsup_ca.paa",    
 "\a3\ui_f\data\igui\cfg\holdactions\holdAction_thumbsup_ca.paa",    
 "_this distance _target < 20 AND (driver (f35)) isEqualTo player AND isengineOn f35",   
 "_caller distance _target < 20 AND (driver (f35)) isEqualTo player AND isengineOn f35",   
 {},                
 {},                
 {marshal switchMove "Acts_JetsShooterIdle"; 
 sleep 2; 
 systemChat "sleep done"; 
 marshal playMove "Acts_JetsShooterNavigate_in"; 
 marshal playMove "Acts_JetsShooterNavigate_stop"; 
 marshal playMove "Acts_JetsShooterNavigate_stop"; 
 marshal playMove "Acts_JetsShooterNavigate_stop"; 
 sleep 9; 
 marshal playMove "Acts_JetsShooterNavigate_out"; 
 sleep 2; 
 marshal switchMove "Acts_JetsShooterNavigate_out"; 
 sleep 2; 
 systemChat "sleep"; 
 marshal switchMove "Acts_JetsShooterIdleMoveaway_loop"; 
 marshal playMove "Acts_JetsShooterIdleMoveaway_loop"; 
 marshal playMove "Acts_JetsShooterIdleMoveaway_out";},   
 {},                
 [],                
 3,                
 999,                
 true,               
 false               
] call BIS_fnc_holdActionAdd; 

 

 

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×