Jump to content
Sign in to follow this  
RR_Raptor65

Model.cfg has me at a loss

Recommended Posts

I'm trying to add a new weapon to ArmA 2 for the first time, I have a rifle model in O2 ready to go in-game but I haven't got a clue how to set up a model.cfg so I can start shooting enemies with my rifle in ArmA 2.

The model is literally the last piece of the puzzle, I've already tested the weapon scripts with a placeholder model and it's all good to go. I spent the better part of the day trying to find a guide or tutorial on the model.cfg but between Google and the forum search I've only found vague references probably meant for people who already have experience in ArmA modding.

I'm at a loss and on the verge of abandoning ArmA 2 all together. So this is a last ditch attempt to sort this out.

th_R36_TextureWIP03_sm.jpg

Here is the .p3d file is anyone is willing to check my work:

http://www.speedyshare.com/files/21669604/R36.p3d

Share this post


Link to post
Share on other sites

A fairly basic model.cfg should do for a simple rifle.

class CfgSkeletons
{
   class Default;
   class Weapon: Default
   {
       skeletonInherit = "Default";
       skeletonBones[]=
       {
           "magazine","",
           "ammo_belt","",
           "ammo_belt_bottom",""
       };
   };
};

class CfgModels
{
   class Default
   {
       sectionsInherit="";
       sections[] = {};
       skeletonName = "";
   };
   class Weapon: Default
   {
       sections[]=
       {
           "zasleh"
       };
       skeletonName="Weapon";
       };

   class R36: Weapon {};
};

Pop it in the same folder with the config.cpp and the model + textures before binarizing.

Planck

Share this post


Link to post
Share on other sites

Much appreciated! The rifle is in the game and working perfectly now, muzzle flash and all. Can't guarantee I won't be back when I tackle adding my tanks and aircraft though.

Share this post


Link to post
Share on other sites

In a bit of a thread hi-jack, I've been wrestling with wheeled vehicle a model.cfg issue for a couple weeks. Could you post a simple one of those? :)

For instance, the wheels have named selections of wheel_1_1 and wheel_1_2.

Also, though, there are multiple models, so I think the directory structure should be:

\root\config

\root\models\model1\model1.p3d && model.cfg

\root\models\model2\model2.p3d && model.cfg

etc.?

Share this post


Link to post
Share on other sites
class Rotation;
class CfgSkeletons
{
class Vehicle;
class NAMEOFP3D: Vehicle
{
	isDiscrete=1;
	skeletonInherit="vehicle";
	skeletonBones[]=
	{
		"DriveWheel",
		"",
		"fuel",
		"",
		"rpm",
		"",
		"mph",
		"",
		"wheel_1_1_damper",
		"",
		"wheel_1_2_damper",
		"",
		"wheel_2_1_damper",
		"",
		"wheel_2_2_damper",
		"",
		"wheel_3_1_damper",
		"",
		"wheel_3_2_damper",
		"",
		"wheel_4_1_damper",
		"",
		"wheel_4_2_damper",
		"",
		"wheel_5_1_damper",
		"",
		"wheel_5_2_damper",
		"",
		"wheel_1_1_steering",
		"wheel_1_1_damper",
		"wheel_1_2_steering",
		"wheel_1_2_damper",
		"wheel_2_1_steering",
		"wheel_2_1_damper",
		"wheel_2_2_steering",
		"wheel_2_2_damper",
		"wheel_1_1",
		"wheel_1_1_steering",
		"wheel_1_2",
		"wheel_1_2_steering",
		"wheel_2_1",
		"wheel_2_1_steering",
		"wheel_2_2",
		"wheel_2_2_steering",
		"wheel_3_1",
		"wheel_3_1_damper",
		"wheel_3_2",
		"wheel_3_2_damper",
		"wheel_4_1",
		"wheel_4_1_damper",
		"wheel_4_2",
		"wheel_4_2_damper",
		"wheel_5_1",
		"wheel_5_1_damper",
		"wheel_5_2",
		"wheel_5_2_damper",
		"turret",
		"",
		"gun",
		"turret",
		"hatch_driver",
		"",
		"hatch_Gunner",
		"",
		"fuel_1",
		"",
		"ukaz_rpm",
		"",
		"ukaz_rychlo",
		"",
		"drive_front",
		"",
		"drive_center",
		"",
		"drive_rear",
		"",
		"bed",

		"",
		"damageHide",
		""
	};
};
};
class CfgModels
{
class Vehicle;

class NAMEOFP3D: Vehicle
{
	skeletonName="NAMEOFP3D";
	sectionsInherit="Vehicle";
	sections[]=
	{
		"Light_1_1",
		"Light_1_2",
		"Light_brake",
		"Light_back",
		"clan",
		"clan_sign",
		"zasleh",
		"karoserie",
		"vez",
		"motor",
		"palivo",
		"zbran"
	};
	class Animations
	{
		class fuel: Rotation
		{
			type="rotation";
			source="fuel";
			selection="fuel_01";
			axis="fuel_01_axis";
			memory=0;
			minValue=0.000000;
			maxValue=1.000000;
			angle0=0.174533;
			angle1=-4.014257;
		};
		class IndicatorSpeed: Rotation
		{
			animPeriod=0;
			type="rotation";
			source="speed";
			selection="ukaz_rychlo";
			axis="osa_rychlo";
			memory=0;
			minValue=0.000000;
			maxValue=16.670000;
			angle0=0.000000;
			angle1=4.0;
		};
		class IndicatorRPM: Rotation
		{
			animPeriod=0;
			type="rotation";
			source="rpm";
			selection="ukaz_rpm";
			axis="osa_rpm";
			memory=0;
			minValue=0.000000;
			maxValue=1.000000;
			angle0=0.000000;
			angle1=3.75;
		};
		class IndicatorOilTemp: Rotation
		{
			source="oil";
			selection="oilTemp";
			axis="oilTemp_axis";
			memory=0;
			maxValue=0.200000;
			angle1="rad 80";
		};
		class DrivingWheel: Rotation
		{
			source="drivingWheel";
			selection="drivewheel";
			axis="drivewheel_axis";
			minValue=-1;
			maxValue=1;
			angle0=-4;
			angle1=4;
		};
		class Steering_1_1
		{
			type="rotationY";
			source="drivingWheel";
			selection="wheel_1_1_steering";
			axis="wheel_1_1_steering_axis";
			memory=1;
			minValue="rad -90";
			maxValue="rad +90";
			angle0=0.900000;
			angle1=-0.900000;
		};
		class Steering_1_2: Steering_1_1
		{
			selection="wheel_1_2_steering";
			axis="wheel_1_2_steering_axis";
		};
		class Steering_2_1: Steering_1_1
		{
			selection="wheel_2_1_steering";
			axis="wheel_2_1_steering_axis";
			memory=1;
		};
		class Steering_2_2: Steering_1_1
		{
			selection="wheel_2_2_steering";
			axis="wheel_2_2_steering_axis";
			memory=1;
		};
		class Wheel_1_1
		{
			type="rotationX";
			source="wheel";
			selection="wheel_1_1";
			axis="";
			memory=1;
			sourceAddress="loop";
			minValue=0;
			maxValue=1;
			angle0=0;
			angle1="rad -360";
		};
		class Wheel_1_2: Wheel_1_1
		{
			selection="wheel_1_2";
		};
		class Wheel_2_1: Wheel_1_1
		{
			selection="wheel_2_1";
		};
		class Wheel_2_2: Wheel_1_1
		{
			selection="wheel_2_2";
		};
		class Wheel_3_1: Wheel_1_1
		{
			selection="wheel_3_1";
		};
		class Wheel_3_2: Wheel_1_1
		{
			selection="wheel_3_2";
		};
		class Wheel_4_1: Wheel_1_1
		{
			selection="wheel_4_1";
		};
		class Wheel_4_2: Wheel_1_1
		{
			selection="wheel_4_2";
		};
		class Wheel_5_1: Wheel_1_1
		{
			selection="wheel_5_1";
		};
		class Wheel_5_2: Wheel_1_1
		{
			selection="wheel_5_2";
		};
		class Wheel_1_1_Damper
		{
			type="translationY";
			source="damper";
			selection="wheel_1_1_damper";
			axis="";
			minValue=-1;
			maxValue=1;
			memory=1;
		};
		class Wheel_1_2_Damper: Wheel_1_1_Damper
		{
			selection="wheel_1_2_damper";
		};
		class Wheel_2_1_Damper: Wheel_1_1_Damper
		{
			selection="wheel_2_1_damper";
		};
		class Wheel_2_2_Damper: Wheel_1_1_Damper
		{
			selection="wheel_2_2_damper";
		};
		class Wheel_3_1_Damper: Wheel_1_1_Damper
		{
			selection="wheel_3_1_damper";
		};
		class Wheel_3_2_Damper: Wheel_1_1_Damper
		{
			selection="wheel_3_2_damper";
		};
		class Wheel_4_1_Damper: Wheel_1_1_Damper
		{
			selection="wheel_4_1_damper";
		};
		class Wheel_4_2_Damper: Wheel_1_1_Damper
		{
			selection="wheel_4_2_damper";
		};
		class Wheel_5_1_Damper: Wheel_1_1_Damper
		{
			selection="wheel_5_1_damper";
		};
		class Wheel_5_2_Damper: Wheel_1_1_Damper
		{
			selection="wheel_5_2_damper";
		};
		class MainTurret
		{
			type="rotationY";
			source="mainTurret";
			selection="turret";
			axis="turret_axis";
			animPeriod=0;
			minValue="rad -360";
			maxValue="rad +360";
			angle0="rad -360";
			angle1="rad +360";
		};
		class MainGun
		{
			type="rotationX";
			source="mainGun";
			selection="gun";
			axis="gun_axis";
			animPeriod=0;
			minValue="rad -360";
			maxValue="rad +360";
			angle0="rad -360";
			angle1="rad +360";
		};
		class HatchDriver: Rotation
		{
			source="hatchDriver";
			selection="hatch_driver";
			axis="hatch_driver_axis";
			memory="false";
			angle1="rad -90";
		};
		class HatchGunner: Rotation
		{
			source="hatchGunner";
			selection="hatch_gunner";
			axis="hatch_gunner_axis";
			memory="false";
			angle1="rad -110";
		};

		class drive_front: rotation

		{
			type="rotationz";
			source="wheel";
			selection="drive_front";
			axis="";
			memory=1;
			sourceAddress="loop";
			minValue=0;
			maxValue=1;
			angle0=0;
			angle1="rad -360";
		};
		class drive_center: drive_front

		{
			type="rotationz";
			source="wheel";
			selection="drive_center";
			axis="drive_center_axis";
			memory=1;
			sourceAddress="loop";
			minValue=0;
			maxValue=1;
			angle0=0;
			angle1="rad -360";
		};
		class drive_rear: drive_front

		{
			type="rotationz";
			source="wheel";
			selection="drive_rear";
			axis="drive_rear_axis";
			memory=1;
			sourceAddress="loop";
			minValue=0;
			maxValue=1;
			angle0=0;
			angle1="rad -360";
		};
		class bed
		{
			type="translation";
			source="bed";
			selection="bed";
			axis="bed_axis";
			sourceAddress="clamp";
			minValue=0;
			maxValue=5;
			offset0=0.000000;
			offset1=-6.50000;
			memory=1;
		};
		class bed_tilt :bed

		{
			type="rotation";
			source="bed_tilt";
			selection="bed";
			axis="bed_tilt_axis";
			sourceAddress="clamp";
			memory=1;
			minValue=0;
			maxValue=1;
			angle0=0;
			angle1="rad -18.5";
		};
	};
};	
};

Share this post


Link to post
Share on other sites
In a bit of a thread hi-jack, I've been wrestling with wheeled vehicle a model.cfg issue for a couple weeks. Could you post a simple one of those? :)

For instance, the wheels have named selections of wheel_1_1 and wheel_1_2.

Also, though, there are multiple models, so I think the directory structure should be:

\root\config

\root\models\model1\model1.p3d && model.cfg

\root\models\model2\model2.p3d && model.cfg

etc.?

thanks for the mail mate, considered it solved and much more added by tomorrow ;)

Share this post


Link to post
Share on other sites

Thanks, granQ - and to rstratton (who sent me a config that has helped me understand it a bit more, too).

Great team effort to help a n00b here. :)

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  

×