Jump to content
Sign in to follow this  
sarge (sgs)

Gear animation (plane)

Recommended Posts

Hi all. Do you know, how i can manualy run animation of plane gear? My idea is simulate landing crash with the break one wheel.

Example: in Skyrider addon to operation flashpoint I found this animate ["RightWheel", 0]. But I cannot found enything like this in ArmA 2 (SU 25)

Share this post


Link to post
Share on other sites

Cant open any model.cfg for it but it might be like the Su34;

Front gear; predni kolo

Left gear; levy kolo

Right gear; pravy kolo

Share this post


Link to post
Share on other sites
Gnat;1547827']Cant open any model.cfg for it but it might be like the Su34;

Front gear; predni kolo

Left gear; levy kolo

Right gear; pravy kolo

I try this. I create tigger radio alpha' date=' "in activation" I try put this:

su (name su 34 plane)

su animate ["right_gear", 0']

su animate ["right gear", 0]

su animate ["pravy kolo", 0]

su animate ["pravy_kolo", 0]

But it don´t work. Anything else or I do something wrong?

Share this post


Link to post
Share on other sites

Funny enough that i do the same. It needs several steps. First in model cfg:

		class Fold_Gear_F {
			type="rotation";
			memory=1;
			sourceAddress="clamp";
			source="user";
			animperiod=3.5;
			selection="fold_gear_F";
			axis="axis_fold_gear_F";
			minValue=0;
			maxValue=0.700000;
			angle0=0;
			angle1="rad -100";
		};

Just copy/pasted a single part, make sure all gear-related anims are changed the same way.

Changes:

- source is no longer attached to "gear" but "user"

- new config entry animPeriod=3.5;

I found out that animPeriod is not absolute but as multiplier together with maxValue. For real animationTime just do animPeriod * maxValue.

Then in the config.cpp:

	class animationsources {
		class Fold_Gear_F {
			source="user";
			animPeriod=3.5;
			initPhase=0;
		};
              };

Also here for each anim that is related to gear animation. As example i've just copied one.

You need also to remove the default "Gear up/down" action entry in the vehicles config:

gearRetracting  = 0;

Then a little function to animate the gear (finally):

GEAR = {
private ["_anims", "_i"];
_i = abs ((_this animationPhase "Fold_Gear_F") - 1);
_anims = ["Fold_Gear_F", "Fold_Gear_R", "Fold_Gear_L", "Gear_Door_F", "Gear_Door_R", "Gear_Door_L"];
{_this animate [_x, _i]} foreach _anims;
};

Please note that this code work for both ways, gear up and down.

And last but not least, adding custom actions to the plane:

	class UserActions {
		class lowerGear {
			displayName ="$STR_ACTION_LOWERGEAR";
			displayNameDefault = "";
			position = "pilotcontrol";
			radius = 15;
			condition = "this animationPhase 'Fold_Gear_F' > 0.9";
			statement = "this spawn GEAR";
			onlyforplayer = 1;
		};
		class RaiseGear {
			displayName ="$STR_ACTION_RAISEGEAR";
			displayNameDefault = "";
			position = "pilotcontrol";
			radius = 15;
			condition = "(getposATL this select 2) > 2 and this animationPhase 'Fold_Gear_F' < 0.1";
			statement = "this spawn GEAR";
			onlyforplayer = 1;
		};
	};

This is tested and works.

You'll not be able to retract gear while on ground.

With this, you have a gear that can be animated independently. You may extent script to simulate failure depending on your own definitions. This is up to you, here you got a start at least.

Share this post


Link to post
Share on other sites

It´s look well. But, I want this only for animation in intro. It´s still necessary create config and more theese things or exist some more easily solution?

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  

×