Jump to content

Recommended Posts

I've decided to try and make a really basic turret like object for arma. Well, its actually a crane but nevermind about that bit for now.

 

I'm having trouble with the config.cpp and not knowing quite what to put into it. I figured the "turret" class wouldn't work with the ThingX class as it needs a "gunner" so I decided to use "AllVehicles", however, the object doesn't show up in the editor. I've also tried inheriting from the GMG but whilst I could fire the gun straight ahead (not intended but I knew I would inherit that), I couldn't get my "CraneArm" section to turn around the top of the base post.

 

I've had a look here:

https://community.bistudio.com/wiki/Turret_Config_Reference

and on the ships config guidelines, as well as the GMG through the config viewer in the editor.

 

Heres my config.cpp:

class CfgPatches {
	class dock_crane {
		units[] = {"dock_crane"};
		weapons[] = {};
		requiredVersion = 0.1;
		requiredAddons[] = {};
	};
};

class CfgDestructPos{

};

class CfgVehicles {
 	class AllVehicles //AllVehicles eg
 	{
 		class NewTurret;   // derive from your base base base class
		class Animations;
 	};

	class dock_crane: AllVehicles
	{

		scope = 2;
		model = "\Dan_Dock_Crane\Dock_Crane.p3d";
		displayName = "Black Barrel w/White Stripe";
		editorSubcategory = "EdSubcat_Turrets"; 
		destrType = "DestructDefault";
		armor = 30;
		//editorPreview = "\Dan_Oil_Barrel\Previews\dan_black_barrel.paa";
		fireResistance = 0.1;
		explosionShielding = 0.1;
		damageResistance = 0.004;
		class Damage
		{
			tex[] = {};
			mat[] = {};
		};
		class MainTurret : NewTurret
		{
			body = "MainTurret";
			maxTurn = 360;
			maxHorizontalRotSpeed = 2;
			turretAxis = "Base";
			class ViewGunner
			{
   				initAngleX = 5;
   				minAngleX = -85;
   				maxAngleX = 85;
   				initAngleY = 0;
   				minAngleY = -150;
   				maxAngleY = 150;
   				initFov = 0.7;
   				minFov = 0.42;  // FOV of 0.4 is considered as 1x magnification by RSC displays
   				maxFov = 0.85;
			};
  			class ViewOptics
  			{
   				initAngleX = 0;
   				minAngleX = -30;
   				maxAngleX = 30;
   				initAngleY = 0;
   				minAngleY = -100;
   				maxAngleY = 100;
   				initFov = 0.3;    // baseline FOV 0.4 / optic FOV 0.3 = x1.33 magnification
   				minFov = 0.07; // baseline FOV 0.4 / optic FOV 0.07 = x5.7 magnification
   				maxFov = 0.35;  // baseline FOV 0.4 / optic FOV 0.35 = x1.14 magnification
  			};
		};
		class Animations:Animations
		{
			class MainTurret
			{
    				type="rotationY";
   				source="mainTurret";//The controller that provides input above
    				selection="CraneArm";//The name of the skeleton bone used.
    				axis="Base";//name of the axis in the model.
			};
		};
		damageHalf[] = {};
		damageFull[] = {};
	};
};

and model.cfg:

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

class CfgModels {
	class dock_crane {
		skeletonName = "dock_crane_skeleton";
		sections[] = {"Base", "CraneArm"};
	};
};

Heres the project folder if anyone wants to have a look:

https://www.dropbox.com/s/3y5db8hqfrd9i0u/Dan_Dock_Crane.zip?dl=0

 

I'm just looking to see how to get this working and I am looking for some more pointers as where to take this config next in order to get something that works and so the top beam can move around 360 degrees about the top of the "base". This code builds the addon as it is and loads into the editor, but the object does not show up as it is.

 

Thanks for any help in advance.

Share this post


Link to post
Share on other sites

I've been having a play around with the config and have removed pretty much everything in it. I can't even get a getinaction to work so ill have to revisit it again once my home internet is working again. I think I've must have done something critically wrong.

 

Does anyone have any advice or tutorials they would recommend looking at as I can't seem to figure it out from the samples or looking at the config browser.

 

Heres my code with the actions removed:

class CfgPatches {
	class dock_crane {
		units[] = {"dock_crane"};
		weapons[] = {};
		requiredVersion = 0.1;
		requiredAddons[] = {};
	};
};

class CfgDestructPos{

};

class CfgVehicles {
	class StaticWeapon;
	class dock_crane: StaticWeapon
	{

		scope = 2;
		model = "\Dan_Dock_Crane\Dock_Crane.p3d";
		displayName = "Black Barrel w/White Stripe";
		editorSubcategory = "EdSubcat_Turrets"; 
		destrType = "DestructDefault";
		armor = 30;
		//editorPreview = "\Dan_Oil_Barrel\Previews\dan_black_barrel.paa";
		fireResistance = 0.1;
		explosionShielding = 0.1;
		damageResistance = 0.004;
		side = 3;	// 3 stands for civilians, 0 is OPFOR, 1 is BLUFOR, 2 means guerrillas
		faction	= CIV_F;
		crew = "C_man_1";
		//need to add something to get in get out of the static. But what?
		memoryPointsGetInGunner = "pos gunner";
		gunnerInAction = "ManActTestDriver";
		gunnerGetInAction = "";
		gunnerGetOutAction = "";

		class Damage
		{
			tex[] = {};
			mat[] = {};
		};
		//class Turrets {}; 

		damageHalf[] = {};
		damageFull[] = {};
	};
};

There is a memory point named pos gunner in my model. Here is the zip of it if anyone wants to look:

 

https://www.dropbox.com/s/3y5db8hqfrd9i0u/Dan_Dock_Crane.zip?dl=0

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

×