Jump to content
Sign in to follow this  
Mysteryman5150

Need help. My config is not working

Recommended Posts

I am trying to create some new weapon variables with the vanilla weapons without altering all the weapons. I have used the following config.cpp (see below) and when I try to run the game with it I get an error message and the game doesn't start. This is the message:

Config: Some input after EndOfFile

class CfgPatches

{

class SF_Dispersion

{

units[] = {SFWeaponsAmmoBox};

weapons[] = {SF_M107};

requiredVersion = 1.05;

requiredAddons[] = {"CAweapons"};

};

};

class CfgRecoils

{

M107Recoil[] = {0, 0, 0, 0.100000, 0.200000, 2, 0.050000, -0.020000, -0.030000, 0.050000, 0, 0};

M107RecoilProne[] = {0, 0, 0, 0.100000, 0.100000, 0.005000, 0.050000, -0.200000, -0.010000, 0.050000, 0, 0};

};

class CfgWeapons

{

/*extern*/ class RifleCore;

class Rifle: RifleCore {

};

class SF_M107: Rifle

{

scope = 2;

type = 5;

model = "\ca\weapons\m107\m107";

picture = "\CA\weapons\data\Equip\W_m107_CA.paa";

UiPicture = "\CA\weapons\data\Ico\i_sniper_CA.paa";

magazines[] = {"10Rnd_127x99_m107"};

dexterity = 0.450000;

modelOptics = "\ca\Weapons\2Dscope_MilDot_14";

opticsPPEffects[] = {"OpticsCHAbera1", "OpticsBlur1"};

opticsFlare = 1;

opticsDisablePeripherialVision = 1;

opticsZoomInit = 0.055300;

opticsZoomMin = 0.017800;

distanceZoomMin = 500;

opticsZoomMax = 0.055300;

distanceZoomMax = 200;

displayname = "SF_M107";

autoFire = 0;

begin1[] = {"ca\sounds\weapons\rifles\m107", 2.511886, 1, 1300};

soundBegin[] = {"begin1", 1};

reloadMagazineSound[] = {"ca\sounds\weapons\rifles\reload-m16-2", 0.031623, 1, 20};

reloadTime = 0.500000;

dispersion = 0.000500;

aiDispersionCoefY = 3.000000;

aiDispersionCoefX = 3.000000;

minRange = 0;

minRangeProbab = 0.100000;

midRange = 1200;

midRangeProbab = 0.700000;

maxRange = 1800;

maxRangeProbab = 0.050000;

recoil = "recoil_single_primary_9outof10";

recoilProne = "recoil_single_primary_prone_7outof10";

class Library

{

libTextDesc = "$STR_LIB_M107";

};

descriptionShort = "$STR_DSS_M107";

};

};

class cfgVehicles

{

/*extern*/ class ReammoBox;

class SFWeaponsAmmoBox: ReammoBox

{

scope = 2;

accuracy = 1000;

model = "\ca\weapons\AmmoBoxes\USBasicAmmo.p3d";

displayName = "SF Weapons weapons box";

class TransportMagazines

{

class _xx_10Rnd_127x99_m107

{

magazine = "10Rnd_127x99_m107";

count = 30;

};

};

class TransportWeapons

{

class _xx_SF_m107

{

weapon = "SF_m107";

count = 6;

};

};

};

};

Any help would be much appreciated.

Edit: I fixed the script (forgot to binarize when packing):o, but I have another problem now. The AI will use the new M107 weapon for a bit but then will change over to their pistol, even if they have plenty of ammo left. Any ideas why this would happen:confused:?

Edited by Mysteryman5150

Share this post


Link to post
Share on other sites

Thanks, I think I got all the {} and [] correct now (see spoiler above). The mod now works since I binarized it but my problem now is that the AI will only use the new M107 weapon for a bit before changing over to his pistol, even if he has plenty of ammo left. If I team switch to the AI character I can get him to use the new m107 for a while again but he will once again switch back to his pistol. Any ideas why this is happening?

Share this post


Link to post
Share on other sites

Perhaps the dexterity? If the AI think the weapon is too unwieldy, they may switch?

You have it at .45. The M-16A2 is 1.64. May try that?

Share this post


Link to post
Share on other sites

Thanks TRexian. I will give it a try. However, I actually used the vanilla specs for the dexterity and all the other info. The only thing I added was the aiDispersionCoefx= and aiDispersionCoefy= and the AI doesn't switch when using the vanilla version:confused:. It doesn't matter what those numbers are set at either I get the same effect.

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  

×