Jump to content
Sign in to follow this  
six_ten

model.cfg bones -- simple question

Recommended Posts

Can someone please help sort this out -- I have a simple cannon -- a gun tube atop a simple carriage, a wheel on each side. ( similar to this: http://www.nps.gov/common/uploads/photogallery/ner/park/colo/CA8C6BA3-155D-451F-6758AA599D22E3F5/CA8C6BA3-155D-451F-6758AA599D22E3F5-large.jpg )

I want the wheels to rotate (in opposite directions) as I turn the turret. Somehow I can get one or the other, but not both of the wheels to move. At the moment, the left wheel rotates just fine. I just can't seem to wrap my head around this boning setup.

"Port1Turret",

"",

"Port1Gun",

"Port1Turret",

"",

"Wheel_R",

"Port1Turret",

"",

"Wheel_L",

"Port1Turret",

"",

/////////////////////////////

class Port1Turret //the carriage

{

type="rotationY";

source="Port1Turret";

selection="Port1Turret";

axis="axisP1turret";

animPeriod=0;

memory=1;

minValue="rad -360";

maxValue="rad +360";

angle0="rad -360";

angle1="rad +360";

};

class Port1Gun //the gun barrel

{

type="rotationX";

source="Port1Gun";

selection="Port1Gun";

axis="axisP1gun";

animPeriod=0;

memory=1;

minValue="rad -360";

maxValue="rad +360";

angle0="rad -360";

angle1="rad +360";

};

class Wheel_L: Port1Turret //the wheels moving in opposite directions as turret is rotated

{

type="rotationX";

source="Port1Turret";

selection="Wheel_L";

axis="Wheel_L_Axis";

animPeriod=0;

memory=1;

minValue="rad -360";

maxValue="rad +360";

angle0="rad -360";

angle1="rad +360";

};

class Wheel_R: Port1Turret //the wheels moving in opposite directions as turret is rotated

{

type="rotationX";

source="Port1Turret";

selection="Wheel_R";

axis="Wheel_R_Axis";

animPeriod=0;

memory=1;

minValue="rad -360";

maxValue="rad +360";

angle0="rad -360";

angle1="rad +360";

};

Thanks in advance for any help.

Share this post


Link to post
Share on other sites

Please use either php or code tags to present your code, or use pastebin to paste your config.

Its not really possible to give you a precise answer if we dont know what selections represent which part of the model

Do you know what inheritance is (regarding code)? Might be worth a google search. You are inheriting the wheel animation classes Wheel_R and _L from PortTurret, but its not necessary. Also, why do you have "Wheel_L_Axis" and "Wheel_R_Axis". Shouldn't they be the same? Just define 1 axis and use it for both.

Both wheel animations have

 
angle0="rad -360";
angle1="rad +360";

So they will turn in the same direction... change + to - and vice versa for one...

Share this post


Link to post
Share on other sites

Hi Fennek, Thanks for taking a look at this. I've spent hours reading about inheritance and setting up animations, and hours in trial and error (mostly error) but I can't understand how the system works. For instance at https://community.bistudio.com/wiki/Model_Config they say that

skeletonBones[] = //Add two new bones. The movement

{ //of bone2 is linked to bone1.

"bone1", ""

"bone2", "bone1"

That seems to me to mean that if I want my wheel to turn it has to be linked to the turret. So I tried to reproduce that. My gun and turret work fine: when I turn the turret (gun carriage) the barrel moves along with it, and also can elevate and depress independently. It is perfect. I just can't figure out how to get both wheels to move at the same time, only one or the other.

Port1Gun is the cannon barrel. It works fine. Elevates and depresses, sticks to the turret, fires, etc.

Port1Turret is the gun carriage. Also works fine. It pivots, the recoil makes it jump nicely.

The field cannon has two wheels, Left and Right.

There is a wedge of wood under the barrel that I want to slide forward and back as the barrel moves up or down.

I would like to tie the recoil to the Wheels so when it fires the gun moves backward a half-meter or so and both turn together so it looks like they roll back together.

Here's the code.

model.cfg




//////////////////////////////////////////////////////////////////////
//						BLACK POWDER 
//						ART_Weapons\FieldGun3pdr
//////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////	
//  			BEGIN GUN BASE
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////	


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

class CfgSkeletons 
{ 
class default
{
	isDiscrete = 1;
	skeletonInherit = "";
	skeletonBones[] = {};
};

class FieldGunBaseSkeleton: default
{
	isDiscrete=1;
	skeletonInherit = "";

	skeletonBones[]=
	{	

/*  EXAMPLE


THIS WAY THE RIGHTHAND WHEEL WORKS	
	"Port1Turret",
	"",
	"Port1Gun",
	"Port1Turret",
	"",		
	"Wheel_L",
	"Port1Turret",		
	"",	
	"Wheel_R",
	"Port1Turret",
	""
THIS WAY THE RIGHTHAND WHEEL WORKS


THIS WAY THE LEFTHAND WHEEL WORKS
	"Port1Turret",
	"",
	"Port1Gun",
	"Port1Turret",
	"",		
	"Wheel_R",
	"Port1Turret",		
	"",	
	"Wheel_L",
	"Port1Turret",
	""
THIS WAY THE LEFTHAND WHEEL WORKS


*/

	"Wheel_L",
	"Port1Turret",
	"",
	"Wheel_R",
	"Port1Turret",
	"",	
	"Port1Turret",
	"",
	"Port1Gun",
	"Port1Turret",
	""


	};
};
};



class CfgModels
{
class Default;
class StaticWeapon:Default
{
	class Animations;
};

class Cannon: StaticWeapon
{
	class Animations: Animations
	{
		class recoil_BEGIN;
		class recoil_END;
	};
};

class 18thC_Cannon: Cannon
{
	class Animations: Animations
	{
		class recoil_BEGIN;
		class recoil_END;
	};
};	

class FieldGun: 18thC_Cannon
{
	skeletonName = "FieldGunBaseSkeleton";

	sectionsInherit="";
	sections[] = 
	{	
	"Port1Turret",
	"Port1Gun",
	"Wedge",
	"Wheel_L",
	"Wheel_R",
	"Wheels",		
	"zbytek"

	};		

	class Animations: Animations
	{
		class recoil_BEGIN:recoil_BEGIN
		{
			offset1=-0.3;
//				offset1=-0.5;
		};

		class recoil_END:recoil_END
		{

//				offset0=5.3;	///  gbs added to test  there are more offsets in main weapons config
			offset1=0.3;				

		};

		class Port1Turret 		//the horizontal moving part of the turret
		{
			type="rotationY";
			source="Port1Turret";
			selection="Port1Turret";
			axis="axisP1turret";
			animPeriod=0;
			memory=1;
			minValue="rad -360";
			maxValue="rad +360";
			angle0="rad -360";
			angle1="rad +360";
		};

		class Port1Gun 			//the vertical moving part of the turret
		{
			type="rotationX";
			source="Port1Gun";
			selection="Port1Gun";
			axis="axisP1gun";
			animPeriod=0;
			memory=1;
			minValue="rad -360";
			maxValue="rad +360";
			angle0="rad -360";
			angle1="rad +360";
		};		

		class Wheel_L			//the wheels moving in opposite directions as turret is rotated
		{
			type="rotationX";
			source="Port1Turret";
			selection="Wheel_L";
			axis="Wheel_L_Axis";
			animPeriod=0;
			memory=1;
			minValue="rad -360";
			maxValue="rad +360";
			angle0="rad -360";
			angle1="rad +360";
		};

		class Wheel_R			//the wheels moving in opposite directions as turret is rotated
		{
			type="rotationX";
			source="Port1Turret";
			selection="Wheel_R";
			axis="Wheel_R_Axis";
			animPeriod=0;
			memory=1;

			minValue="rad -360";
			maxValue="rad +360";
			angle0="rad +360";
			angle1="rad -360";
		};


		class Wheels 			//the wheels rolling back together with recoil of gun
		{
			type="rotationX";
			source="recoil";
			selection="Wheels";
			axis="Wheels_Axis";
			animPeriod=0;
			memory=1;
			minValue="rad -360";
			maxValue="rad +360";
			angle0="rad -360";
			angle1="rad +360";
		};				

		class Wedge
		{
			type="translation";
			source="Port1Gun";  	/////   add wedge to translate under control of Gun  as muzzle is depressed wedge moves forward, as it is elevated wedge moves negative z
			selection="Wedge";
			axis="Wedge_Axis"; 		//horizontal axis, vertex distance 1 m
			memory=1;
			animPeriod=0;
			minValue=0;
			maxValue=0.5;      //max value 0.05m above ground
			offset0=0;
			offset1=-0.5;      //animate wheels downwards for 0.05m when maxValue is reached.
		};	

	};
};	


class Gun_Field_4pdr
{	
	skeletonName = "FieldGunBaseSkeleton";
	sectionsInherit="";
	sections[] = 
	{

	"Port1Turret",
	"Port1Gun",
	"Wedge",
	"Wheel_L",
	"Wheel_R",
	"Wheels",		
	"zbytek"		
	};		

	class Animations
	{
		class Port1Turret //the horizontal moving part of the turret
			{
			type="rotationY";
			source="Port1Turret";
			selection="Port1Turret";
			axis="axisP1turret";
			animPeriod=0;
			memory=1;
			minValue="rad -360";
			maxValue="rad +360";
			angle0="rad -360";
			angle1="rad +360";
			};

		class Port1Gun //the vertical moving part of the turret
			{
			type="rotationX";
			source="Port1Gun";
			selection="Port1Gun";
			axis="axisP1gun";
			animPeriod=0;
			memory=1;
			minValue="rad -360";
			maxValue="rad +360";
			angle0="rad -360";
			angle1="rad +360";
			};


		class Wheel_L 			//the wheels moving in opposite directions as turret is rotated
		{
			type="rotationX";
			source="Port1Turret";
			selection="Wheel_L";
			axis="Wheel_L_Axis";
			animPeriod=0;
			memory=1;
			minValue="rad -360";
			maxValue="rad +360";
			angle0="rad -360";
			angle1="rad +360";
		};

		class Wheel_R 			//the wheels moving in opposite directions as turret is rotated
		{
			type="rotationX";
			source="Port1Turret";
			selection="Wheel_R";
			axis="Wheel_R_Axis";
			animPeriod=0;
			memory=1;
			minValue="rad -360";
			maxValue="rad +360";
			angle0="rad -360";
			angle1="rad +360";
		};

		class Wheels 			//the wheels rolling back together with recoil of gun
		{
			type="rotationX";
			source="recoil";
			selection="Wheels";
			axis="Wheels_Axis";
			animPeriod=0;
			memory=1;
			minValue="rad -360";
			maxValue="rad +360";
			angle0="rad -360";
			angle1="rad +360";
		};	
		class Wedge
		{
			type="translation";
			source="Port1Gun";  /////   add wedge to translate under control of Gun  as muzzle is depressed wedge moves forward, as it is elevated wedge moves negative z
			selection="Wedge";
			axis="Wedge_Axis"; //vertical axis, vertex distance 1 m
			memory=1;
			animPeriod=0;
			minValue=0;
			maxValue=0.5;      //max value 0.05m above ground
			offset0=0;
			offset1=-0.5;      //animate wheels downwards for 0.05m when maxValue is reached.
		};


	};
};


class Gun_Naval_4pdr
{	
	skeletonName = "FieldGunBaseSkeleton";
	sectionsInherit="";
	sections[] = 
	{

	"Port1Turret",
	"Port1Gun",
	"zbytek"

	};		

	class Animations
	{
		class Port1Turret //the horizontal moving part of the turret
			{
			type="rotationY";
			source="Port1Turret";
			selection="Port1Turret";
			axis="axisP1turret";
			animPeriod=0;
			memory=1;
			minValue="rad -360";
			maxValue="rad +360";
			angle0="rad -360";
			angle1="rad +360";
			};

		class Port1Gun //the vertical moving part of the turret
			{
			type="rotationX";
			source="Port1Gun";
			selection="Port1Gun";
			axis="axisP1gun";
			animPeriod=0;
			memory=1;
			minValue="rad -360";
			maxValue="rad +360";
			angle0="rad -360";
			angle1="rad +360";
			};

	};
};








class Gun_Swivel_Halfpdr
{	
	skeletonName = "FieldGunBaseSkeleton";
	sectionsInherit="";
	sections[] = 
	{

	"Port1Turret",
	"Port1Gun",
	"zbytek"

	};		

	class Animations
	{
		class Port1Turret //the horizontal moving part of the turret
			{
			type="rotationY";
			source="Port1Turret";
			selection="Port1Turret";
			axis="axisP1turret";
			animPeriod=0;
			memory=1;
			minValue="rad -360";
			maxValue="rad +360";
			angle0="rad -360";
			angle1="rad +360";
			};

		class Port1Gun //the vertical moving part of the turret
			{
			type="rotationX";
			source="Port1Gun";
			selection="Port1Gun";
			axis="axisP1gun";
			animPeriod=0;
			memory=1;
			minValue="rad -360";
			maxValue="rad +360";
			angle0="rad -360";
			angle1="rad +360";
			};

	};
};	


};




config.cpp





//////////////////////////////////////////////////////////////////////
//						BLACK POWDER 
//						ART_Weapons\Artillery
//////////////////////////////////////////////////////////////////////

class CfgPatches
{
class ART_Weapons_Artillery
{
	units[] = {};
	weapons[] = {};
	requiredVersion = 1.04;
	requiredAddons[] = {"ART_Base","ART_Weapons"};
};
};

class cfgWeapons
{
};

class CfgVehicles
{
class LandVehicle;	

class StaticWeapon: LandVehicle
{
	class Turrets;	

  		htMin = 1;
  		htMax = 480;
  		afMax = 0;
  		mfMax = 0;
  		mFact = 1;
  		tBody = 450;
   	turnCoef = 1;

};

class StaticCannon: StaticWeapon
{
	class Turrets: Turrets
	{
		class MainTurret;
	};
};


class Gun_Field_4pdr: StaticCannon
{

	class assembleInfo
	{
		primary = 0;
		base = "";
		assembleTo = "";
		dissasembleTo[] = {"Part_Barrel_4pdr","Part_Carriage_Field_4pdr"};
		displayName = "";
	};		





	scope = 2;

	side = 1;	/// 3 stands for civilians, 0 is OPFOR, 1 is BLUFOR, 2 means guerrillas
	faction = "Virginia";
	vehicleClass = "VirginiaArtillery";	

	crew = "Pvt2dVirginiaRegt_1777";
//		typicalCargo[] = {"Pvt2dVirginiaRegt_1777"};

	model="\ART\ART_Weapons\Artillery\Gun_Field_4pdr.p3d";   
	displayName="Field Gun 4 pdr";		

	picture = "\ART\ART_Weapons\Data\UI\pic_Gun_Field_4pdr_CA.paa";
	icon = "\ART\ART_Weapons\Data\UI\map_Gun_Field_4pdr_CA.paa";

	armor = 20; 

	artilleryScanner = 0;
	ARTY_IsArtyVehicle = 0;

	class Turrets: Turrets
	{
		class MainTurret: MainTurret
		{
			memoryPointsGetInGunner= "pos_gunner";
			memoryPointsGetInGunnerDir= "pos_gunner_dir";

			gunBeg = "gun_muzzle_P1";  //gunBeg = endpoint of the gun
			gunEnd = "gun_chamber_P1";	//gunEnd = chamber of the gun
//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////			
			weapons[]={Cannon_Four_pdr};
			magazines[]={30Rnd_Four_pdr_BallShot,30Rnd_Four_pdr_GrapeShot};
//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////	

			stabilizedInAxes = 0;

			body = "Port1Turret";
			gun = "Port1Gun";

			animationSourceBody = "Port1Turret";
			animationSourceGun = "Port1Gun";

			gunnerName = "The Gunner";	

//				gunnerInAction = "BMP2_Gunner";
//				gunnerAction = RHIB_Gunner;

			gunnerGetInAction = GetInMedium;
			gunnerGetOutAction = GetOutMedium;
			ejectDeadGunner = true;
			outGunnerMayFire = 1;
			inGunnerMayFire = 0;

			gunnerOpticsModel = "\a3\weapons_f\Reticle\optics_empty.p3d";
			gunnerForceOptics = 0;
			startEngine = 0;
			commanding = 2;
			primaryGunner = 1;
			primaryObserver = 1;				

//				turretInfoType = "RscUnitInfo_AH64D_gunner";

			proxyIndex = 1;
			castGunnerShadow = 0;

//				proxyType="CPGunner";

//				soundServo[]={"\ca\wheeled\Data\Sound\servo3",0.000178,0.900000};
			soundServo[]={"\a3\sounds_f\air\noises\heli_get_in",0.000178,0.900000};

			initElev=0;				
			minElev=-10;
			maxElev=+10;

			initTurn=0;
			minTurn=-350;
			maxTurn=350;			

			memoryPointGun = "gunner_P1";
			memoryPointGunnerOptics = "gunner_P1";

			showgunneroptics = 1;

//				forceHideGunner = 1;

			irScanToEyeFactor = 0.1; //1
			sensitivity=1;

			hasgunner=true;
//				hasgunner=false;			//cannot get in if false

//				gunnerCompartments = "Compartment1";
			gunnerCanSee = 31;

			class ViewOptics
			{
				initAngleX=0;
				minAngleX=-30;
				maxAngleX=+30;
				initAngleY=0;
				minAngleY=-100;
				maxAngleY=+100;
				initFov=0.7;
				minFov=0.25;
				maxFov=1.1;
			};						

			class ViewGunner
			{
     				initAngleX=5;
				minAngleX=-65;
				maxAngleX=+85; //Rg 30;
     				initAngleY=0;
				minAngleY=-150;
				maxAngleY=+150;	//Rg 0;
				initFov=0.7;
				minFov=0.25;
				maxFov=1.1;
			};
		};
	};		/// END TURRETS


class EventHandlers 
       {		
		init = "_this call compile preProcessFile ""\ART\ART_Weapons\Scripts\ART_Effects_Init.sqf"";";
		fired = "_this call ART_Effects_EH_Fired;"; // on weapon fired
		killed = "_this call ART_Effects_EH_Killed;"; 
		};	

	class HitPoints /// define the sturdiness of the ship
	{
		class HitCarriage {armor = 0.5; material = 60; name = "Carriage";		visual = "zbytek"; 	passThrough = 1; radius = 0.1;};	/// radius causes bigger damage but on a more precise hit
		class HitWheel_L 	{armor = 1; material = 50; name = "Wheel_L"; 	visual = "zbytek"; 	passThrough = 1; explosionShielding = 1;};
		class HitWheel_R 	{armor = 1; material = 50; name = "Wheel_R"; 	visual = "zbytek"; 	passThrough = 1; explosionShielding = 1;};			
		class HitBarrel {armor = 1.2;	material = 60; name = "Barrel";		visual = "zbytek"; 	passThrough = 1; radius = 0.1;};	/// radius causes bigger damage but on a more precise hit

	};	




	class Damage
	{
		tex[]={};
		mat[]=
		{
			"ART\ART_Weapons\Data\Gun_Carriage_Field_4pdr.rvmat",
			"ART\ART_Weapons\Data\Gun_Carriage_Field_4pdr_damage.rvmat",
			"ART\ART_Weapons\Data\Gun_Carriage_Field_4pdr_destruct.rvmat",				
		};
	};

};



class Gun_Naval_4pdr: StaticCannon
{

	class assembleInfo
	{
		primary = 0;
		base = "";
		assembleTo = "";
		dissasembleTo[] = {"Part_Barrel_4pdr","Part_Carriage_Naval_4pdr"};
		displayName = "";
	};		






	scope = 2;

	side = 1;	/// 3 stands for civilians, 0 is OPFOR, 1 is BLUFOR, 2 means guerrillas
	faction = "Virginia";
	vehicleClass = "VirginiaArtillery";	

	crew = "Pvt2dVirginiaRegt_1777";
//		typicalCargo[] = {"Pvt2dVirginiaRegt_1777"};

	model="\ART\ART_Weapons\Artillery\Gun_Naval_4pdr.p3d";   
	displayName="Naval Gun 4 pdr";		

	picture = "\ART\ART_Weapons\Data\UI\pic_Gun_Naval_4pdr_CA.paa";
	icon = "\ART\ART_Weapons\Data\UI\map_Gun_Naval_4pdr_CA.paa";

	armor = 20; 

	artilleryScanner = 0;
	ARTY_IsArtyVehicle = 0;

	class Turrets: Turrets
	{
		class MainTurret: MainTurret
		{
			memoryPointsGetInGunner= "pos_gunner";
			memoryPointsGetInGunnerDir= "pos_gunner_dir";

			gunBeg = "gun_muzzle_P1";  //gunBeg = endpoint of the gun
			gunEnd = "gun_chamber_P1";	//gunEnd = chamber of the gun
//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////			
			weapons[]={Cannon_Four_pdr};
			magazines[]={30Rnd_Four_pdr_BallShot,30Rnd_Four_pdr_GrapeShot};
//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////	

			stabilizedInAxes = 0;

			body = "Port1Turret";
			gun = "Port1Gun";

			animationSourceBody = "Port1Turret";
			animationSourceGun = "Port1Gun";

			gunnerName = "The Gunner";	

//				gunnerInAction = "BMP2_Gunner";
//				gunnerAction = RHIB_Gunner;

			gunnerGetInAction = GetInMedium;
			gunnerGetOutAction = GetOutMedium;
			ejectDeadGunner = true;
			outGunnerMayFire = 1;
			inGunnerMayFire = 0;

			gunnerOpticsModel = "\a3\weapons_f\Reticle\optics_empty.p3d";
			gunnerForceOptics = 0;
			startEngine = 0;
			commanding = 2;
			primaryGunner = 1;
			primaryObserver = 1;				

//				turretInfoType = "RscUnitInfo_AH64D_gunner";

			proxyIndex = 1;
			castGunnerShadow = 0;

//				proxyType="CPGunner";

//				soundServo[]={"\ca\wheeled\Data\Sound\servo3",0.000178,0.900000};
			soundServo[]={"\a3\sounds_f\air\noises\heli_get_in",0.000178,0.900000};

			initElev=0;				
			minElev=-10;
			maxElev=+10;

			initTurn=0;
			minTurn=-350;
			maxTurn=350;			

			memoryPointGun = "gunner_P1";
			memoryPointGunnerOptics = "gunner_P1";

			showgunneroptics = 1;

//				forceHideGunner = 1;

			irScanToEyeFactor = 0.1; //1
			sensitivity=1;

			hasgunner=true;
//				hasgunner=false;			//cannot get in if false

//				gunnerCompartments = "Compartment1";
			gunnerCanSee = 31;

			class ViewOptics
			{
				initAngleX=0;
				minAngleX=-30;
				maxAngleX=+30;
				initAngleY=0;
				minAngleY=-100;
				maxAngleY=+100;
				initFov=0.7;
				minFov=0.25;
				maxFov=1.1;
			};						

			class ViewGunner
			{
     				initAngleX=5;
				minAngleX=-65;
				maxAngleX=+85; //Rg 30;
     				initAngleY=0;
				minAngleY=-150;
				maxAngleY=+150;	//Rg 0;
				initFov=0.7;
				minFov=0.25;
				maxFov=1.1;
			};
		};
	};		/// END TURRETS


class EventHandlers 
       {		
		init = "_this call compile preProcessFile ""\ART\ART_Weapons\Scripts\ART_Effects_Init.sqf"";";
		fired = "_this call ART_Effects_EH_Fired;"; // on weapon fired
		killed = "_this call ART_Effects_EH_Killed;"; 
		};	


	class HitPoints /// define the sturdiness of the ship
	{
		class HitCarriage {armor = 0.5; material = 60; name = "Carriage";		visual = "zbytek"; 	passThrough = 1; radius = 0.1;};	/// radius causes bigger damage but on a more precise hit
		class HitWheel_L 	{armor = 1; material = 50; name = "Wheel_L"; 	visual = "zbytek"; 	passThrough = 1; explosionShielding = 1;};
		class HitWheel_R 	{armor = 1; material = 50; name = "Wheel_R"; 	visual = "zbytek"; 	passThrough = 1; explosionShielding = 1;};			
		class HitBarrel {armor = 1.2;	material = 60; name = "Barrel";		visual = "zbytek"; 	passThrough = 1; radius = 0.1;};	/// radius causes bigger damage but on a more precise hit

	};	



	class Damage
	{
		tex[]={};
		mat[]=
		{
			"ART\ART_Weapons\Data\Gun_Carriage_Naval_4pdr.rvmat",
			"ART\ART_Weapons\Data\Gun_Carriage_Naval_4pdr_damage.rvmat",
			"ART\ART_Weapons\Data\Gun_Carriage_Naval_4pdr_destruct.rvmat",				
		};
	};


};	


class Gun_Swivel_Halfpdr: StaticCannon
{

	class assembleInfo
	{
		primary = 0;
		base = "";
		assembleTo = "";
		dissasembleTo[] = {"Part_Barrel_Halfpdr","Part_Carriage_Swivel_Halfpdr"};
		displayName = "";
	};		


	scope = 2;

	side = 1;	/// 3 stands for civilians, 0 is OPFOR, 1 is BLUFOR, 2 means guerrillas
	faction = "Virginia";
	vehicleClass = "VirginiaArtillery";	

	crew = "Pvt2dVirginiaRegt_1777";
//		typicalCargo[] = {"Pvt2dVirginiaRegt_1777"};

	model="\ART\ART_Weapons\Artillery\Gun_Swivel_Halfpdr.p3d";   
	displayName="Half pound Swivel aha Gun";		

	picture = "\ART\ART_Weapons\Data\UI\pic_Gun_Swivel_Halfpdr_CA.paa";
	icon = "\ART\ART_Weapons\Data\UI\map_Gun_Swivel_Halfpdr_CA.paa";

	armor = 20; 

	artilleryScanner = 0;
	ARTY_IsArtyVehicle = 0;

	class Turrets: Turrets
	{
		class MainTurret: MainTurret
		{
			memoryPointsGetInGunner= "pos_gunner";
			memoryPointsGetInGunnerDir= "pos_gunner_dir";

			gunBeg = "gun_muzzle_P1";  //gunBeg = endpoint of the gun
			gunEnd = "gun_chamber_P1";	//gunEnd = chamber of the gun
//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////			
			weapons[]={Cannon_Half_pdr};
			magazines[]={30Rnd_Half_pdr_BallShot,30Rnd_Half_pdr_GrapeShot};
//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////	

			stabilizedInAxes = 0;

			body = "Port1Turret";
			gun = "Port1Gun";

			animationSourceBody = "Port1Turret";
			animationSourceGun = "Port1Gun";

			gunnerName = "The Gunner";	

//				gunnerInAction = "BMP2_Gunner";
//				gunnerAction = RHIB_Gunner;

			gunnerGetInAction = GetInMedium;
			gunnerGetOutAction = GetOutMedium;
			ejectDeadGunner = true;
			outGunnerMayFire = 1;
			inGunnerMayFire = 0;

			gunnerOpticsModel = "\a3\weapons_f\Reticle\optics_empty.p3d";
			gunnerForceOptics = 0;
			startEngine = 0;
			commanding = 2;
			primaryGunner = 1;
			primaryObserver = 1;				

//				turretInfoType = "RscUnitInfo_AH64D_gunner";

			proxyIndex = 1;
			castGunnerShadow = 0;

//				proxyType="CPGunner";

//				soundServo[]={"\ca\wheeled\Data\Sound\servo3",0.000178,0.900000};
			soundServo[]={"\a3\sounds_f\air\noises\heli_get_in",0.000178,0.900000};

			initElev=0;				
			minElev=-10;
			maxElev=+10;

			initTurn=0;
			minTurn=-350;
			maxTurn=350;			

			memoryPointGun = "gunner_P1";
			memoryPointGunnerOptics = "gunner_P1";

			showgunneroptics = 1;

//				forceHideGunner = 1;

			irScanToEyeFactor = 0.1; //1
			sensitivity=1;

			hasgunner=true;
//				hasgunner=false;			//cannot get in if false

//				gunnerCompartments = "Compartment1";
			gunnerCanSee = 31;

			class ViewOptics
			{
				initAngleX=0;
				minAngleX=-30;
				maxAngleX=+30;
				initAngleY=0;
				minAngleY=-100;
				maxAngleY=+100;
				initFov=0.7;
				minFov=0.25;
				maxFov=1.1;
			};						

			class ViewGunner
			{
     				initAngleX=5;
				minAngleX=-65;
				maxAngleX=+85; //Rg 30;
     				initAngleY=0;
				minAngleY=-150;
				maxAngleY=+150;	//Rg 0;
				initFov=0.7;
				minFov=0.25;
				maxFov=1.1;
			};
		};
	};		/// END TURRETS


class EventHandlers 
       {		
		init = "_this call compile preProcessFile ""\ART\ART_Weapons\Scripts\ART_Effects_Init.sqf"";";
		fired = "_this call ART_Effects_EH_Fired;"; // on weapon fired
		killed = "_this call ART_Effects_EH_Killed;"; 
		};	

	class Damage
	{
		tex[]={};
		mat[]=
		{
			"ART\ART_Weapons\Data\Gun_Carriage_Swivel.rvmat",
			"ART\ART_Weapons\Data\Gun_Carriage_Swivel_damage.rvmat",
			"ART\ART_Weapons\Data\Gun_Carriage_Swivel_destruct.rvmat",				
		};
	};

};




////////////////////////////////////////////////////////////////////

///assembly parts

class Bag_Base;
class Weapon_Bag_Base: Bag_Base
{
	class assembleInfo{};
};


class Part_Barrel_4pdr: Bag_Base
{
	author = "GBS";
	_generalMacro = "Part_Barrel_4pdr";
///		faction = "Virginia";
	scope = 2;
	vehicleClass = "1776_Fortification";


	displayName = "Part_Barrel_4pdr";
	model = "\ART\ART_Weapons\Artillery\Part_Barrel_4pdr.p3d";

	hiddenSelectionsTextures[] = {"\A3\Weapons_F\Ammoboxes\Bags\data\backpack_small_mcamo_co.paa"};
	picture = "\ART\ART_Weapons\Data\UI\pic_Part_Barrel_4pdr_CA.paa";

	icon = "iconBackpack";

	mass = 180;
	maximumLoad = 0;

	class assembleInfo
	{
		primary = 0;
		base = "";
		assembleTo = "";
		dissasembleTo[] = {};
		displayName = "";
	};
};		

class Part_Barrel_Halfpdr: Bag_Base
{
	author = "GBS";
	_generalMacro = "Part_Barrel_Halfpdr";
///		faction = "Virginia";
	scope = 2;
	vehicleClass = "1776_Fortification";

	displayName = "Part_Barrel_Halfpdr";
	model = "\ART\ART_Weapons\Artillery\Part_Barrel_Halfpdr.p3d";

	hiddenSelectionsTextures[] = {"\A3\Weapons_F\Ammoboxes\Bags\data\backpack_small_mcamo_co.paa"};
	picture = "\ART\ART_Weapons\Data\UI\pic_Part_Barrel_Halfpdr_CA.paa";

	icon = "iconBackpack";

	mass = 180;
	maximumLoad = 0;

	class assembleInfo
	{
		primary = 0;
		base = "";
		assembleTo = "";
		dissasembleTo[] = {};
		displayName = "";
	};
};	

////////////////////////////////////////////

class Part_Carriage_Field_4pdr: Weapon_Bag_Base
{
///		faction = "Virginia";
	author = "GBS";
	_generalMacro = "Part_Carriage_Field_4pdr";
	scope = 2;
	vehicleClass = "1776_Fortification";

	displayName = "Part_Carriage_Field_4pdr";
	hiddenSelectionsTextures[] = {"\A3\Weapons_F\Ammoboxes\Bags\Data\backpack_small_mcamo_co.paa"};

	model = "\ART\ART_Weapons\Artillery\Part_Carriage_Field_4pdr.p3d";

	picture = "\ART\ART_Weapons\Data\UI\pic_Part_Carriage_Field_4pdr_CA.paa";
	Icon	 = "\ART\ART_Tent\Data\UI\map_Tent_Pole_CA.paa"; /// icon in map
	mapSize = 1.9;	/// Scale of icon in editor

	mass = 380;

	class assembleInfo: assembleInfo
	{
		displayName = "Part_Carriage_Field_4pdr assemble Info ";
		assembleTo = "Gun_Field_4pdr";
		base[] = {"Part_Barrel_4pdr"};
	};
};

class Part_Carriage_Naval_4pdr: Weapon_Bag_Base
{
///		faction = "Virginia";
	author = "GBS";
	_generalMacro = "Part_Carriage_Naval_4pdr";
	scope = 2;
	vehicleClass = "1776_Fortification";

	displayName = "Part_Carriage_Naval_4pdr";
	hiddenSelectionsTextures[] = {"\A3\Weapons_F\Ammoboxes\Bags\Data\backpack_small_mcamo_co.paa"};

	model = "\ART\ART_Weapons\Artillery\Part_Carriage_Naval_4pdr.p3d";

	picture = "\ART\ART_Weapons\Data\UI\pic_Part_Carriage_Naval_4pdr_CA.paa";
	Icon	 = "\ART\ART_Tent\Data\UI\map_Tent_Pole_CA.paa"; /// icon in map
	mapSize = 1.9;	/// Scale of icon in editor

	mass = 380;

	class assembleInfo: assembleInfo
	{
		displayName = "Part_Carriage_Naval_4pdr assemble Info ";
		assembleTo = "Gun_Naval_4pdr";
		base[] = {"Part_Barrel_4pdr"};
	};
};


class Part_Carriage_Swivel_Halfpdr: Weapon_Bag_Base
{
///		faction = "Virginia";
	author = "GBS";
	_generalMacro = "Part_Carriage_Swivel_Halfpdr";
	scope = 2;
	vehicleClass = "1776_Fortification";

	displayName = "Part_Carriage_Swivel_Halfpdr";

	model = "\ART\ART_Weapons\Artillery\Part_Carriage_Swivel_Halfpdr.p3d";

	picture = "\ART\ART_Weapons\Data\UI\pic_Part_Carriage_Swivel_Halfpdr_CA.paa";
	Icon	 = "\ART\ART_Tent\Data\UI\map_Tent_Pole_CA.paa"; /// icon in map
	mapSize = 1.9;	/// Scale of icon in editor

	hiddenSelectionsTextures[] = {"\A3\Weapons_F\Ammoboxes\Bags\Data\backpack_small_mcamo_co.paa"};

	mass = 380;

	class assembleInfo: assembleInfo
	{
		displayName = "Part_Carriage_Swivel_Halfpdr assemble Info ";
		assembleTo = "Gun_Swivel_Halfpdr";
		base[] = {"Part_Barrel_Halfpdr"};
	};
};


};



Share this post


Link to post
Share on other sites

       "Port1Turret", "", 
       "Port1Gun","Port1Turret",        
       "Wheel_R", "Port1Turret",    
       "Wheel_L", "Port1Turret"

Your bone list is all screwy. To many extra "". You should get in that habit of listing the bones how it have done it here. So it's easy to see child and parent bones.

Share this post


Link to post
Share on other sites

I thought the "", made a break in a list, like a comma in a sentence. I know I must seem dull-witted about this but is there any really basic level tutorial on how to do this?

Share this post


Link to post
Share on other sites

No. It's defined as

"Childbone","parentbone"

So in this particulate setup whenever parentbone is animated childbone is as well

If there's only one bone in ur config or ones that are not linked it's defined like this.

"Bone",""

Multiples like this.

"Bone","",
"Bone2,"",
"Bone3,"Bone"

Notice the last defined bones don't get a comma at the end.

Edited by M1lkm8n

Share this post


Link to post
Share on other sites

Okay, but doesn't the "" delineate where the break is after the parent and the start of the next set? I just tried the setup you listed and it isn't broken but still only the left wheel turns.

---------- Post added at 12:37 ---------- Previous post was at 12:31 ----------

Do I understand this correctly?

"Bone","",        // an independent bone or section of model since it has the "" after it
"Bone2,"",        // also an independent bone or section of model
"Bone3,"Bone"   // bone3 is attached to Bone and moves (according to whatever is defined in its Animation Class whenever Bone moves

---------- Post added at 12:44 ---------- Previous post was at 12:37 ----------

When you say "If there's only one bone in ur config or ones that are not linked it's defined like this" does "linked" mean that the parent bone activates the animation of the child bone, OR that the child bone is welded to the parent bone? In the skeleton setup list are we just defining physical attachments or are we also defining animation triggers?

Share this post


Link to post
Share on other sites

Yes my mistake.

This...(that the child bone is welded to the parent bone)

It will move wherever the parent goes. To actually animate the bone when the parent bone animates you would make the source= line in the class equal the parent bone class like you have done in your model config.

Share this post


Link to post
Share on other sites

So if my wheels aren't turning it has nothing to do with that list in the skeleton, that means there's a problem in the Animation Classes?! The skeleton list only makes sure that the parts stick together?

Share this post


Link to post
Share on other sites

Can u post a picture or something of your model. It's hard to tell as maybe I am drawing a different picture in my heard and what u are actually wanting to happen

Share this post


Link to post
Share on other sites

Here's a sketch of the Wedge animation: As the barrel (Port1Gun) is raised or lowered, the wedge moves forward or back.

<a href="http://imgur.com/Zm9hiES"><img src="http://i.imgur.com/Zm9hiES.jpg" title="Sketch_Wedge"/></a>

---------- Post added at 15:21 ---------- Previous post was at 15:20 ----------

What do I have to do to post an image here?  When I click the icon for it nothing happens, just a blank page.

---------- Post added at 15:33 ---------- Previous post was at 15:21 ----------

Wedge:

http://i.imgur.com/Zm9hiES.jpg

Recoil: when the gun fires, it should translate backward a couple of feet. At the same time both Wheels rotate along with it (as if it is rolling backward from the force).

http://i.imgur.com/nplzJB6.jpg

---------- Post added at 15:48 ---------- Previous post was at 15:33 ----------

Pivot: Pivot -- As the carriage (Port1turret) is rotated and pivots on its axis, each wheel should roll in opposite directions (as in a tank)

http://i.imgur.com/F8V3Vb5.jpg

Share this post


Link to post
Share on other sites

try this

////////////////////////////////////////////////////////////////////// 
//                        BLACK POWDER  
//                        ART_Weapons\FieldGun3pdr 
////////////////////////////////////////////////////////////////////// 

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////     
//              BEGIN GUN BASE 
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////     
class CfgSkeletons  
{  
   class Default 
   { 
       isDiscrete = 1; 
       skeletonInherit = ""; 
       skeletonBones[] = {}; 
   }; 

   class FieldGunBaseSkeleton: Default 
   { 
       isDiscrete=1; 
       skeletonInherit = ""; 

       skeletonBones[]= 
       {      
       "Port1Turret","", 
       "Port1Gun","Port1Turret",       
       "Wheel_L","Port1Turret",             
       "Wheel_R","Port1Turret",
	"Wedge","Port1Turret"
	}; 
};
}; 



class CfgModels 
{ 
   class Default; 
   class StaticWeapon:Default 
   { 
       class Animations; 
   }; 

   class Cannon: StaticWeapon 
   { 
       class Animations: Animations 
       { 
           class recoil_BEGIN; 
           class recoil_END; 
       }; 
   }; 

   class 18thC_Cannon: Cannon 
   { 
       class Animations: Animations 
       { 
           class recoil_BEGIN; 
           class recoil_END; 
       }; 
   };     

   class FieldGun: 18thC_Cannon 
   { 
       skeletonName = "FieldGunBaseSkeleton"; 

       sectionsInherit=""; 
       sections[] =  
       {     
       "Port1Turret", 
       "Port1Gun", 
       "Wedge", 
       "Wheel_L", 
       "Wheel_R", 
       "Wheels",         
       "zbytek" 

       };         

       class Animations: Animations 
       { 
           class recoil_BEGIN:recoil_BEGIN 
           { 
               offset1=-0.3; 
//                offset1=-0.5; 
           }; 

           class recoil_END:recoil_END 
           { 

//                offset0=5.3;    ///  gbs added to test  there are more offsets in main weapons config 
               offset1=0.3;                 

           }; 

           class Port1Turret         //the horizontal moving part of the turret 
           { 
               type="rotationY"; 
               source="Port1Turret"; 
               selection="Port1Turret"; 
               axis="axisP1turret"; 
               memory=1; 
               minValue="rad -360"; 
               maxValue="rad +360"; 
               angle0="rad -360"; 
               angle1="rad +360"; 
           }; 

           class Port1Gun             //the vertical moving part of the turret 
           { 
               type="rotationX"; 
               source="Port1Gun"; 
               selection="Port1Gun"; 
               axis="axisP1gun"; 
               memory=1; 
               minValue="rad -360"; 
               maxValue="rad +360"; 
               angle0="rad -360"; 
               angle1="rad +360"; 
           };         

           class Wheel_L            //the wheels moving in opposite directions as turret is rotated 
           { 
               type="rotationX"; 
               source="Port1Turret"; 
               selection="Wheel_L"; 
               axis="Wheel_L_Axis"; 
               memory=1; 
               minValue="rad -360"; 
               maxValue="rad +360"; 
               angle0="rad -360"; 
               angle1="rad +360"; 
           }; 

           class Wheel_R            //the wheels moving in opposite directions as turret is rotated 
           { 
               type="rotationX"; 
               source="Port1Turret"; 
               selection="Wheel_R"; 
               axis="Wheel_R_Axis";  
               memory=1;
               minValue="rad -360"; 
               maxValue="rad +360"; 
               angle0="rad +360"; 
               angle1="rad -360"; 
           }; 


           class Wheels             //the wheels rolling back together with recoil of gun 
           { 
               type="rotationX"; 
               source="recoil"; 
               selection="Wheels"; 
               axis="Wheels_Axis"; 
               animPeriod=0; 
               memory=1; 
               minValue="rad -360"; 
               maxValue="rad +360"; 
               angle0="rad -360"; 
               angle1="rad +360"; 
           };                 

           class Wedge 
           { 
               type="translation"; 
               source="Port1Gun";      /////   add wedge to translate under control of Gun  as muzzle is depressed wedge moves forward, as it is elevated wedge moves negative z 
               selection="Wedge"; 
               axis="Wedge_Axis";         //horizontal axis, vertex distance 1 m 
               memory=1; 
               animPeriod=0; 
               minValue=0; 
               maxValue=0.5;      //max value 0.05m above ground 
               offset0=0; 
               offset1=-0.5;      //animate wheels downwards for 0.05m when maxValue is reached. 
           };     

       }; 
   };     


   class Gun_Field_4pdr 
   {     
       skeletonName = "FieldGunBaseSkeleton"; 
       sectionsInherit=""; 
       sections[] =  
       { 

       "Port1Turret", 
       "Port1Gun", 
       "Wedge", 
       "Wheel_L", 
       "Wheel_R", 
       "Wheels",         
       "zbytek"         
       };         

       class Animations 
       { 
           class Port1Turret //the horizontal moving part of the turret 
               { 
               type="rotationY"; 
               source="Port1Turret"; 
               selection="Port1Turret"; 
               axis="axisP1turret"; 
               animPeriod=0; 
               memory=1; 
               minValue="rad -360"; 
               maxValue="rad +360"; 
               angle0="rad -360"; 
               angle1="rad +360"; 
               }; 

           class Port1Gun //the vertical moving part of the turret 
               { 
               type="rotationX"; 
               source="Port1Gun"; 
               selection="Port1Gun"; 
               axis="axisP1gun"; 
               animPeriod=0; 
               memory=1; 
               minValue="rad -360"; 
               maxValue="rad +360"; 
               angle0="rad -360"; 
               angle1="rad +360"; 
               }; 


           class Wheel_L             //the wheels moving in opposite directions as turret is rotated 
           { 
               type="rotationX"; 
               source="Port1Turret"; 
               selection="Wheel_L"; 
               axis="Wheel_L_Axis"; 
               animPeriod=0; 
               memory=1; 
               minValue="rad -360"; 
               maxValue="rad +360"; 
               angle0="rad -360"; 
               angle1="rad +360"; 
           }; 

           class Wheel_R             //the wheels moving in opposite directions as turret is rotated 
           { 
               type="rotationX"; 
               source="Port1Turret"; 
               selection="Wheel_R"; 
               axis="Wheel_R_Axis"; 
               animPeriod=0; 
               memory=1; 
               minValue="rad -360"; 
               maxValue="rad +360"; 
               angle0="rad -360"; 
               angle1="rad +360"; 
           }; 

           class Wheels             //the wheels rolling back together with recoil of gun 
           { 
               type="rotationX"; 
               source="recoil"; 
               selection="Wheels"; 
               axis="Wheels_Axis"; 
               animPeriod=0; 
               memory=1; 
               minValue="rad -360"; 
               maxValue="rad +360"; 
               angle0="rad -360"; 
               angle1="rad +360"; 
           };     
           class Wedge 
           { 
               type="translation"; 
               source="Port1Gun";  /////   add wedge to translate under control of Gun  as muzzle is depressed wedge moves forward, as it is elevated wedge moves negative z 
               selection="Wedge"; 
               axis="Wedge_Axis"; //vertical axis, vertex distance 1 m 
               memory=1; 
               animPeriod=0; 
               minValue=0; 
               maxValue=0.5;      //max value 0.05m above ground 
               offset0=0; 
               offset1=-0.5;      //animate wheels downwards for 0.05m when maxValue is reached. 
           }; 


       }; 
   }; 


   class Gun_Naval_4pdr 
   {     
       skeletonName = "FieldGunBaseSkeleton"; 
       sectionsInherit=""; 
       sections[] =  
       { 

       "Port1Turret", 
       "Port1Gun", 
       "zbytek" 

       };         

       class Animations 
       { 
           class Port1Turret //the horizontal moving part of the turret 
               { 
               type="rotationY"; 
               source="Port1Turret"; 
               selection="Port1Turret"; 
               axis="axisP1turret"; 
               animPeriod=0; 
               memory=1; 
               minValue="rad -360"; 
               maxValue="rad +360"; 
               angle0="rad -360"; 
               angle1="rad +360"; 
               }; 

           class Port1Gun //the vertical moving part of the turret 
               { 
               type="rotationX"; 
               source="Port1Gun"; 
               selection="Port1Gun"; 
               axis="axisP1gun"; 
               animPeriod=0; 
               memory=1; 
               minValue="rad -360"; 
               maxValue="rad +360"; 
               angle0="rad -360"; 
               angle1="rad +360"; 
               }; 

       }; 
   }; 








   class Gun_Swivel_Halfpdr 
   {     
       skeletonName = "FieldGunBaseSkeleton"; 
       sectionsInherit=""; 
       sections[] =  
       { 

       "Port1Turret", 
       "Port1Gun", 
       "zbytek" 

       };         

       class Animations 
       { 
           class Port1Turret //the horizontal moving part of the turret 
               { 
               type="rotationY"; 
               source="Port1Turret"; 
               selection="Port1Turret"; 
               axis="axisP1turret"; 
               animPeriod=0; 
               memory=1; 
               minValue="rad -360"; 
               maxValue="rad +360"; 
               angle0="rad -360"; 
               angle1="rad +360"; 
               }; 

           class Port1Gun //the vertical moving part of the turret 
               { 
               type="rotationX"; 
               source="Port1Gun"; 
               selection="Port1Gun"; 
               axis="axisP1gun"; 
               animPeriod=0; 
               memory=1; 
               minValue="rad -360"; 
               maxValue="rad +360"; 
               angle0="rad -360"; 
               angle1="rad +360"; 
               }; 

       }; 
   };     


};  

Share this post


Link to post
Share on other sites

Thanks! The wedge works. Also both wheels turn (going to try now to get them going in opposite directions when pivoting; I think that's just a matter of reversing the angles on Wheel_R). The wheels don't move on recoil but that might be the recoil itself. I'll let you know what happens in a few minutes.

---------- Post added at 01:21 ---------- Previous post was at 01:20 ----------

Could you tell me what you did here to fix this?

Share this post


Link to post
Share on other sites

Still no luck getting the wheels to go in opposite directions when the cannon pivots.

Share this post


Link to post
Share on other sites

Finally solved the pivot question so now the wheels rotate in different directions when the carriage is turned. The wedge still works when gun barrel is elevated or depressed, so now I'm working to fix the recoil. A side question is now how to make it so the cannon can be pivoted or the barrel raised or lowered but not at the same time.

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  

×