Jump to content
Sign in to follow this  
natanbrody

Huey Animations not working problem in model.cfg ( I think)

Recommended Posts

Alright so I have been editing this huey so that its doors can open and close. I have both doors moved into the closed position in the model and have them both set as selections (doorsleft and doorsright). I have set up in the memory LOD an axis and a switch point which are all named accordingly in the Model.cfg.
When I try to spawn in the vehicle I will get an error saying that there is no entry for the vehicle skeleton sections... I dont know if this is what is causing the problem since the rotor and all other animated components are animated exactly as I wish.
I will leave a copy of the model.cfg and the animation part from the config.cpp below.
 

//################################################### S K E L E T O N E S   B E G I N ###################################################
class CfgSkeletons
{

	class Vehicle;
	class Helicopter: Vehicle
	{
		skeletonInherit="Vehicle";
		skeletonBones[]=
		{
			"velka vrtule dive",
			"",
			"mala vrtule dive",
			"",
			"velka vrtule",
			"velka vrtule dive",
			"mala vrtule",
			"mala vrtule dive",
			"otocvez",
			"",
			"otochlaven",
			"otocvez",
			"alt",
			"",
			"alt2",
			"",
			"nm_alt",
			"",
			"nm_alt2",
			"",
			"mph",
			"",
			"mph2",
			"",
			"vert_speed",
			"",
			"vert_speed2",
			"",
			"rpm",
			"",
			"rpm2",
			"",
			"horizont",
			"",
			"horizont2",
			"",
			"kompas",
			"",
			"kompas2",
			"",
			"hodinova",
			"",
			"hodinova2",
			"",
			"minutova",
			"",
			"minutova2",
			"",
			"damageHide",
			""
		};
	};
	
	class UH1HSkeleton:Helicopter
	{
		isdiscrete=0;
		skeletonInherit="Helicopter";
		skeletonBones[]=
		{
			"rotordive","rotorbank",
			"rotor static dive","rotorbank",
			"rotorbank","velka vrtule",
			"horizont_1","",
			"otocvez_1","",
			"otochlaven_1","otocvez_1",
			"doorsleft","",
			"doorsright",""
		};

	};
};
class Rotation
{
	type = "rotation";
	memory = 1;
	minValue = 0;
	maxValue = 1;
	angle0 = 0;
	angle1 = 1;
};
class CfgModels
{
	class Helicopter
	{

		htMin = 60;		// Minimum half-cooling time (in seconds)
		htMax = 1800;	// Maximum half-cooling time (in seconds)
		afMax = 200;	// Maximum temperature in case the model is alive (in celsius)
		mfMax = 100;	// Maximum temperature when the model is moving (in celsius)
		mFact = 0;		// Metabolism factor - number from interval <0, 1> (0 - metabolism has no influence, 1 - metabolism has full influence (no other temperature source will be considered)).
		tBody = 0;	 	// Metabolism temperature of the model (in celsius)
		sectionsInherit = "";
		sections[]=
		{
			"alt",
			"alt2",
			"nm_alt",
			"nm_alt2",
			"mph",
			"mph2",
			"vert_speed",
			"vert_speed2",
			"rpm",
			"rpm2",
			"kompas",
			"kompas2",
			"hodinova",
			"hodinova2",
			"minutova",
			"minutova2",
			"velka vrtule",
			"mala vrtule",
			"horizont",
			"horizont2",
			"sklo predni p",
			"sklo predni l",
			"velka vrtule",
			"mala vrtule",
			"velka vrtule staticka",
			"velka vrtule blur",
			"mala vrtule staticka",
			"mala vrtule blur",
			"zasleh_1",
			"motor",
			"elektronika",
			"munice",
			"zbran",
			"vez",
			"trup",
			"clan",
			"clan_sign",
			"glass1",
			"glass2",
			"glass3",
			"glass4",
			"glass5",
			"glass6",
			"podsvit pristroju"
		};
		skeletonName="Helicopter";
		class Animations
		{
			// destruct BASE START
			// rotor static dive
			// rotordive
			// rotorShaft
			// velka vrtule
			// mala vrtule
			class Rotor_destructX
			{
				type="rotationX";
				source="damage";//damage
				selection="velka vrtule";
				axis="velka osa";
				animPeriod=0;
				minValue=0.99;
				maxValue=1;
				angle0=0;
				angle1="rad -20";
			};
			class Rotor_destructY:Rotor_destructX
			{
				type="rotationY";
				angle1="rad +40";
			};
			class rotordive_destructX:Rotor_destructX
			{
				selection="rotordive";
				angle1="rad -5";
			};
			class rotordive_destructY:rotordive_destructX
			{
				type="rotationY";
				angle1="rad -15";
			};
			class rotordive_destructZ:rotordive_destructX
			{
				type="rotationZ";
				angle1="rad -5";
			};
			class rotor_static_dive_destructX:Rotor_destructX
			{
				selection="rotor static dive";
				angle1="rad 5";
			};
			class rotor_static_dive_destructY:rotor_static_dive_destructX
			{
				type="rotationY";
				angle1="rad -15";
			};
			class rotor_static_dive_destructZ:rotor_static_dive_destructX
			{
				type="rotationZ";
				angle1="rad -5";
			};
			class mala_vrtule_destructY:Rotor_destructX
			{
				type="rotationY";
				axis="mala osa";
				selection="mala vrtule";
				angle1="rad 10";
			};
			class mala_vrtule_destructZ:mala_vrtule_destructY
			{
				type="rotationZ";
				angle1="rad 25";
			};
			// destruct BASE END

		  class damageHide
		  {
				  type="hide";
				  source="damage";
				  selection="damageHide";
		  };
            class IndicatorAltBaro: Rotation
			{
				source="altBaro";
				sourceAddress="loop";
				selection="alt";
				axis="osa_alt";
				memory=0;
				maxValue=304;
				angle1="rad -360";
			};
			class IndicatorAltBaro2: IndicatorAltBaro
			{
				selection="alt2";
				axis="osa_alt2";
			};
			class IndicatorAltRadar: Rotation
			{
				source="altRadar";
				selection="nm_alt";
				axis="osa_nm_alt";
				memory="false";
				maxValue=61;
				angle1="rad -180";
			};
			class IndicatorAltRadar2: IndicatorAltRadar
			{
				selection="nm_alt2";
				axis="osa_nm_alt2";
			};
			class IndicatorSpeed: Rotation
			{
				source="speed";
				selection="mph";
				axis="osa_mph";
				memory="false";
				maxValue=125;
				angle1="rad -320";
			};
			class IndicatorSpeed2: IndicatorSpeed
			{
				selection="mph2";
				axis="osa_mph2";
			};
			class IndicatorVertSpeed: Rotation
			{
				type = "rotation";
				source="vertSpeed";
				selection="vert_speed";
				axis="osa_vert_speed";
				minValue=-30;
				maxValue=30;
				angle1="rad -300";
			};
			class IndicatorVertSpeed2: IndicatorVertSpeed
			{
				selection="vert_speed2";
				axis="osa_vert_speed2";
			};
			class IndicatorRPM: Rotation
			{
				source="rpm";
				selection="rpm";
				axis="osa_rpm";
				memory="false";
				maxValue=12;
				angle1="rad -320";
			};
			class IndicatorRPM2: IndicatorRPM
			{
				selection="rpm2";
				axis="osa_rpm2";
			};
			class IndicatorCompass: Rotation
			{
				type = "rotation";
				source="direction";
				selection="kompas";
				axis="osa_kompas";
				memory="false";
				minValue=-3.141593;
				maxValue=3.141593;
				angle0 = 0;
				angle1="rad -360";
			};
			class IndicatorCompass2: IndicatorCompass
			{
				selection="kompas2";
				axis="osa_kompas2";
			};
			class WatchHour: Rotation
			{
				type = "rotation";
				source="clockHour";
				selection="hodinova";
				axis="osa_time";
				memory="false";
				angle0 = 0;
				angle1="rad -360";
			};
			class WatchHour2: WatchHour
			{
				selection="hodinova2";
				axis="osa_time2";
			};
			class WatchMinute: Rotation
			{
				type = "rotation";
				source="clockMinute";
				selection="minutova";
				axis="osa_time";
				memory="false";
				angle0 = 0;
				angle1="rad -360";
			};
			class WatchMinute2: WatchMinute
			{
				selection="minutova2";
				axis="osa_time2";
			};
			class HRotor: Rotation
			{
				source="rotorH";
				selection="velka vrtule";
				axis="velka osa";
				angle1="2 * 3.1415926536";
			};
			class VRotor
			{
				type = "rotationX";
				source = "rotorV";
				selection = "mala vrtule";
				axis = "mala osa";
				memory = 1;
				sourceAddress = "loop";
				minValue = 0;
				maxValue = 1;
				angle0 = 0;
				angle1 = "rad +360";
			};
			class HorizonBank
			{
				type="rotationZ";
				source="horizonBank";
				selection="horizont";
				axis="osa_horizont";
				memory="false";
				minValue="rad -360";
				maxValue="rad +360";
				angle0="rad -360";
				angle1="rad +360";
			};
			class HorizonDive
			{
				type="rotationX";
				source="horizonDive";
				selection="horizont";
				axis="osa_horizont";
				memory=0;
				minValue=-6.283190;
				maxValue=6.283190;
				angle0=-6.283190;
				angle1=6.283190;
			};
			class Horizon2Bank: HorizonBank
			{
				selection="horizont2";
				axis="osa_horizont2";
			};
			class Horizon2Dive: HorizonDive
			{
				selection="horizont2";
				axis="osa_horizont2";
			};
		};
	};
	class UH1H: Helicopter
	{
		skeletonName="UH1HSkeleton";
		sectionsInherit="Helicopter";
		sections[]=
		{
			"rotordive",
			"mph",
			"rotorbank",
			camo1,
			camo2,
			camo_mlod,
			zasleh_1,
			zasleh,
			zbytek,
			trup,
			"doorsleft",
			"doorsright"
		};
		class Animations: Animations
		{
			class IndicatorAltRadar: Rotation
			{
				type = "rotation";
				source="altRadar";
				sourceAddress="loop";
				selection="nm_alt";
				axis="osa_nm_alt";
				memory=0;
				maxValue=304;
				angle0 = 0;
				angle1="rad -360";
			};
			class IndicatorAltRadar2: IndicatorAltRadar
			{
				selection="nm_alt2";
				axis="osa_nm_alt2";
			};
			class IndicatorAltBaro: Rotation
			{
				type = "rotation";
				source="altBaro";
				selection="alt";
				axis="osa_alt";
				memory="false";
				maxValue=61;
				angle0 = 0;
				angle1="rad -180";
			};
			class IndicatorAltBaro2: IndicatorAltBaro
			{
				selection="alt2";
				axis="osa_alt2";
			};
			class IndicatorSpeed: Rotation
			{
				type = "rotation";
				source="speed";
				selection="mph";
				axis="osa_mph";
				memory="false";
				maxValue=125;
				angle0 = 0;
				angle1="rad -320";
			};
			class IndicatorSpeed2: IndicatorSpeed
			{
				selection="mph2";
				axis="osa_mph2";
			};
			class IndicatorVertSpeed: Rotation
			{
				type = "rotation";
				source="vertSpeed";
				selection="vert_speed";
				axis="osa_vert_speed";
				memory=0;
				minValue=-30;
				maxValue=30;
				angle0 = 0;
				angle1=-5.2359881;
			};
			class IndicatorVertSpeed2: IndicatorVertSpeed
			{
				selection="vert_speed2";
				axis="osa_vert_speed2";
				memory=0;
			};
			class IndicatorRPM: Rotation
			{
				type = "rotation";
				source="rpm";
				selection="rpm";
				axis="osa_rpm";
				memory="false";
				maxValue=12;
				angle0 = 0;
				angle1="rad -320";
			};
			class IndicatorRPM2: IndicatorRPM
			{
				selection="rpm2";
				axis="osa_rpm2";
			};
			class RotorTilt
			{
				selection="rotordive";
				source="rpm";
				axis="velka osa";
				type="translation";
				memory=1;
				minValue=0.0000000;
				maxValue=12.0000000;
				offset0=0.00000;
				offset1=-2.92000;
			};
		//guns
			class damageHide;
			class RotorHDive
			{
				selection="rotorbank";
				axis="predni osa naklonu";
				type="rotationX";
				source="horizonDive";
				minValue=-0.5;
				maxValue=0.5;
				angle0="rad -4";
				angle1="rad 4";
				animPeriod=0;
			};
			class RotorHBank
			{
				selection="rotorbank";
				axis="predni osa naklonu";
				type="rotationZ";
				source="horizonBank";
				minValue=-0.5;
				maxValue=0.5;
				angle0="rad 10";
				angle1="rad -10";
			};
			class HorizonBank
			{
				type="rotationZ";
				source="horizonBank";
				selection="horizont";
				axis="osa_horizont";
				memory="false";
				minValue="rad -360";
				maxValue="rad +360";
				angle0="rad -360";
				angle1="rad +360";
			};
			class HorizonDive
			{
				type="rotationX";
				source="horizonDive";
				selection="horizont";
				axis="osa_horizont";
				memory=1;
				minValue="rad -360";
				maxValue="rad +360";
				angle0="rad -360";
				angle1="rad +360";
			};

			class HRotor: Rotation
			{
				source="rotorH";
				selection="velka vrtule";
				axis="velka osa";
				angle1="2 * 3.1415926536";
			};
			class VRotor
			{
				type = "rotationX";
				source = "rotorV";
				selection = "mala vrtule";
				axis = "mala osa";
				memory = 1;
				sourceAddress = "loop";
				minValue = 0;
				maxValue = 1;
				angle0 = 0;
				angle1 = "rad +360";
			};
			class leftdooranim : Rotation
			{	
				type = "rotationY";
				source = "user";
				animPeriod = "5";
				selection = "doorsleft";
                axis = "doorsleftaxis";
                sourceAddress = "clamp";
                memory = 1;
				minValue = 0;
				maxValue = 1;
				angle0 = 0;
				angle1 = "rad 16";
			};
		};
	};
};


Here is the useraction + animation part of the helicopter.

class AnimationSources
        {
            class leftdooranim
            {
                source = "user";
                animPeriod = 5;
                initPhase = 0;
            };
		};
		class UserActions
        {
            class openleftdoor
            {
                displayName = "Open Left Door";
                position = "doorswitch";
                radius = 2;
                onlyforplayer = true;
                condition = "this animationPhase ""leftdoor"" < 0.5";
                statement = "this animate [""leftdoor"", 1]";
            };
			
			class closeleftdoor
            {
                displayName = "Close Left Door";
                position = "doorswitch";
                radius = 2;
                onlyforplayer = true;
                condition = "this animationPhase ""leftdoor"" >= 0.5";
                statement = "this animate [""leftdoor"", 0]";
            };
		};
};
};

Share this post


Link to post
Share on other sites

In the model.cfg you've got animation class name: "leftdooranim" . In the userActions, both in condition and the statement fields you refers to "leftdoor" animation which purely doesn't exist in model.cfg. Just change it into "leftdooranim" and that's it.

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  

×