Jump to content
Sign in to follow this  
swtx

I still have a problem with my pistol config

Recommended Posts

I have gone through my pistol config and I'm still getting a "S instead of =" error at line 78 which is located after the first "Class TailHouses" where the 3 curly braces are.

Your suggestions and your input are appreciated.

// Config created by swtx and modified by swtx

class CfgPatches {
	class Project_Genesis_acp {
	units[] = {};
	weapons[] = {"hgun_ACPC2_F", "hgun_ACPC2_snds_F"};
	requiredVersion = 0.1;
	requiredAddons[] = {"A3_Weapons_F"};
	version = ".01";
	projectName = "Project_Genesis";
	author = "swtx";
};
};


	class CfgWeapons {
class Pistol;	// External class reference
class Mode_SemiAuto;	// External class reference
class BaseSoundModeType; // External class reference

class Pistol_Base_F : Pistol {};
	scope = 2;
	author = "swtx";
	displayName = 1911 Tactical;
	drySound[] = {"Project_Genesis\Project_Genesis_acp\dry", 1, 1, 20};
	reloadMagazineSound[] = {"Project_Genesis\Project_Genesis_acp\apc_reload", 1, 1, 30};
	magazines[] = {"9Rnd_45ACP_Mag"};
	inertia = 0.3;
	dexterity = 1.7;
	initSpeed = 320;
	recoil = "recoil_pistol_acpc2";

	class Single : Mode_SemiAuto {
		sounds[] = { "StandardSound", "SilencedSound" };

		class BaseSoundModeType {

			closure1[] = { "Project_Genesis\Project_Genesis_acp\null", 1.03514, 1, 30 };
			closure2[] = { "Project_Genesis\Project_Genesis_acp\null", 1.03514, 1, 30 };
			soundClosure[] = { "closure1", 0.5, "closure2", 0.5 };

			class StandardSound : BaseSoundModeType {
				begin1[] = { "Project_Genesis\Project_Genesis_acp\acpsingle1", 2.51189, 1, 1400 };
				begin2[] = { "Project_Genesis\Project_Genesis_acp\acpsingle1", 2.51189, 1, 1400 };
				begin3[] = { "Project_Genesis\Project_Genesis_acp\acpsingle1", 2.51189, 1, 1400 };
				soundBegin[] = { "begin1", 0.33, "begin2", 0.33, "begin3", 0.34 };

				class SoundTails {
					class TailInterior {
						sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\4-Five_tail_interior", 2, 1, 1400 };
						frequency = 1;
						volume = "interior";
					};

					class TailTrees {
						sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\4-Five_tail_trees", 2, 1, 1400 };
						frequency = 1;
						volume = "(1-interior/1.4)*trees";
					};

					class TailForest {
						sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\4-Five_tail_forest", 2, 1, 1400 };
						frequency = 1;
						volume = "(1-interior/1.4)*forest";
					};

					class TailMeadows {
						sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\4-Five_tail_meadows", 2, 1, 1400 };
						frequency = 1;
						volume = "(1-interior/1.4)*(meadows/2 max sea/2)";
					};

					class TailHouses {
						sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\4-Five_tail_houses", 2, 1, 1400 };
						frequency = 1;
						volume = "(1-interior/1.4)*houses";
					};
				};
			};

		Class SilencedSound : BaseSoundModeType {
			begin1[] = { "Project_Genesis\Project_Genesis_acp\suppressed_pistol1", 1, 1, 200};
			begin2[] = { "Project_Genesis\Project_Genesis_acp\suppressed_pistol2", 1, 1, 200};
			soundBegin[] = { "begin1", 0.5, "begin2", 0.5 };


class SoundTails {
class TailInterior {
	sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\Silencer_4-Five_tail_interior", 1, 1, 600 };
					frequency = 1;
					volume = "interior";
				};

class TailTrees {
sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\Silencer_4-Five_tail_trees", 1, 1, 600 };
					frequency = 1;
					volume = "(1-interior/1.4)*trees";
				};

class TailForest {
sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\Silencer_4-Five_tail_forest", 1, 1, 600 };
					frequency = 1;
					volume = "(1-interior/1.4)*forest";
				};

class TailMeadows {
sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\Silencer_4-Five_tail_meadows", 1, 1, 600 };
					frequency = 1;
					volume = "(1-interior/1.4)*(meadows/2 max sea/2)";
				};

class TailHouses {
sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\Silencer_4-Five_tail_houses", 1, 1, 600 };
					frequency = 1;
					volume = "(1-interior/1.4)*houses";
				};
			};
		};
			recoil = "recoil_pistol_heavy";
			recoilProne = "recoil_prone_pistol_heavy";
			reloadTime = 0.1;
			dispersion = 0.065;
			minRange = 5;
			minRangeProbab = 0.3;
			midRange = 25;
			midRangeProbab = 0.6;
			maxRange = 50;
			maxRangeProbab = 0.1;
			aiRateOfFire = 2;
			aiRateOfFireDistance = 25;
		};
	};

Share this post


Link to post
Share on other sites

Thank you for the suggestion. I have correct that bracket error and I'm still getting this:

ERROR.jpg~original

Edited by swtx

Share this post


Link to post
Share on other sites

thats another brace issue. Make sure every time you are using an opening brace that you are closing it in the proper place. Using a proper editor such as Poseidon may help you.

Share this post


Link to post
Share on other sites

Thanks for the heads up i will give it a shot :)

Share this post


Link to post
Share on other sites

Haven't tested this myself, but from my experience these minor changes should fix it - Though as I said, it hasn't been tested.

// Config created by swtx and modified by swtx

class CfgPatches {
	class Project_Genesis_acp {
	units[] = {};
	weapons[] = {"hgun_ACPC2_F", "hgun_ACPC2_snds_F"};
	requiredVersion = 0.1;
	requiredAddons[] = {"A3_Weapons_F"};
	version = ".01";
	projectName = "Project_Genesis";
	author = "swtx";
};
};


	class CfgWeapons {
class Pistol;	// External class reference
class Mode_SemiAuto;	// External class reference
class BaseSoundModeType; // External class reference

class Pistol_Base_F : Pistol
{
	scope = 2;
	author = "swtx";
	displayName = 1911 Tactical;
	drySound[] = {"Project_Genesis\Project_Genesis_acp\dry", 1, 1, 20};
	reloadMagazineSound[] = {"Project_Genesis\Project_Genesis_acp\apc_reload", 1, 1, 30};
	magazines[] = {"9Rnd_45ACP_Mag"};
	inertia = 0.3;
	dexterity = 1.7;
	initSpeed = 320;
	recoil = "recoil_pistol_acpc2";

	class Single : Mode_SemiAuto {
		sounds[] = { "StandardSound", "SilencedSound" };

		class BaseSoundModeType {

			closure1[] = { "Project_Genesis\Project_Genesis_acp\null", 1.03514, 1, 30 };
			closure2[] = { "Project_Genesis\Project_Genesis_acp\null", 1.03514, 1, 30 };
			soundClosure[] = { "closure1", 0.5, "closure2", 0.5 };

			class StandardSound : BaseSoundModeType {
				begin1[] = { "Project_Genesis\Project_Genesis_acp\acpsingle1", 2.51189, 1, 1400 };
				begin2[] = { "Project_Genesis\Project_Genesis_acp\acpsingle1", 2.51189, 1, 1400 };
				begin3[] = { "Project_Genesis\Project_Genesis_acp\acpsingle1", 2.51189, 1, 1400 };
				soundBegin[] = { "begin1", 0.33, "begin2", 0.33, "begin3", 0.34 };

				class SoundTails {
					class TailInterior {
						sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\4-Five_tail_interior", 2, 1, 1400 };
						frequency = 1;
						volume = "interior";
					};

					class TailTrees {
						sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\4-Five_tail_trees", 2, 1, 1400 };
						frequency = 1;
						volume = "(1-interior/1.4)*trees";
					};

					class TailForest {
						sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\4-Five_tail_forest", 2, 1, 1400 };
						frequency = 1;
						volume = "(1-interior/1.4)*forest";
					};

					class TailMeadows {
						sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\4-Five_tail_meadows", 2, 1, 1400 };
						frequency = 1;
						volume = "(1-interior/1.4)*(meadows/2 max sea/2)";
					};

					class TailHouses {
						sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\4-Five_tail_houses", 2, 1, 1400 };
						frequency = 1;
						volume = "(1-interior/1.4)*houses";
					};
				};
			};

		Class SilencedSound : BaseSoundModeType {
			begin1[] = { "Project_Genesis\Project_Genesis_acp\suppressed_pistol1", 1, 1, 200};
			begin2[] = { "Project_Genesis\Project_Genesis_acp\suppressed_pistol2", 1, 1, 200};
			soundBegin[] = { "begin1", 0.5, "begin2", 0.5 };


class SoundTails {
class TailInterior {
	sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\Silencer_4-Five_tail_interior", 1, 1, 600 };
					frequency = 1;
					volume = "interior";
				};

class TailTrees {
sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\Silencer_4-Five_tail_trees", 1, 1, 600 };
					frequency = 1;
					volume = "(1-interior/1.4)*trees";
				};

class TailForest {
sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\Silencer_4-Five_tail_forest", 1, 1, 600 };
					frequency = 1;
					volume = "(1-interior/1.4)*forest";
				};

class TailMeadows {
sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\Silencer_4-Five_tail_meadows", 1, 1, 600 };
					frequency = 1;
					volume = "(1-interior/1.4)*(meadows/2 max sea/2)";
				};

class TailHouses {
sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\Silencer_4-Five_tail_houses", 1, 1, 600 };
					frequency = 1;
					volume = "(1-interior/1.4)*houses";
				};
			};
		};
			recoil = "recoil_pistol_heavy";
			recoilProne = "recoil_prone_pistol_heavy";
			reloadTime = 0.1;
			dispersion = 0.065;
			minRange = 5;
			minRangeProbab = 0.3;
			midRange = 25;
			midRangeProbab = 0.6;
			maxRange = 50;
			maxRangeProbab = 0.1;
			aiRateOfFire = 2;
			aiRateOfFireDistance = 25;
		};
	};
};
};

Share this post


Link to post
Share on other sites

Thank you both for your help with this. I tried the updated config you posted above and I am still getting a "S instead =" error at line 79. I have tried adding and removing curly brackets but still getting the error message.

Share this post


Link to post
Share on other sites

I found the problem. It turned out the the "c" in the word class was capitalized in one of the entries. I corrected the error; however, now I'm getting a CTD when running the mod with the corrected config. Your input is still appreciated :)

Updated Config

// Config created by swtx and modified by swtx

class CfgPatches {
	class Project_Genesis_acp {
	units[] = {};
	weapons[] = {"hgun_ACPC2_F", "hgun_ACPC2_snds_F"};
	requiredVersion = 0.1;
	requiredAddons[] = {"A3_Weapons_F"};
	version = ".01";
	projectName = "Project_Genesis";
	author = "swtx";
};
};


	class CfgWeapons {
class Pistol;	// External class reference
class Mode_SemiAuto;	// External class reference
class BaseSoundModeType; // External class reference

class Pistol_Base_F : Pistol
{
	scope = 2;
	displayName = 1911 Tactical;
	drySound[] = {"Project_Genesis\Project_Genesis_acp\dry", 1, 1, 20};
	reloadMagazineSound[] = {"Project_Genesis\Project_Genesis_acp\apc_reload", 1, 1, 30};
	dispersion = 0.065;

	class Single : Mode_SemiAuto {
		sounds[] = { "StandardSound", "SilencedSound" };

		class BaseSoundModeType {

			closure1[] = { "Project_Genesis\Project_Genesis_acp\null", 1.03514, 1, 30 };
			soundClosure[] = { "closure1", 0.5 };

			class StandardSound : BaseSoundModeType {
				begin1[] = { "Project_Genesis\Project_Genesis_acp\acpsingle1", 2.51189, 1, 1400 };
				begin2[] = { "Project_Genesis\Project_Genesis_acp\acpsingle2", 2.51189, 1, 1400 };
				begin3[] = { "Project_Genesis\Project_Genesis_acp\acpsingle3", 2.51189, 1, 1400 };
				soundBegin[] = { "begin1", 0.33, "begin2", 0.33, "begin3", 0.34 };

				class SoundTails {
					class TailInterior {
						sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\4-Five_tail_interior", 2, 1, 1400 };
						frequency = 1;
						volume = "interior";
					};

					class TailTrees {
						sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\4-Five_tail_trees", 2, 1, 1400 };
						frequency = 1;
						volume = "(1-interior/1.4)*trees";
					};

					class TailForest {
						sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\4-Five_tail_forest", 2, 1, 1400 };
						frequency = 1;
						volume = "(1-interior/1.4)*forest";
					};

					class TailMeadows {
						sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\4-Five_tail_meadows", 2, 1, 1400 };
						frequency = 1;
						volume = "(1-interior/1.4)*(meadows/2 max sea/2)";
					};

					class TailHouses {
						sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\4-Five_tail_houses", 2, 1, 1400 };
						frequency = 1;
						volume = "(1-interior/1.4)*houses";
					};
				};
			};

		class SilencedSound : BaseSoundModeType {
			begin1[] = { "Project_Genesis\Project_Genesis_acp\suppressed_pistol1", 1, 1, 200};
			begin2[] = { "Project_Genesis\Project_Genesis_acp\suppressed_pistol2", 1, 1, 200};
			soundBegin[] = { "begin1", 0.5, "begin2", 0.5 };


class SoundTails {
class TailInterior {
	sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\Silencer_4-Five_tail_interior", 1, 1, 600 };
					frequency = 1;
					volume = "interior";
				};

class TailTrees {
sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\Silencer_4-Five_tail_trees", 1, 1, 600 };
					frequency = 1;
					volume = "(1-interior/1.4)*trees";
				};

class TailForest {
sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\Silencer_4-Five_tail_forest", 1, 1, 600 };
					frequency = 1;
					volume = "(1-interior/1.4)*forest";
				};

class TailMeadows {
sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\Silencer_4-Five_tail_meadows", 1, 1, 600 };
					frequency = 1;
					volume = "(1-interior/1.4)*(meadows/2 max sea/2)";
				};

class TailHouses {
sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\Silencer_4-Five_tail_houses", 1, 1, 600 };
					frequency = 1;
					volume = "(1-interior/1.4)*houses";
				};
			};
		};
			recoil = "recoil_pistol_heavy";
			recoilProne = "recoil_prone_pistol_heavy";

		};
	};
};
};

Edited by swtx

Share this post


Link to post
Share on other sites

It seems that the bracket error is gone, but I've found a bunch of various other mistakes. First of all, I'm kinda confused that you actually edit a base class, from which other pistols inherit their properties. If there is no particular reason for that, I'd prefer defining a new class for your new pistol, which I did. Also, the config lacks model of the pistol, which might be the reason for CTD. Also, you define the Mode_SemiAuto class inside cfgWeapons, but you have to define it outside of it. Last but not least, it seems that the mode[] property is missing. Long story short, please try the code below, it might be a good starting point. Please note I used the ACPC2 model as a placeholder, so the new pistol would work; it should be replaced by an actual new pistol's model. One last note: I write brackets slightly differently from the code you posted, which is IMO easier to navigate in, so you might consider adopting this way, as well.

// Config created by swtx and modified by swtx
class CfgPatches
{
class Project_Genesis_acp
{
	units[] = {};
	weapons[] = {"hgun_1991T"};
	requiredVersion = 0.1;
	requiredAddons[] = {"A3_Weapons_F"};
	version = ".01";
	projectName = "Project_Genesis";
	author = "swtx";
};
};

class Mode_SemiAuto;	// External class reference

class CfgWeapons
{
class Pistol_Base_F;	// External class reference

class hgun_1991T: Pistol_Base_F
{
	scope = 2;
	model = "\A3\Weapons_F_Beta\Pistols\ACPC2\ACPC2_F.p3d";
	picture = "\A3\Weapons_F_Beta\Pistols\ACPC2\Data\UI\gear_Acpc2_X_CA.paa";
	author = "swtx";
	displayName = "1911 Tactical";
	drySound[] = {"Project_Genesis\Project_Genesis_acp\dry", 1, 1, 20};
	reloadMagazineSound[] = {"Project_Genesis\Project_Genesis_acp\apc_reload", 1, 1, 30};
	magazines[] = {"9Rnd_45ACP_Mag"};
	inertia = 0.3;
	dexterity = 1.7;
	initSpeed = 320;
	modes[] = {Single};
	recoil = "recoil_pistol_acpc2";

	class Single: Mode_SemiAuto
	{
		sounds[] = { "StandardSound", "SilencedSound" };

		class BaseSoundModeType
		{
			closure1[] = { "Project_Genesis\Project_Genesis_acp\null", 1.03514, 1, 30 };
			closure2[] = { "Project_Genesis\Project_Genesis_acp\null", 1.03514, 1, 30 };
			soundClosure[] = { "closure1", 0.5, "closure2", 0.5 };
		};

		class StandardSound : BaseSoundModeType
		{
			begin1[] = { "Project_Genesis\Project_Genesis_acp\acpsingle1", 2.51189, 1, 1400 };
			begin2[] = { "Project_Genesis\Project_Genesis_acp\acpsingle1", 2.51189, 1, 1400 };
			begin3[] = { "Project_Genesis\Project_Genesis_acp\acpsingle1", 2.51189, 1, 1400 };
			soundBegin[] = { "begin1", 0.33, "begin2", 0.33, "begin3", 0.34 };

			class SoundTails
			{
				class TailInterior
				{
					sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\4-Five_tail_interior", 2, 1, 1400 };
					frequency = 1;
					volume = "interior";
				};

				class TailTrees
				{
					sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\4-Five_tail_trees", 2, 1, 1400 };
					frequency = 1;
					volume = "(1-interior/1.4)*trees";
				};

				class TailForest
				{
					sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\4-Five_tail_forest", 2, 1, 1400 };
					frequency = 1;
					volume = "(1-interior/1.4)*forest";
				};

				class TailMeadows
				{
					sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\4-Five_tail_meadows", 2, 1, 1400 };
					frequency = 1;
					volume = "(1-interior/1.4)*(meadows/2 max sea/2)";
				};

				class TailHouses
				{
					sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\4-Five_tail_houses", 2, 1, 1400 };
					frequency = 1;
					volume = "(1-interior/1.4)*houses";
				};
			};
		};

		class SilencedSound : BaseSoundModeType
		{
			begin1[] = { "Project_Genesis\Project_Genesis_acp\suppressed_pistol1", 1, 1, 200};
			begin2[] = { "Project_Genesis\Project_Genesis_acp\suppressed_pistol2", 1, 1, 200};
			soundBegin[] = { "begin1", 0.5, "begin2", 0.5 };

			class SoundTails
			{
				class TailInterior
				{
					sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\Silencer_4-Five_tail_interior", 1, 1, 600 };
					frequency = 1;
					volume = "interior";
				};

				class TailTrees
				{
					sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\Silencer_4-Five_tail_trees", 1, 1, 600 };
					frequency = 1;
					volume = "(1-interior/1.4)*trees";
				};

				class TailForest
				{
					sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\Silencer_4-Five_tail_forest", 1, 1, 600 };
					frequency = 1;
					volume = "(1-interior/1.4)*forest";
				};

				class TailMeadows
				{
					sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\Silencer_4-Five_tail_meadows", 1, 1, 600 };
					frequency = 1;
					volume = "(1-interior/1.4)*(meadows/2 max sea/2)";
				};

				class TailHouses
				{
					sound[] = { "A3\Sounds_F\arsenal\weapons\Pistols\4-Five\Silencer_4-Five_tail_houses", 1, 1, 600 };
					frequency = 1;
					volume = "(1-interior/1.4)*houses";
				};
			};
		};

		recoil = "recoil_pistol_heavy";
		recoilProne = "recoil_prone_pistol_heavy";
		reloadTime = 0.1;
		dispersion = 0.065;
		minRange = 5;
		minRangeProbab = 0.3;
		midRange = 25;
		midRangeProbab = 0.6;
		maxRange = 50;
		maxRangeProbab = 0.1;
		aiRateOfFire = 2;
		aiRateOfFireDistance = 25;
	};
};
};

Share this post


Link to post
Share on other sites

Locklear, thank you for your help with this, it is deeply appreciated. The problem is completely resolved based on the corrections you made to my config.

Thanks again,

Scott Out :)

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  

×