Jump to content
Sign in to follow this  
nullsystems

Two configs of the same, only one works.

Recommended Posts

Hi all,

I'll try and keep this simple.

Ive got two new grenades I made.

They have exactly the same configs, just different names and different hit values and smoke color.

They are in two different pbo's ( I have also tried both in the same pbo/same config ).

One only works at a time. Odd!

They both show up in the inventory but you can only throw one.

Has this happened to anyone else?

Share this post


Link to post
Share on other sites

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

class CfgPatches

{

class CSGas

{

units[] = {""};

weapons[] = {"Throw","CSGas"};

};

};

class CfgAmmo {

class Default {};

class Grenade: Default {};

class GrenadeHand: Grenade {};

class SmokeShell: GrenadeHand {};

class CSGas : SmokeShell {

scope = 2;

model = "\ca\Weapons\anm8_white";

hit = 5;

indirectHit = 2;

indirectHitRange = 0.2;

cost = 100;

simulation = "shotSmoke";

explosive = false;

deflecting = 30;

explosionTime = 2;

timeToLive = 30;

soundFLy[]={"\CSGas\sound\gasloop.ogg",1,1};

smokeColor[] = {1, 0.8, 0.7, 0};

class Smoke {

interval = 0.01;

cloudletDuration = 4.0; // time to live (not including fades)

cloudletAnimPeriod = 1.0; // animation speed

cloudletSize = 0.25;

cloudletAlpha = 1.0;

cloudletGrowUp = 1.5; // grow-up time

cloudletFadeIn = 0.0; // fade-in time

cloudletFadeOut = 5.0; // fade-out time

cloudletAccY = -0.3; // vertical acceleration

cloudletMinYSpeed = 0; // vertical speed range

cloudletMaxYSpeed = 10;

cloudletShape = "\ca\data\cl_basic";

cloudletColor[] = {1, 1, 1, 0};

initT = 1000;

deltaT = -500;

class Table {

class T1 {

maxT = 0;

color[] = {0.7, 0.7, 0.7, 1};

};

class T2 {

maxT = 1000;

color[] = {0.4, 0.4, 0.4, 1};

};

};

density = 1.0;

size = 1.5;

initYSpeed = 1.0;

timeToLive = 50;

in = 3.0;

out = 2.0;

};

};

};

class cfgWeapons {

class Default; // External class reference

class GrenadeCore; // External class reference

class GrenadeLauncher : Default {};

class Throw : GrenadeLauncher {

scope = 2;

autoAimEnabled = false;

cursor = "\ca\Weapons\Data\clear_empty";

cursoraim = "\ca\Weapons\Data\t_select";

cursorSize = 1;

value = 0;

type = VSoft;

displayName = $STR_DN_THROW;

canDrop = false;

muzzles[] = {"CSGasMuzzle"};

class ThrowMuzzle : GrenadeLauncher {};

class CSGasMuzzle : ThrowMuzzle {

scope = 2;

displayName = "CSGas";

magazines[] = {"CSGas"};

};

};

class HandGrenade : GrenadeLauncher {};

class HandGrenadeTimed : HandGrenade {};

class CSGas : HandGrenade {

scope = 2;

autoAimEnabled = false;

ammo = "CSGas";

displayName = "CSGas";

nameSound = "smokeshell";

};

}

class CfgMagazines {

class Default;

class CA_Magazine : Default {};

class HandGrenade : CA_Magazine {};

class HandGrenadeTimed : HandGrenade {};

class CSGas : HandGrenade {

scope = 2;

displayName = "CSGas";

picture = "\CA\weapons\data\equip\m_ANM8_white_ca.paa";

value = 2;

ammo = "CSGas";

nameSoundWeapon = "smokeshell";

};

}

This is the code, I then replicate this and just change the name and some values of the smoke color, save into another .pbo addon....and only one will work at a time.

Share this post


Link to post
Share on other sites
... and just change the name and some values of the smoke color, save into another .pbo

Detail needed, its exactly this info that could be causing the issue.

Share this post


Link to post
Share on other sites

smokeColor[] = {1, 0.8, 0.7, 0};

Turns into

smokeColor[] = {0.8, 1, 0.5, 0};

Thats all.

Share this post


Link to post
Share on other sites

Ok, well I'm no weapons config'er myself, but looks to me like you are overwriting the default BIS weapons and ammo definitions.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> class Throw : GrenadeLauncher {

"Throw" is a BIS definition, thats meant to be protected (scope = 1wink_o.gif ..... so seems like a bad start. You should be using your own names.

I suspect you should be starting cfgWeapons with something simple like;

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

class cfgWeapons {

class HandGrenade; // extended

class MyNade : HandGrenade {

ammo = "GrenadeHandTimed";

picture = "handgrenadeTimed";

displayName = "mynade";

............

..........

.........

etc

};

Same for Ammo

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

class CfgAmmo {

class SmokeShell; // extended

class CSGas : SmokeShell {

scope = 2;

model = "\ca\Weapons\anm8_white";

..........

...........

..........

etc

Share this post


Link to post
Share on other sites
smokeColor[] = {1, 0.8, 0.7, 0};

Turns into

smokeColor[] = {0.8, 1, 0.5, 0};

Thats all.

If thats the only difference then one addon will overwrite the other. You need to use different classnames.

If you show me one or both configs I can help you.

Share this post


Link to post
Share on other sites

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class Throw : GrenadeLauncher {

   muzzles[] = {"CSGasMuzzle"};

   class CSGasMuzzle : ThrowMuzzle {

       magazines[] = {"CSGas"};

   };

};

If you're redefining class Throw in both configs, then one of them will override the other. The above indicated code makes only one type of grenade usable for Throw, and that would be fine if that's all you had. However I suspect that you're also trying to redefine the Throw class in your second config with the same code.

What you end up with is two versions of the class Throw, each exclusive to one of your different types of grenades. However, if you have multiple definitions of the same classname, one of them will override the others, hence only one of these versions of Throw will exist in the game and only one type of grenade will be usable.

What you want instead is a single Thow class that supports the use of all of your grenades (and any others you wish to be able to use). So make one (re)definition of Throw in a single config that accepts both types of grenades. Keeping with your (and BIS's) multiple muzzles method, a seperate muzzle for each grenade would do the job.

Here's an example with two grenade magazines of classnames Type1 and Type2:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class Throw : GrenadeLauncher {

   muzzles[] = {"Type1Muzzle","Type2Muzzle"};

   class Type1Muzzle : ThrowMuzzle {

       magazines[] = {"Type1"};

   };

   class Type2Muzzle : Type1Muzzle {

       magazines[] = {"Type2"};

   };

};

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  

×