Jump to content
Sign in to follow this  
CameronMcDonald

Replacement config herpaderpa

Recommended Posts

G'day all.

Couldn't find a thread already covering this or similar, so this one will suffice until my problem is either solved or interest is lost.

ASA Oden recently made a cool addon which simulates via trickery the AI changing ammo types for cannons and main guns.

I have commenced making a standalone replacement addon for this based on his work, starting with the BAF Warrior. Ironically enough, I have run into problems even doing this, although you could argue I'm 50% of the way there.

Here be the code causing problems:

class Tank;
class HitHull;	
class HitTurret;	
class Turrets;	
class MainTurret;
class FrontGunner;
class LeftTurret;
class RightTurret;
class ViewGunner;
class ViewOptics;	
class ViewPilot;	
class HeadLimits;	
class CommanderOptics;	
class Wounds;	
class AnimationSources {
class HitLFWheel;
};

class Eventhandlers;

class CfgVehicles {
class Thing;	

class Land;	// External class reference	
class LandVehicle : Land {
	class HitPoints;	// External class reference
};
class car : LandVehicle {
	class HitPoints {
		class HitLFWheel;	// External class reference
		class HitLBWheel;	// External class reference
		class HitLMWheel;	// External class reference
		class HitLF2Wheel;	// External class reference
		class HitRFWheel;	// External class reference
		class HitRBWheel;	// External class reference
		class HitRMWheel;	// External class reference
		class HitRF2Wheel;	// External class reference
	};
	class NewTurret;	// External class reference

	class Turrets {
		class MainTurret : NewTurret {
			class HitPoints;	// External class reference
		};
	};
	class ViewPilot;	// External class reference
	class AnimationSources;	// External class reference
};

class Wheeled_APC : car {};
class Tracked_APC : car {};
class BMP2_Base : Tracked_APC
{
	class Turrets: Turrets
	{
		class MainTurret: MainTurret
		{
			 class Turrets: Turrets
			 {
				 class CommanderOptics: CommanderOptics {};
			 };
		};
	};
};
class M2A2_Base : Tank
{
	class Turrets: Turrets
	{
		class MainTurret: MainTurret
		{
			 class Turrets: Turrets
			 {
				 class CommanderOptics: CommanderOptics {};
			 };
		};
	};
};
class M2A2_EP1 : M2A2_Base {};

class T34 : Tank
{
	class Turrets: Turrets
	{
		class MainTurret: MainTurret
		{
			class Turrets: Turrets
			{
				class CommanderOptics: CommanderOptics {};
			};
		};
	};
};
class T34_base : T34 {};
class T55_Base : Tank
{
	class Turrets: Turrets
	{
		class MainTurret: MainTurret
		{
			class Turrets: Turrets
			{
				class CommanderOptics: CommanderOptics {};
			};
		};
	};
};
class T72_Base : Tank
{
	class Turrets: Turrets
	{
		class MainTurret: MainTurret
		{
			class Turrets: Turrets
			{
				class CommanderOptics: CommanderOptics {};
			};
		};
	};
};
class M1A1 : Tank
{
	class Turrets: Turrets
	{
		class MainTurret: MainTurret
		{
			class Turrets: Turrets
			{
				class CommanderOptics: CommanderOptics {};
			};
		};
	};
};
class M1A1_base : M1A1 {};
class M1A1_US_DES_EP1: M1A1_base {};
class M1A2_TUSK_MG : M1A1 {};
class M1A2_TUSK_MG_base : M1A2_TUSK_MG {};
class M1A2_US_TUSK_MG_EP1 : M1A2_TUSK_MG_base {};

class BAF_FV510_D : Tank
{
	class AnimationSources
{
	class recoil_source
	{
		source = "reload";
		weapon = "CMCD_CTWS_FV510";
	};
};
	class Turrets: Turrets
	{
		class MainTurret: MainTurret
		{
			weapons[] = {"CMCD_CTWS_FV510","BAF_L94A1"};
			magazines[] = {"200Rnd_40mmHE_FV510","200Rnd_40mmSABOT_FV510","2000Rnd_762x51_L94A1"};
			startEngine = false;
			lockWhenDriverOut = true;
			class OpticsIn;
			class Turrets: Turrets
			{
				class CommanderOptics: CommanderOptics {};
			};
		};
	};
};

class BAF_FV510_W : BAF_FV510_D
{
	class AnimationSources
{
	class recoil_source
	{
		source = "reload";
		weapon = "CMCD_CTWS_FV510";
	};
};
	class Turrets: Turrets
	{
		class MainTurret: MainTurret
		{
			weapons[] = {"CMCD_CTWS_FV510","BAF_L94A1"};
			magazines[] = {"200Rnd_40mmHE_FV510","200Rnd_40mmSABOT_FV510","2000Rnd_762x51_L94A1"};
			startEngine = false;
			lockWhenDriverOut = true;
			class OpticsIn;
			class Turrets: Turrets
			{
				class CommanderOptics: CommanderOptics {};
			};
		};
	};
};
};

class CfgNonAIVehicles {
class ProxyWeapon;	
};

Go right to the bottom for the business end - the empty parts are for vehicles I wish to add in the future.

Here's my problem:

The above config replaces the woodland Warrior's weapons, but does not replace the desert Warrior's. What on earth am I doing wrong?

I have a hunch that I am inheriting from the wrong class for the desert Warrior, but if memory serves the next family up is "Tank", which is a bit far from what I would like.

Share this post


Link to post
Share on other sites

Weird ... maybe your configged warrior doesn´t show ingame because it is inherited from something (tank) that doesn´t have scope set. Try adding scope=2; to your class BAF_FV510_D :turn:

The reason that BAF_FV510_W still works could be it´s inheritance from the original BAF_FV510_D base values that aren´t overwritten by addon, where scope=2 is already set, does this make any sense?

Share this post


Link to post
Share on other sites

Hmmm, no dice, sadly. I'm starting to think that perhaps there may not be a way to replace the desert Warrior, because its inheritance is a straight leap from Tank.

Any other ideas?

EDIT - I might mention here to clarify is that the desert Warrior is available ingame (and in the editor), however, it still has standard BIS weapons. The woodland Warrior has my 3l337 CMCD gunz.

Edited by CameronMcDonald

Share this post


Link to post
Share on other sites

kopfkratzouw.gif

Out of curiosity, wheres your requiredAddons[]= array, and what´s in it?

Edited by Mr Burns

Share this post


Link to post
Share on other sites

The above config is weapons.h, grabbed from:

#define TEast		0
#define TWest		1
#define TGuerrila		2
#define TCivilian		3
#define TSideUnknown		4
#define TEnemy		5
#define TFriendly		6
#define TLogic		7

#define true	1
#define false	0

#define private		0
#define protected		1
#define public		2

#define LockNo		0
#define LockCadet		1
#define LockYes		2

class CfgPatches {
class CMCDBIS2 {
	units[] = {};
	weapons[] = {};
	requiredVersion = 1.0;
	requiredAddons[] = { "CACharacters2", "CAWeapons2", "CAAir", "Chernarus", "Utes" };
};
};

#include "cfgAmmo.h"
#include "cfgMagazines.h"
#include "cfgWeapons.h"
#include "cfgVehicles.h"

Share this post


Link to post
Share on other sites

You haven´t defined any BAF specific stuff, it´s just another shot into the blue but i´ve had replaced units not show up/work before due to this.

Here´s the relevant entries you can try adding (not sure about ca_baf), taken from my very handy cfgPatches.hpp:

"CA_BAF","CATracked_BAF","CATracked_W_BAF"

edit: slightly OT, why #include?

It´s tidy, no question. But doesn´t it also render binarize useless as it only catches .cpp files?

Binarizing the whole content might lead to further clues trough bin.log

Edited by Mr Burns

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  

×