Jump to content
Mirek

Faulty Config.cpp for my rifle mod.

Recommended Posts

Hi

 

I have a config containing two weapons, i have two separate p3ds of those weapons, two sepparate pictures, and everithing but in game only the first weapon appears.

I use :

this addWeaponCargoGlobal ["CZ805_A1_HOLO_ACR",4];
this addWeaponCargoGlobal ["CZ805_A1_ACOG_ACR",4]; 

To spawn the two rifles in a box, but instead of having 4pcs of the acog version and 4 pcs of the holo version i always end up with 8pcs of the acog version in the box.

 

Here is the config.cpp:

class CfgAddons
{
	class PreloadAddons
	{
		class CorePatch_CZ805_A1_ACOG
		{
			list[] = {"CorePatch_CZ805_A1_ACOG"};
		};
	};
};
class CfgPatches
{
	class CorePatch_CZ805_A1_ACOG
	{
		requiredAddons[] = {"CAWeapons_ACR"};
		requiredVersion = 1.00;
		units[] = {};
		weapons[] = {};
	};
};
class CfgWeapons
{
	class CZ805_A1_ACR;
	class CZ805_A1_ACOG_ACR : CZ805_A1_ACR
	{
		displayName = "$STR_MREK_CZ805acg";
		model = "\CorePatch_CZ805_A1_ACOG\CZ_805_A1_ACOG";
		modelOptics = "\Ca\weapons_E\SCAR\ACOG_TA31_optic_4x.p3d";
		picture = "\CorePatch_CZ805_A1_ACOG\w_805A1acg_ca.paa";

		class OpticsModes
		{
			class ACOG
			{
				cameraDir = "";
				distanceZoomMax = 300;
				distanceZoomMin = 300;
				memoryPointCamera = "opticView";
				opticsDisablePeripherialVision = 1;
				opticsFlare = 1;
				opticsID = 1;
				opticsPPEffects[] = {
					"OpticsCHAbera1",
					"OpticsBlur1"
				};
				opticsZoomInit = 0.0623;
				opticsZoomMax = 0.0623;
				opticsZoomMin = 0.0623;
				useModelOptics = 1;
				visionMode[] = {
					"Normal"
				};
			};
			class Kolimator : ACOG
			{
				memoryPointCamera = "eye";
				opticsDisablePeripherialVision = 0;
				opticsFlare = 0;
				opticsID = 2;
				opticsZoomInit = 0.5;
				opticsZoomMax = 1.1;
				opticsZoomMin = 0.25;
				useModelOptics = 0;
				visionMode[] = {};
			};
		};
	};
	
	class CZ805_A1_HOLO_ACR : CZ805_A1_ACR
	{
		displayName = "$STR_MREK_CZ805holo";
		model = "\CorePatch_CZ805_A1_ACOG\CZ_805_A1_HOLO";
		modelOptics = "-";
		picture = "\CorePatch_CZ805_A1_ACOG\w_805A1holo_ca.paa";

		class OpticsModes
		{
			
			class Kolimator : ACOG
			{
				memoryPointCamera = "eye";
				opticsDisablePeripherialVision = 0;
				opticsFlare = 0;
				opticsID = 2;
				opticsZoomInit = 0.5;
				opticsZoomMax = 1.1;
				opticsZoomMin = 0.25;
				useModelOptics = 0;
				visionMode[] = {};
			};
		};
	};
};

I have no idea what iam doing i coppied other guys config made for single weapon, and changed just the things i needed, and doubled part of it to get config for two weapons. Wich things to change i figured by trial and error. So i still have no idea what iam doing.

Share this post


Link to post
Share on other sites

I've only just got into addon configs so I'm definitely the worst person to be offering advice.

I wanted to rename ACE and BIS weapons to British designations, after a lot of trial and error I got there... Kind of.

I kept getting error messages saying "XXXXXX already defined". After a good nights rest I came up with the idea of making separate pbo's within my addon.

So...

Put

class CfgPatches
{
	class CorePatch_CZ805_A1_ACOG
	{
		requiredAddons[] = {"CAWeapons_ACR"};
		requiredVersion = 1.00;
		units[] = {};
		weapons[] = {};
	};
};
class CfgWeapons
{
	class CZ805_A1_ACR;
	class CZ805_A1_ACOG_ACR : CZ805_A1_ACR
	{
		displayName = "$STR_MREK_CZ805acg";
		model = "\CorePatch_CZ805_A1_ACOG\CZ_805_A1_ACOG";
		modelOptics = "\Ca\weapons_E\SCAR\ACOG_TA31_optic_4x.p3d";
		picture = "\CorePatch_CZ805_A1_ACOG\w_805A1acg_ca.paa";

		class OpticsModes
		{
			class ACOG
			{
				cameraDir = "";
				distanceZoomMax = 300;
				distanceZoomMin = 300;
				memoryPointCamera = "opticView";
				opticsDisablePeripherialVision = 1;
				opticsFlare = 1;
				opticsID = 1;
				opticsPPEffects[] = {
					"OpticsCHAbera1",
					"OpticsBlur1"
				};
				opticsZoomInit = 0.0623;
				opticsZoomMax = 0.0623;
				opticsZoomMin = 0.0623;
				useModelOptics = 1;
				visionMode[] = {
					"Normal"
				};
			};
			class Kolimator : ACOG
			{
				memoryPointCamera = "eye";
				opticsDisablePeripherialVision = 0;
				opticsFlare = 0;
				opticsID = 2;
				opticsZoomInit = 0.5;
				opticsZoomMax = 1.1;
				opticsZoomMin = 0.25;
				useModelOptics = 0;
				visionMode[] = {};
			};
		};
	};
};

in a folder called CZ805_A1_ACOG and PBO it.

 

Then put

class CfgPatches
{
	class CorePatch_CZ805_A1_ACOG
	{
		requiredAddons[] = {"CAWeapons_ACR"};
		requiredVersion = 1.00;
		units[] = {};
		weapons[] = {};
	};
};
class CfgWeapons
{
	class CZ805_A1_ACR;
	class CZ805_A1_HOLO_ACR : CZ805_A1_ACR
	{
		displayName = "$STR_MREK_CZ805holo";
		model = "\CorePatch_CZ805_A1_ACOG\CZ_805_A1_HOLO";
		modelOptics = "-";
		picture = "\CorePatch_CZ805_A1_ACOG\w_805A1holo_ca.paa";

		class OpticsModes
		{
			
			class Kolimator : ACOG
			{
				memoryPointCamera = "eye";
				opticsDisablePeripherialVision = 0;
				opticsFlare = 0;
				opticsID = 2;
				opticsZoomInit = 0.5;
				opticsZoomMax = 1.1;
				opticsZoomMin = 0.25;
				useModelOptics = 0;
				visionMode[] = {};
			};
		};
	};
};

in a folder called CZ805_A1_HOLO_ACR and PBO it.

 

 

I hope this is useful in some way.

I'll keep an eye on this post as I think this could help me in the future.

 

 

Share this post


Link to post
Share on other sites

Hey fellow noob Modder, Thanks For your help I separated the mod to two different PBOS but it didnt help. The second rifle doesnt exist as far as the game is concerned. Since iam a compleeet noob, i cant tell why for sure. but i thing

class Kolimator : ACOG
			{
				memoryPointCamera = "eye";
				opticsDisablePeripherialVision = 0;
				opticsFlare = 0;
				opticsID = 2;
				opticsZoomInit = 0.5;
				opticsZoomMax = 1.1;
				opticsZoomMin = 0.25;
				useModelOptics = 0;
				visionMode[] = {};

Is a problem but i tried to change it to 

class Kolimator : HOLO
			{
				memoryPointCamera = "eye";
				opticsDisablePeripherialVision = 0;
				opticsFlare = 0;
				opticsID = 2;
				opticsZoomInit = 0.5;
				opticsZoomMax = 1.1;
				opticsZoomMin = 0.25;
				useModelOptics = 0;
				visionMode[] = {};

But that aslo didnt help.

It says undefined class HOLO

Iam lost :D

Ill try some more on my own, and if i fail, ill message Maczer or Shatten. They saved me few times with this mod allready, Withut Shatten this mod wouldnt even start to exist, and Without Maczer i would never have working Sights on that rifle, they might not be too annoyed with me yet so ill try to ask them for help once more.  :)  

Share this post


Link to post
Share on other sites

Damn, I'm lost too!

 

 

I've been looking through the weapon configs in A2SM_Data_APL and I don't see a class for a HOLO sight anywhere.

 

I hope you get there in the end.

Share this post


Link to post
Share on other sites

Solved!

class CfgAddons
{
	class PreloadAddons
	{
		class BL_CZ805_A1_HOLO
		{
			list[] = {"BL_CZ805_A1_HOLO"};
		};
	};
};
class CfgPatches
{
	class BL_CZ805_A1_HOLO
	{
		requiredAddons[] = {"CAWeapons_ACR"};
		requiredVersion = 1.00;
		units[] = {};
		weapons[] = {};
	};
};
class CfgWeapons
{
	class CZ805_A1_ACR;
	class CZ805_A1_HOLO_ACR : CZ805_A1_ACR
	{
		displayName = "$STR_MREK_CZ805holo";
		model = "\BL_CZ805_A1_Holo\CZ_805_A1_HOLO";
		modelOptics = "-";
		picture = "\BL_CZ805_A1_Holo\w_805A1holo_ca.paa";

		class OpticsModes
		{
			class Kolimator
			{
				opticsID = 1;
				useModelOptics = false;
				opticsPPEffects[] = {"OpticsCHAbera1","OpticsBlur1"};
				opticsZoomMin = 0.25;
				opticsZoomMax = 1.1;
				opticsZoomInit = 0.5;
				memoryPointCamera = "eye";
				visionMode[] = {};
				opticsFlare = false;
				opticsDisablePeripherialVision = false;
				distanceZoomMin = 100;
				distanceZoomMax = 100;
				cameraDir = "";
			};
		};
	};
};

I copied config cpp. from bis sample models and changed few things.

 

Gun Now works, problem is, HOLO sights are too big and look too ugly on CZ805 so i will probably replace them With Meopta MRAD from Scorpion EVO model.

Share this post


Link to post
Share on other sites

So the HOLO version is working nice and easy now, except some minor issue with texture. Now iam working on CZ805A1ACOG GL. everything wors except a major issue with gear. The weapon shows itself in Ammobox with name picture and everything. Both sights are working Gun Shoots, GL shoots, Textures are working, But when i equip it, it doesnt appear in my gear. I have it in hands, i can use it, but i dont see it in gear, i cannot throw it away, etc.

 

Also could anyone explain to me the lines in Config.CPP in human language?

 

Here is the Config:

class CfgAddons
{
	class PreloadAddons
	{
		class BL_CZ_RIFLES
		{
			list[] = {"BL_CZ_RIFLES"}; // i have only vague idea what that does, but i know its important so iam having it there.
		};
	};
};
class CfgPatches // this i gues says the game that the actual mod starts here right?
{
	class BL_CZ_RIFLES //This tells the game the name of the mod?
	{
		requiredAddons[] = {"CAWeapons_ACR"}; //this tells the game that ACR DLC is needed to run the mod
		requiredVersion = 1.00; // ??
		units[] = {}; //??
		weapons[] = {}; //??
	};
};
class CfgWeapons // Weapons config starts here
{
	class CZ805_A1_ACR; // dont know why this line is here but it doesnt work without it.
	class CZ805_A1_ACOG_ACR : CZ805_A1_ACR //First is the CZ805ACOG wich is based on CZ805A1 from ACR DLC
	{
		displayName = "$STR_MREK_CZ805acg"; // this points the game to stringtable.csv where the name of the gun in different languages is specified.
		model = "\BL_CZ_RIFLES\CZ_805_A1_ACOG"; //This tells the game wich model to load.
		modelOptics = "\Ca\weapons_E\SCAR\ACOG_TA31_optic_4x.p3d"; // Same as above but for optics
		picture = "\BL_CZ_RIFLES\w_805A1acg_ca.paa"; //Picture in gear menu.

		class OpticsModes // this tells the game what optics modes the gun has available
		{
			class ACOG // 1st optics mode is RCO ACOG
			{
				cameraDir = ""; // no idea what that does
				distanceZoomMax = 300; // this would be for scopes with zoom?
				distanceZoomMin = 300; // this would be for scopes with zoom?
				memoryPointCamera = "opticView"; //this tells the game wich of the points in memory lod in the model to use.
				opticsDisablePeripherialVision = 1; // selfexplanatory
				opticsFlare = 1;//??
				opticsID = 1;//??
				opticsPPEffects[] = {
					"OpticsCHAbera1",
					"OpticsBlur1" //??
				};
				opticsZoomInit = 0.0623;//maybe this is for scopes with zoom? what was the previous distance thing for then?
				opticsZoomMax = 0.0623;
				opticsZoomMin = 0.0623;
				useModelOptics = 1;
				visionMode[] = {
					"Normal"//??
				};
			};
			class Kolimator : ACOG //Backup sights
			{
				memoryPointCamera = "eye"; // memory point, we allready know what that is.
				opticsDisablePeripherialVision = 0;
				opticsFlare = 0;
				opticsID = 2;
				opticsZoomInit = 0.5;
				opticsZoomMax = 1.1;
				opticsZoomMin = 0.25;
				useModelOptics = 0;
				visionMode[] = {};
			};
		};
		class M203Muzzle; //Specifies Grenade launcher, for later use.
		reloadMagazineSound[] = {"\CA\Sounds_ACR\weapons\cz-805_reload",db-30,1};
		drySound[] = {"\CA\Sounds_ACR\weapons\dry", db-40,1};
		class Library {libTextDesc = $STR_ACR_LIB_CZ805;};
	};
	class CZ805_A1_HOLO_ACR : CZ805_A1_ACR
	{
		displayName = "$STR_MREK_CZ805holo";
		model = "\BL_CZ_RIFLES\CZ_805_A1_HOLO";
		modelOptics = "-";
		picture = "\BL_CZ_RIFLES\w_805A1holo_ca.paa";

		class OpticsModes
		{
			class Kolimator
			{
				opticsID = 1;
				useModelOptics = false;
				opticsPPEffects[] = {"OpticsCHAbera1","OpticsBlur1"};
				opticsZoomMin = 0.25;
				opticsZoomMax = 1.1;
				opticsZoomInit = 0.5;
				memoryPointCamera = "eye";
				visionMode[] = {};
				opticsFlare = false;
				opticsDisablePeripherialVision = false;
				distanceZoomMin = 100;
				distanceZoomMax = 100;
				cameraDir = "";
			};
		};
	};
	class CZ805_A1_GL_ACOG: CZ805_A1_ACOG_ACR
	{
		scope = public;
		displayName = "$STR_MREK_CZ805GLACOG";
		model = "\BL_CZ_RIFLES\CZ_805_A1_GL_ACOG";
		picture="\BL_CZ_RIFLES\w_805A1GLacg_ca.paa";
		handAnim[] = {"OFP2_ManSkeleton","\Ca\weapons\data\Anim\M16GL.rtm"};
		dexterity = 1.6;
		muzzles[] = {this, M203Muzzle};
		class M203Muzzle: M203Muzzle
		{
			begin1[] = {"ca\sounds_e\weapons_e\grenade_launcher\gr_launcher_3", db0, 1,200};
			begin2[] = {"ca\sounds_e\weapons_e\grenade_launcher\gr_launcher_4", db0, 1,200};
			soundBegin[] = {begin1,0.5, begin2,0.5};
			reloadMagazineSound[] = {"ca\sounds_e\weapons_e\grenade_launcher\gr_launcher_reload",db0,1,30};
			drySound[] = {"ca\sounds_e\weapons_e\grenade_launcher\gr_launcher_dry",db1,1,40};
			displayName = $STR_ACR_DN_CZ805G1;
			opticsZoomMin = 0.22;
			opticsZoomMax = 0.95;
			opticsZoomInit = 0.42;
		};
	};
}; 

Share this post


Link to post
Share on other sites

Hello, again.

 

I'm not sure why the weapon isn't showing up in your gear.

Looking through a couple of weapon addons I noticed that there is no .paa at the end of picture.

 

Try -  picture = "\BL_CZ_RIFLES\w_805A1acg_ca";

 

 

As for explaining the lines in Config.cpp in human language - I've taken a shot at it.

 

Also bear in mind I'm brand new at this.

class CfgAddons
{
	class PreloadAddons
	{
		class BL_CZ_RIFLES
		{
			list[] = {"BL_CZ_RIFLES"}; // No idea if this is needed. This is telling Arma to load this addon before any other addons?? 
		};
	};
};
class CfgPatches // this i gues says the game that the actual mod starts here right?
{
	class BL_CZ_RIFLES // I believe this tells arma the name of the mod, yes.
	{
		requiredAddons[] = {"CAWeapons_ACR"}; //this tells the game that ACR DLC is needed to run the mod
		requiredVersion = 1.00; // Minimum game version required - I have all my addons with requiredVersion = 1.6;
		units[] = {}; // Not sure - For vehicle addons, to tell what units need to be in vehicle?
		weapons[] = {}; //Not sure - For unit & vehicle addons, to tell what weapons need to be equipped by unit(s) or vehicle?
	};
};
class CfgWeapons // Weapons config starts here
{
	class CZ805_A1_ACR; // Not sure either!
	class CZ805_A1_ACOG_ACR : CZ805_A1_ACR //First is the CZ805ACOG wich is based on CZ805A1 from ACR DLC
	{
		displayName = "$STR_MREK_CZ805acg"; // this points the game to stringtable.csv where the name of the gun in different languages is specified.
		model = "\BL_CZ_RIFLES\CZ_805_A1_ACOG"; //This tells the game wich model to load.
		modelOptics = "\Ca\weapons_E\SCAR\ACOG_TA31_optic_4x.p3d"; // Same as above but for optics
		picture = "\BL_CZ_RIFLES\w_805A1acg_ca.paa"; //Picture in gear menu.

		class OpticsModes // this tells the game what optics modes the gun has available
		{
			class ACOG // 1st optics mode is RCO ACOG
			{
				cameraDir = ""; // no idea what that does
				distanceZoomMax = 300; // This, I'm almost certain, is the weapons zeroing.
				distanceZoomMin = 300; // See above - I've kept both of these values at 300 - Don't really need to change the zeroing with an ACOG.
				memoryPointCamera = "opticView"; //this tells the game wich of the points in memory lod in the model to use.
				opticsDisablePeripherialVision = 1; // selfexplanatory
				opticsFlare = 1;// true or false needed - True means that lens flare should be shown while using the optic. 
				opticsID = 1;// Maybe sets optic as default?
				opticsPPEffects[] = {
					"OpticsCHAbera1",
					"OpticsBlur1" Post-process effects applied while using this optic - No idea of different effects if any. 
				};
				opticsZoomInit = 0.0623;// Not sure - I've played around with these values within Kolimator : ACOG and haven't noticed ANY changes.
				opticsZoomMax = 0.0623;
				opticsZoomMin = 0.0623;
				useModelOptics = 1;
				visionMode[] = {
					"Normal"// You can give scopes "NVG" or "TI" capabilities. Or all 3 if you wish... visionMode[] = {
					"Normal","NVG","TI"};
				};
			};
			class Kolimator : ACOG //Backup sights
			{
				memoryPointCamera = "eye"; // memory point, we allready know what that is.
				opticsDisablePeripherialVision = 0;
				opticsFlare = 0;
				opticsID = 2;
				opticsZoomInit = 0.5;
				opticsZoomMax = 1.1;
				opticsZoomMin = 0.25;
				useModelOptics = 0;
				visionMode[] = {};
			};
		};
		class M203Muzzle; //Specifies Grenade launcher, for later use.
		reloadMagazineSound[] = {"\CA\Sounds_ACR\weapons\cz-805_reload",db-30,1};
		drySound[] = {"\CA\Sounds_ACR\weapons\dry", db-40,1};
		class Library {libTextDesc = $STR_ACR_LIB_CZ805;};
	};
	class CZ805_A1_HOLO_ACR : CZ805_A1_ACR
	{
		displayName = "$STR_MREK_CZ805holo";
		model = "\BL_CZ_RIFLES\CZ_805_A1_HOLO";
		modelOptics = "-";
		picture = "\BL_CZ_RIFLES\w_805A1holo_ca.paa";

		class OpticsModes
		{
			class Kolimator
			{
				opticsID = 1;
				useModelOptics = false;
				opticsPPEffects[] = {"OpticsCHAbera1","OpticsBlur1"};
				opticsZoomMin = 0.25;
				opticsZoomMax = 1.1;
				opticsZoomInit = 0.5;
				memoryPointCamera = "eye";
				visionMode[] = {};
				opticsFlare = false;
				opticsDisablePeripherialVision = false;
				distanceZoomMin = 100;
				distanceZoomMax = 100;
				cameraDir = "";
			};
		};
	};
	class CZ805_A1_GL_ACOG: CZ805_A1_ACOG_ACR
	{
		scope = public;
		displayName = "$STR_MREK_CZ805GLACOG";
		model = "\BL_CZ_RIFLES\CZ_805_A1_GL_ACOG";
		picture="\BL_CZ_RIFLES\w_805A1GLacg_ca.paa";
		handAnim[] = {"OFP2_ManSkeleton","\Ca\weapons\data\Anim\M16GL.rtm"};
		dexterity = 1.6;
		muzzles[] = {this, M203Muzzle};
		class M203Muzzle: M203Muzzle
		{
			begin1[] = {"ca\sounds_e\weapons_e\grenade_launcher\gr_launcher_3", db0, 1,200};
			begin2[] = {"ca\sounds_e\weapons_e\grenade_launcher\gr_launcher_4", db0, 1,200};
			soundBegin[] = {begin1,0.5, begin2,0.5};
			reloadMagazineSound[] = {"ca\sounds_e\weapons_e\grenade_launcher\gr_launcher_reload",db0,1,30};
			drySound[] = {"ca\sounds_e\weapons_e\grenade_launcher\gr_launcher_dry",db1,1,40};
			displayName = $STR_ACR_DN_CZ805G1;
			opticsZoomMin = 0.22;
			opticsZoomMax = 0.95;
			opticsZoomInit = 0.42;
		};
	};
}; 
  • Like 1

Share this post


Link to post
Share on other sites

Thanks Mate, much clearer now i see some of them i should have guessed. Might be getting dumb.

 

I resolved the issue with the CZ805A1ACOG GL. it now equips properly and picture and name is shown properly. the problem was 

 "scope = public;"

 line in the config. i deleted this lineand everithing works now.

 

Except the bullets doesnt dissapier in the transparent magazine, and muzzleflash is present constantly even i i dont shoot.

 

Here is a picture of my first 3 rifles:

 

2473050EEE16091B3945379BA2461173B03940CC

the top one with the Grenade launcher still has issues, the second and third one works fine.

Share this post


Link to post
Share on other sites

O it seems iam a bit lost again. With the CZ805ACOG with GL.

 

I have still the problem with the Muzzleflash. The muzzleflash is present all the time. even if the gun doesnt shoot. Any idea what might cause this?

Share this post


Link to post
Share on other sites

Nice work so far!

It's a shame there hasn't been more advice in this thread. 

 

 

I've seen something similar to this on a vehicle mod a long time ago where the mounted GPMG's showed a constant muzzle flash even if they were unoccupied.

 I don't have a clue why this happened. The only answers I got were; "It's a bug." or "It's F*CKED!". 

 

 

 

 

Would you be willing to send me a link to your addon so I can take a closer look?

  • Like 1

Share this post


Link to post
Share on other sites

I AM AN COMPLETE STUPID IDIOT!!!!!!

 

I forgot Underscroll in code in model.cfg instead of  CZ_805_A1_GL_ACOG i got CZ805_A1_GL_ACOG

 

Problem solved.

 

Thank you man. 

  • Like 1

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

×