Jump to content
Sign in to follow this  
Ex3B

Modifying Marid turret weapons

Recommended Posts

For some reason, I cannot seem to modify the turret on the Marid.

Everytime I try to inherit the subclass turrets, it breaks, and I don't know why:

 here's the text:

Quote

    class O_APC_Wheeled_02_rcws_v2_F;
    class O_APC_Wheeled_02_rcws_v2_F_Clone: O_APC_Wheeled_02_rcws_v2_F
    {
        displayName="Test Clone";
        class Turrets; // Breaks the turret
    };
    class EX3B_O_APC_Wheeled_02_rcws_v2_base_F: O_APC_Wheeled_02_rcws_v2_F_Clone
    {
        displayName="Test base";
        class MainTurret;
        class Turrets: Turrets
        {
            class MainTurret;
        };
    };
    class EX3B_O_APC_Wheeled_02_rcws_v2_F: EX3B_O_APC_Wheeled_02_rcws_v2_base_F
    {
        Scope = 2;
        peakTorque=1037.5;
        displayName="Assault Marid";
        slingLoadCargoMemoryPoints[] = {"driverview","gunnerview","commanderview","EngineEffectL","EngineEffectR"};
        slingLoadCargoMemoryPointsDir[] = {};
        enginePower = 120;
        class Eventhandlers
        {
            init="_this execVM '\CSAT_AerialAssault\AssaultMarid\init.sqf'";
        };
        class Turrets: Turrets
        {
            class MainTurret: MainTurret
            {
                weapons[]=
                {
                    "HMG_127_APDS",
                    "GMG_40mm_Clone",
                    "SmokeLauncher"
                };
                magazines[]=
                {
                    "96Rnd_40mm_Sabot_G_belt",
                    "96Rnd_40mm_G_belt",
                    "150Rnd_127x108_APDS",
                    "150Rnd_127x108_APDS",
                    "150Rnd_127x108_APDS",
                    "150Rnd_127x108_APDS",
                    "150Rnd_127x108_Ball",
                    "SmokeLauncherMag"
                };
            };
        };
    };

 

How do I change this to make it work. Why doesn't it work, I already successfully changed the Nyx weapons using the same method.

 

Quote

    class LT_01_AT_base_F;
    class I_LT_01_AT_F: LT_01_AT_base_F
    {
        class Turrets;
        class AnimationSources;
    };
    class I_LT_01_AT_F_clone: I_LT_01_AT_F
    {
        Scope = 0;
        class Turrets : Turrets
        {
            class MainTurret;
        };
    };

 

Share this post


Link to post
Share on other sites

Ok, it turns out that by specifying armor_F_exp as a prerequisite, it now breaks here:

Quote

class O_APC_Wheeled_02_rcws_v2_F;
    class O_APC_Wheeled_02_rcws_v2_F_Clone: O_APC_Wheeled_02_rcws_v2_F
    {
        displayName="Test Clone";
        class Turrets; // Breaks the turret
    };
    class EX3B_O_APC_Wheeled_02_rcws_v2_base_F: O_APC_Wheeled_02_rcws_v2_F_Clone
    {
        displayName="Test base";
        class Turrets: Turrets
        {
            class MainTurret;
        };
    };
    class EX3B_O_APC_Wheeled_02_rcws_v2_F: EX3B_O_APC_Wheeled_02_rcws_v2_base_F
    {
        Scope = 2;
        peakTorque=1037.5;
        displayName="Assault Marid";
        slingLoadCargoMemoryPoints[] = {"driverview","gunnerview","commanderview","EngineEffectL","EngineEffectR"};
        slingLoadCargoMemoryPointsDir[] = {};
        enginePower = 120;
        class Eventhandlers
        {
            init="_this execVM '\CSAT_AerialAssault\AssaultMarid\init.sqf'";
        };
        class Turrets: Turrets
        {
            class MainTurret: MainTurret
            {
                weapons[]=
                {
                    "HMG_127_APDS",
                    "GMG_40mm_Clone",
                    "SmokeLauncher"
                };
                magazines[]=
                {
                    "96Rnd_40mm_Sabot_G_belt",
                    "96Rnd_40mm_G_belt",
                    "150Rnd_127x108_APDS",
                    "150Rnd_127x108_APDS",
                    "150Rnd_127x108_APDS",
                    "150Rnd_127x108_APDS",
                    "150Rnd_127x108_Ball",
                    "SmokeLauncherMag"
                };
            };
        };
    };

How do I properly do this?

Share this post


Link to post
Share on other sites

If you do actually want a EX3B_O_APC_Wheeled_02_rcws_v2_base_F central base class for your variants:

class Wheeled_APC_F;
class APC_Wheeled_02_base_F: Wheeled_APC_F
{
	class Turrets;
};
class APC_Wheeled_02_base_v2_F: APC_Wheeled_02_base_F
{
	class Turrets: Turrets
	{
		class MainTurret;
	};
};

class EX3B_O_APC_Wheeled_02_rcws_v2_base_F: APC_Wheeled_02_base_v2_F
{
	class Turrets: Turrets
	{
		class MainTurret: MainTurret
		{
			//Your stuff here
		};
	};
};
class EX3B_O_APC_Wheeled_02_rcws_v2_F: EX3B_O_APC_Wheeled_02_rcws_v2_base_F
{
	scope = 2; //placeable in editor
};

Otherwise you can move the EX3B_O_APC_Wheeled_02_rcws_v2_F class up to where EX3B_O_APC_Wheeled_02_rcws_v2_base_F is (see below)

 

Alternative inheritance would be

class APC_Wheeled_02_base_F;
class APC_Wheeled_02_base_v2_F: APC_Wheeled_02_base_F
{
	class Turrets;
};
class O_APC_Wheeled_02_rcws_v2_F: APC_Wheeled_02_base_v2_F
{
	class Turrets: Turrets
	{
		class MainTurret;
	};
};

class EX3B_O_APC_Wheeled_02_rcws_v2_F: O_APC_Wheeled_02_rcws_v2_F
{
	class Turrets: Turrets
	{
		class MainTurret: MainTurret
		{
			//Your stuff here
		};
	};
};

But this is specifically using the ingame CSAT vehicle O_APC_Wheeled_02_rcws_v2_F rather than the Marid base class. So may have some extra desert CSAT-specific properties you don't want to automatically inherit when it comes to making your own branch of the classes (type of crew, edPrev image, texture set etc. etc.)

 

Fundamental idea is that you go backwards along the inheritance tree each time you inset by a subclass to inherit that subclass' properties from a parent. Not start at some class and try to build a whole set of extra classes to fill those inset gaps, which is what you appeared to be doing with the EX3B_O_APC_Wheeled_02_rcws_v2_base_F and O_APC_Wheeled_02_rcws_v2_F_Clone classes.

 

You can see the difference between the first and second examples whereby the class we are adding stuff to ("//Your stuff here"), branches off one step further down the inheritance tree in the second example (O_APC_Wheeled_02_rcws_v2_F rather than APC_Wheeled_02_base_v2_F) so the starting point is one class down in turn (APC_Wheeled_02_base_v2_F rather than Wheeled_APC_F)

Share this post


Link to post
Share on other sites

Thanks, I am just cautious about modifying stock units, I want stock to always be 100% stock, so that my modified unit exists alongside stock rather than replacing it.

I worry that by mentioning the stock class with anything in { } that I may change something.

I still don't get why the mention of main turret in my 2nd post broke things, the structure looks the same as the one you propose

Share this post


Link to post
Share on other sites
41 minutes ago, Ex3B said:

I still don't get why the mention of main turret in my 2nd post broke things, the structure looks the same as the one you propose 

Because class EX3B_O_APC_Wheeled_02_rcws_v2_base_F isn't an existing class from the game, so writing class MainTurret; in there isn't referencing the location of an existing class MainTurret. It's just creating a new one with no parameters.

When you do MainTurret: MainTurret in EX3B_O_APC_Wheeled_02_rcws_v2_F it is now inheriting from a completely empty MainTurret.

 

Turrets are one of a number of special class types that behave differently from others in the game, whereby they will completely overwrite classes with the same name rather than merging with them. Which is why you are always needing to do Turrets: Turrets, MainTurret: MainTurret type inheritances to preserve parameters where you want to keep the same name.

Just writing class MainTurret; in a new class is effectively the same as writing class MainTurret {}; to empty it.

Share this post


Link to post
Share on other sites
12 hours ago, da12thMonkey said:

Because class EX3B_O_APC_Wheeled_02_rcws_v2_base_F isn't an existing class from the game, so writing class MainTurret; in there isn't referencing the location of an existing class MainTurret. It's just creating a new one with no parameters.

I thought since class EX3B_O_APC_Wheeled_02_rcws_v2_base_F  inherits from an existing class, that it would also inherit the MainTurret child class, and I could reference it... I guess not

 

If you haven't guessed, this is for a slingloadable Marid (that script sets the weight such that a Taru can just barely lift it), that packs a bit more punch... because as far as airmobile or amphibious vehicles, CSAT doesn't compete well with the Nyx, the Gorgon, the Marshal, and the Rhino.

Before I had the script also setting the weapons loadout, but I figured I should to it more properly like this.

 

*edit*, figured it out, it was the eventhandler breaking the smokes.

Also it seems I don't need to do 2 inheritances, I can just inherit like:

    class APC_Wheeled_02_base_v2_F;
    class O_APC_Wheeled_02_rcws_v2_F: APC_Wheeled_02_base_v2_F
    {
        class Turrets;
        class MainTurret;
        class Eventhandlers;
    };

 

My config now looks like this, and works:

Spoiler

class CfgVehicles
{
    class APC_Wheeled_02_base_v2_F;
    class O_APC_Wheeled_02_rcws_v2_F: APC_Wheeled_02_base_v2_F
    {
        class Turrets;
        class MainTurret;
        class Eventhandlers;
    };
    class O_T_APC_Wheeled_02_rcws_v2_ghex_F: APC_Wheeled_02_base_v2_F
    {
        class Turrets;
        class MainTurret;
        class Eventhandlers;
    };
    class EX3B_O_APC_Wheeled_02_rcws_v2_F: O_APC_Wheeled_02_rcws_v2_F
    {
        Scope = 2;
        peakTorque=1037.5;
        displayName="MSE-3b Marid";
        slingLoadCargoMemoryPoints[] = {"driverview","gunnerview","commanderview","EngineEffectL","EngineEffectR"};
        slingLoadCargoMemoryPointsDir[] = {};
        enginePower = 120;
        class Eventhandlers: Eventhandlers
        {
            init="_this execVM '\CSAT_AerialAssault\AssaultMarid\init.sqf'";
        };
        class Turrets: Turrets
        {
            class MainTurret: MainTurret
            {
                weapons[]=
                {
                    "HMG_127_APDS",
                    "GMG_40mm_Clone",
                    "SmokeLauncher"
                };
                magazines[]=
                {
                    "96Rnd_40mm_Sabot_G_belt",
                    "96Rnd_40mm_G_belt",
                    "150Rnd_127x108_APDS",
                    "150Rnd_127x108_APDS",
                    "150Rnd_127x108_APDS",
                    "150Rnd_127x108_APDS",
                    "150Rnd_127x108_Ball",
                    "SmokeLauncherMag"
                };
            };
        };
    };
    class EX3B_O_T_APC_Wheeled_02_rcws_v2_ghex_F: O_T_APC_Wheeled_02_rcws_v2_ghex_F 
    {
        Scope = 2;
        peakTorque=1037.5;
        displayName="MSE-3b Marid";
        slingLoadCargoMemoryPoints[] = {"driverview","gunnerview","commanderview","EngineEffectL","EngineEffectR"};
        slingLoadCargoMemoryPointsDir[] = {};
        enginePower = 120;
        class Eventhandlers: Eventhandlers
        {
            init="_this execVM '\CSAT_AerialAssault\AssaultMarid\init.sqf'";
        };
        hiddenSelectionsTextures[]=
        {
            "a3\armor_f_exp\apc_wheeled_02\data\apc_wheeled_02_ext_01_ghex_co.paa",
            "a3\armor_f_exp\apc_wheeled_02\data\apc_wheeled_02_ext_02_ghex_co.paa",
            "a3\data_f_exp\vehicles\turret_ghex_co.paa",
            "a3\armor_f\data\camonet_csat_hex_green_co.paa",
            "a3\armor_f\data\cage_csat_green_co.paa"
        };
        class Turrets: Turrets
        {
            class MainTurret: MainTurret
            {
                weapons[]=
                {
                    "HMG_127_APDS",
                    "GMG_40mm_Clone",
                    "SmokeLauncher"
                };
                magazines[]=
                {
                    "96Rnd_40mm_Sabot_G_belt",
                    "96Rnd_40mm_G_belt",
                    "150Rnd_127x108_APDS",
                    "150Rnd_127x108_APDS",
                    "150Rnd_127x108_APDS",
                    "150Rnd_127x108_APDS",
                    "150Rnd_127x108_Ball",
                    "SmokeLauncherMag"
                }; 
            };
        };
    };

 

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  

×