Jump to content
Sign in to follow this  
slatts

Aircradt model.cfg issues

Recommended Posts

hey guys, ive been trying to fix a PC-9 model by making a model.cfg for it

so far, the rudder, gears, and elevator work but flaps, the rotor and ailerons dont move/spin

model.cfg

class Rotation;
class CfgSkeletons
{
class MIDF_PC9Skeleton
{
	isDiscrete=1;
	skeletonInherit="";
	skeletonBones[]= 
	{
		"rotor",
		"",
		"NLG",
		"",
 			"NLG_WHEEL",
		"NLG",
 			"MLG_LH",
		"",
 			"MLG_LH_WHEEL",
		"MLG_LH",
 			"MLG_RH",
		"",
 			"MLG_RH_WHEEL",
		"MLG_RH",
   			"NLG_DOOR_LH",
   			"NLG_DOOR_RH",
		"",
		"MLG_DOOR_OTR_LH",
		"",
		"MLG_DOOR_OTR_RH",
		"",
   			"aileronB_right",
		"aileronB_left",
		"",
		"aileronT_right",
		"",
		"aileronT_left",
		"",
		"elevator left",
		"",
		"elevator right",
		"",
		"Elevator",
		"",
		"flaps_L",
		"",
		"flaps_R",
		"",
		"rudder",
		"",
		"Canopy",
		""
	};
};
};


class CfgModels
{
class MIDF_PC9_2
{
	skeletonName="MIDF_PC9Skeleton";

	class Animations
	{
		class Canopy
		{
			type ="rotation"; animPeriod =3;
			selection ="canopy"; axis ="axis_canopy";
			angle0 =0; angle1 =-1.4;
		};
		class rotor
		{
			type = "rotation";
			source = "rotor";
			selection = "prop";
			axis = "axis_prop";
			memory = 1;
			sourceAddress ="loop";
			angle0 = 0;
			minValue = 0;
			maxValue = 1;
			angle1 = "6.3.1415";
		};
		class NLG
		{
			type="rotation";
			memory=1;
			sourceAddress="clamp";
			source="gear";
			selection="NLG";
			axis="axis_NLG";
			minValue=0;
			maxValue=1;
			angle0=0;
			angle1="rad +90";
		};
		class MLG_RH : NLG
		{
			selection="MLG_RH";
			axis="axis_MLG_RH";
			angle0=0;
			angle1="rad +90";
		};
		class MLG_LH : NLG
		{
			selection="MLG_LH";
			axis="axis_MLG_LH";
			angle0=0;
			angle1="rad -90";
		};	
		class NLG_DOOR_LH
		{
			type="rotation";
			initPhase=1;
			memory=1;
			sourceAddress="clamp";
			source="gear";
			selection="FDL";
			axis="AXIS_FDL";
			minValue=0.5;
			maxValue=1;
			angle0=0;
			angle1="rad +90";
		};
		class NLG_DOOR_RH : NLG_DOOR_LH
		{
			selection="FDL";
			axis="axis_FDL";
			angle0=0;
			angle1="rad -90";
		};
		class MLG_DOOR_OTR_LH
		{
			type = "rotation";
			selection = "MLG_DOOR_OTR_LH";
			axis = "axis_mdl";
			source ="gear";
			sourceAddress = "clamp";
			angle0 = 0;
			angle1 = "rad +90";
		};
		class MLG_DOOR_OTR_RH
		{
			type = "rotation";
			selection = "MLG_DOOR_OTR_RH";
			axis = "axis_mdr";
			sourceAddress = "clamp";
			source = "gear";
			angle0 = 0;
			angle1 = "rad -90";
		}; 
		class NLG_Wheel
		{
			type = "rotationX";
			memory=0;
			sourceAddress="loop";
     				source = "wheel";
				selection = "NLG_Wheel";
			axis = "";
			minValue = 0;
			maxValue = 1; 
			angle0 = 0;
			angle1 = "rad -360"; 
  			};
		class MLG_Wheel_RH : NLG_Wheel
		{
				selection = "MLG_RH_WHEEL";
				memory=0;
		};
		class MLG_Wheel_LH : NLG_Wheel
		{
				selection = "MLG_LH_WHEEL";
				memory=0;
		};

		class aileronB_left
		{
			memory=1;
			type="rotation";
			sourceAddress="clamp";
			source="aileron";
			selection="aileron_LH";
			axis="axis_aileron_LH";
			minValue=-1;
			maxValue=1;
			angle0="rad -25";
			angle1="rad +25";
		};
		class aileronB_right : aileronB_left
		{
			selection="aileron_RH";
			axis="axis_aileron_RH";
		};
		class flap_L
		{
			memory=1;
			type="rotation";
			sourceAddress="clamp";
			source="flap";
			selection="FLAP_LH";
			axis="AXIS_FLAP_LH";
			minValue=-1;
			maxValue=1;
			angle0="rad +20";
			angle1="rad -20";
		};
		class flap_R 
		{
			memory=1;
			type="rotation";
			sourceAddress="clamp";
			source="flap";
			selection="FLAP_RH";
			axis="AXIS_FLAP_RH";
			angle0="rad -20";
			angle1="rad +20";
		};
  			class Elevator
		{
     				type = "rotation";
     				source = "elevator";
				selection = "ELEVATOR";
			axis = "axis_elevator";
			memory = true; 
			sourceAddress = "clamp";
			minValue = -1;
       				maxValue = 1;
      				 angle0 = "rad 35"; 
     				angle1 = "rad -35";
  			};
		class rudder
		{
			memory=1;
			type="rotation";
			sourceAddress="clamp";
			source="rudder";
			selection="rudder";
			axis="axis_rudder";
			minValue=-1;
			maxValue=1;
			angle0="rad +20";
			angle1="rad -20";
		};
	};
};
};

P.S i have used search but couldnt find anything that helped

Share this post


Link to post
Share on other sites

You need to make sure your bones match your named selections, match your selections:

"rotor","",
class rotor

{

type = "rotation";

source = "rotor";

selection = "prop";

axis = "axis_prop";

memory = 1;

sourceAddress ="loop";

angle0 = 0;

minValue = 0;

maxValue = 1;

angle1 = "6.3.1415";

};

Depending what you've got in your model, you either need to change the bone name in the skeleton to "prop", or you need to change the selection and axis to "rotor" and "rotor_axis"

Same goes for the ailerons, although theres more "evil" afoot there.

I really really HATE BI's "standard" model.cfg layout, it makes it so much harder to tell whats a child of what:

skeletonBones[]= 
{
"rotor","",

"NLG","",
	"NLG_WHEEL","NLG",

"MLG_LH","",
	"MLG_LH_WHEEL","MLG_LH",

"MLG_RH","",
	"MLG_RH_WHEEL","MLG_RH",

"NLG_DOOR_LH","", //<- note there was a missing ""

"NLG_DOOR_RH","",

"MLG_DOOR_OTR_LH","",
"MLG_DOOR_OTR_RH","",

"aileronB_right","", //<- note there was a missing ""
"aileronB_left","",

"aileronT_right","",
"aileronT_left","",

"elevator left","",
"elevator right","",

"Elevator","",

"flaps_L","",
"flaps_R","",

"rudder","",

"Canopy",""
};

Once you've got that cleaned, you can see that there were some missing parent items, meaning that your right bottom (?) aileron and left nose gear door would not have worked, as well as having bad knock-on effects with other bones.

Again, you need to make sure what you have in the selection and axis match whats in the bones, match whats in the model:

"aileronB_left","",

"aileronT_left","",

doesnt match

selection="aileron_LH";

axis="axis_aileron_LH";

Share this post


Link to post
Share on other sites

everything bar the flaps are now working but thats a great help :)

Share this post


Link to post
Share on other sites

Oh, missed that.

Its the same thing.

Your skeleton defines

flaps_L and _R

but your animation uses flap_lh and _rh

As with everything else, the selection must match the skeleton must match the p3d!

Share this post


Link to post
Share on other sites

solved!

thanks so much i understand now :)

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  

×