Jump to content
Sign in to follow this  
hiddengearz

Adding a moveable turret

Recommended Posts

Iv'e been playing around with the config of this two seater f18 addon and the gunners optics are static and can't be moved and I've tried everything that i know of in the config to get that optic to become move able and it just wont move. Would the model have to be edited or is it a script/config issue?

P.S Originally the gunner's optics where not moveable.

Share this post


Link to post
Share on other sites

Experience has shown me that turrets can not start working for MANY reasons, unforunately.

I'll provide details of a working 2 seater aircraft I've already provided to the community (B52). Use as a guide if you like.

Config.cpp

....
....
....
class CfgVehicles
{
class Plane;
class Su34 : Plane {
	class viewpilot;
	class viewgunner;
	class Turrets;
	class NewTurret;
	class AnimationSources;
};
class GNTB52: Su34
{
....
....
....
class Turrets
   {
     class MainTurret : NewTurret
     {
       minElev = -90;
       maxElev = 38.2;
       initElev = -45;
       minTurn = -180;
       maxTurn = 180;
       initTurn = 0;
       maxHorizontalRotSpeed = 1.2;
       maxVerticalRotSpeed = 1.2;
       stabilizedInAxes = "StabilizedInAxesBoth";
       startEngine = 0;
       body = "mainturret";
       gun = "maingun";
       animationSourceBody = "mainturret";
       animationSourceGun = "maingun";
weapons[]={"GLT_MK82_Launcher_B52"};
magazines[]={"GLT_51Rnd_MK82"};
       class Viewoptics
       {
				minAngleX = -360;
				maxAngleX = 360;
				initAngleX = 0;
				minAngleY = -360;
				maxAngleY = 360;
				initAngleY = 0;
				initFov = 0.7;
				minFov = 0.3;
				maxFov = 1.2;
       };
       soundServo[] = {"",0.01,1};
       outGunnerMayFire = 1;
commanding = -1;
       gunBeg = "S_start";
       gunEnd = "S_end";
       memoryPointGunnerOptics = "gunner1";
       selectionFireAnim = "";
       castGunnerShadow = 0;
       viewGunnerShadow = 0;
       gunnerOpticsModel = "\ca\air\optika_AH1Z";
       gunnerForceOptics = 0;
     };
   };

Model.cfg

class CfgSkeletons 
{ 
  class Plane;
  class GNTB52Bones: Plane
{
	isDiscrete=1;
	skeletonInherit = "";
	skeletonBones[]=
	{
		"mainturret","",
		"maingun","mainturret",
....
....
....
class cfgModels
{
class Plane;
class GNTB52_1: Plane
{
	skeletonName = "GNTB52Bones";
	sectionsInherit="";
	sections[]=
	{
		"mainturret","maingun",
....
....
....
	};
	class Animations
	{
		class mainturret //the horizontal moving part of the turret
			{
			type="rotationY";
			source="mainturret";
			selection="mainturret";
			axis="axis1turret";
			animPeriod=0;
			memory=1;
			minValue="rad -360";
			maxValue="rad +360";
			angle0="rad -360";
			angle1="rad +360";
			};

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

Make sure all turret model faces, including Memory LOD points that need to move also have the naming of "maingun" and "mainturret".

With a 2 seater like an F18, likely ONLY Memory LOD points will be defined like this (like the view point "gunner1" ) as nothing of the model visually moves during rotation.

EDIT

If the model is not yours, your out of luck.

If you are playing with someone elses addon without permission then at most it should ONLY be for educational purposes, and never for distribution.

Otherwise is against most addon maker and community rules.

Edited by [APS]Gnat

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  

×