Jump to content
Sign in to follow this  
DZGuymed

Working with Turrets?

Recommended Posts

Hi everyone.

I'm back with more config troubles. Today I decided I wanted to make a custom Su-34 loadout using the awesome missiles included in the GLT Missilebox, but since most of my config work relies on inheritance, I can't figure out how to make a turret config my anti-ship Su-34. (Turret as in the gunner seat of the plane, where the weapons technically are located.) I tried working off of the Su-34s original turret config, but I had no idea what to do with it.

Here is my base config for the vehicle:

             
            class Su34;
            class DZG_GUAF_Su34_AS: Su34 {
                         displayName = "(GUAF-AF) Su-34 (Anti-Ship)";
                         weapons[] = {CMFlareLauncher};
                         magazines[] = {120Rnd_CMFlare_Chaff_Magazine};
                         vehicleClass = "DZG_AirVehicleClass";
                         faction = "GUAF";
                         crew = "DZG_GUAF_Pilot";
                         side = 1;

I'm basically asking if anyone could guide me in making a turret config that would work exclusively on this custom vehicle.

Share this post


Link to post
Share on other sites

This is from the Missilebox config which also includes inherited BIS planes:

class GLT_Su34_Laser : Su34 {
	weapons[] = {"CMFlareLauncher"};
	magazines[] = {"120Rnd_CMFlare_Chaff_Magazine"};
	class Turrets {
		class MainTurret : NewTurret {
			weapons[] = {"GSh301", "GLT_Ch29LauncherLaser", "GLT_Ch29Launcher_IR", "R73Launcher", "80mmLauncher"};
			magazines[] = {"180Rnd_30mm_GSh301", "GLT_4Rnd_Ch29LBIS", "GLT_2Rnd_Ch29TBIS", "4Rnd_R73", "40Rnd_S8T"};
		};
	};
};

Hope this helps.

Share this post


Link to post
Share on other sites

Su34 has

	class Su34: Plane
{
	class Turrets
	{
		class MainTurret: NewTurret
		{

So a fully correct inheritance would be:

	class MySu34: Su34
{
	class Turrets: Turrets
	{
		class MainTurret: MainTurret
		{

Share this post


Link to post
Share on other sites

Thanks for the help guys, but when I compile in BinPBO, it fails and my log file gives me this:

line 344: /CfgVehicles/DZG_GUAF_Su34_AS.Turrets: Undefined base class 'Turrets'

Here's what I've come up with in my Su-34 config.

             class Su34;
            class DZG_GUAF_Su34_AS: Su34 {
                         displayName = "(GUAF-AF) Su-34 (Anti-Ship)";
                         weapons[] = {CMFlareLauncher};
                         magazines[] = {120Rnd_CMFlare_Chaff_Magazine};
                         vehicleClass = "DZG_AirVehicleClass";
                         faction = "GUAF";
                         crew = "DZG_GUAF_Pilot";
                         side = 1;
                         class Turrets: Turrets {
                                    class MainTurret: MainTurret
                                    weapons[] = {"GSh301", "80mmLauncher", "GLT_AS4_Launcher", "GLT_CH59_Launcher", "GLT_R77_Launcher", "GLT_R73_Launcher"};
                                    magazines[] = {"180Rnd_30mm_GSh301", "40Rnd_S8T", "GLT_2Rnd_AS4", "GLT_4Rnd_CH59", "GLT_2Rnd_R77", "GLT_2Rnd_R73"};
          		};
                         class UserActions {
		class defaultAction {
		priority = 0;
		shortcut = "";
		displayNameDefault = "";
		position = "";
		radius =2;
		onlyforplayer = 1;
		displayName = "GPS/INS System";
		condition = "(isengineon this) && (player == (driver this))";
		statement = "createDialog 'glt_airgpsmfd'";
                        };
            };

Share this post


Link to post
Share on other sites

You need to define all classes you inherit from.

Use this (hack/trick):

class Turrets;
class MainTurret;
class cfgVehicles
{
class Su34;
class DZG_GUAF_Su34_AS: Su34
{

Share this post


Link to post
Share on other sites
You need to define all classes you inherit from.

Use this (hack/trick):

class Turrets;
class MainTurret;
class cfgVehicles
{
class Su34;
class DZG_GUAF_Su34_AS: Su34
{

Thanks. I've managed to get the addon to compile, but when I select the aircraft in the editor and try to use it, I receive multiple turret related errors, such as GunSmoke, PrimaryGunner and FireAnim. I don't have any idea what to do next, so I'll just put the partially fixed config here. Thanks for the help so far.

             class Su34;
            class DZG_GUAF_Su34_AS: Su34 {
                         displayName = "(GUAF-AF) Su-34 (Anti-Ship)";
                         weapons[] = {CMFlareLauncher};
                         magazines[] = {120Rnd_CMFlare_Chaff_Magazine};
                         class Turrets: Turrets {
                                  class MainTurret: MainTurret {
                                    weapons[] = {"GSh301", "80mmLauncher", "GLT_AS4_Launcher", "GLT_CH59_Launcher", "GLT_R77_Launcher", "GLT_R73_Launcher"};
                                    magazines[] = {"180Rnd_30mm_GSh301", "40Rnd_S8T", "GLT_2Rnd_AS4", "GLT_4Rnd_CH59", "GLT_2Rnd_R77", "GLT_2Rnd_R73"};
          		           };
                         };
                         vehicleClass = "DZG_AirVehicleClass";
                         faction = "GUAF";
                         crew = "DZG_GUAF_Pilot";
                         side = 1;
                         class UserActions {
		class defaultAction {
		priority = 0;
		shortcut = "";
		displayNameDefault = "";
		position = "";
		radius =2;
		onlyforplayer = 1;
		displayName = "GPS/INS System";
		condition = "(isengineon this) && (player == (driver this))";
		statement = "createDialog 'glt_airgpsmfd'";
                                   };
                        };
            };

Share this post


Link to post
Share on other sites

The rpt please (too).

Share this post


Link to post
Share on other sites
The rpt please (too).

I'm not sure I have an RPT. Whatever that is... in my workfolder, I only have a config.cpp file.

---------- Post added at 06:15 PM ---------- Previous post was at 05:14 PM ----------

Wait... here is an RPT with the errors in it:

http://pastie.org/1705885

Share this post


Link to post
Share on other sites

Missing items in requiredAddons:

http://pastebin.jonasscholz.de/1351

My suggestion is to define all from BI, even when unnecessary.

It is the least work and always works.

That said you may want to make this a replacement addon instead.

This way you don't have to modify missions or create new ones.

Share this post


Link to post
Share on other sites
Missing items in requiredAddons:

http://pastebin.jonasscholz.de/1351

My suggestion is to define all from BI, even when unnecessary.

It is the least work and always works.

That said you may want to make this a replacement addon instead.

This way you don't have to modify missions or create new ones.

Thanks so much!

I never realized that requiredAddons actually mattered; I thought that as long as you define the required class for each part of the addon you'd be fine. Adding all those classes to requiredAddons made it work.

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  

×