Home   Help Search Login Register  

Author Topic: New Smoke Colour?  (Read 1630 times)

0 Members and 1 Guest are viewing this topic.

Offline Jase

  • Members
  • *
New Smoke Colour?
« on: 26 Oct 2008, 21:34:45 »
Hi Guys,

I'm trying to create another colour smoke grenade (Pink).  However once I require the item from the crate it does not appear in the menu to use the new smoke grenade? Any Ideas? 

Code: [Select]
class CfgPatches {
class SmokeGrenade {
units[] = {};
weapons[] = {};
requiredVersion = 0.100000;
requiredAddons[] = {"CAweapons"};
};
};


class CfgAmmo {
class Default;
class GrenadeHand;

class SmokeShell : GrenadeHand {
model = \ca\Weapons\anm8_white;
hit=5;indirectHit=2;indirectHitRange=0.2;
cost=100;
simulation=shotSmoke;
explosive = 0;
deflecting=60;
explosionTime=2;
timeToLive=60;
soundHit[]={,0,1};
smokeColor[] = {1, 1, 1, 0};

class Smoke {
interval = 0.01;
// single cloudlet parameters
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};}
};
// source parameters
density = 1.0;
size = 1.5;
initYSpeed = 1.0;
timeToLive = 50; // source time to live (not including fades)
in = 3.0; // fade-in time
out = 2.0; // fade-out time
};
};
class SmokeShellPink : SmokeShell {
model = \ca\Weapons\m18_green;
smokeColor[] = {255, 0, 0, 0.2};
};
}

class CfgMagazines {
class Default;
class CA_Magazine;
class HandGrenade;

class SmokeShell: HandGrenade {
displayName = "Custom Smoke Grenade";
picture="\CA\weapons\data\equip\m_ANM8_white_ca.paa";
value = 2;
ammo = SmokeShell;
nameSoundWeapon = "smokeshell";
};
class SmokeShellPink: SmokeShell {
displayName = "Smoke Pink";
picture="\CA\weapons\data\equip\m_m18red_ca.paa";
ammo = SmokeShellPink;
};
}

class cfgWeapons {
class Default;
class MGunCore;
class LauncherCore;
class GrenadeCore;
class GrenadeLauncher;
class MGun: MGunCore {

class Throw: GrenadeLauncher {
scope = 1;
autoAimEnabled=false;
cursor = \ca\Weapons\Data\clear_empty;
cursoraim = \ca\Weapons\Data\t_select;
cursorSize = 1;
value = 0;
type = 0;
displayName=$STR_DN_THROW;
canDrop = false;

muzzles[] = {SmokeShellMuzzle, SmokeShellPinkMuzzle};

class ThrowMuzzle : GrenadeLauncher {
cursor = \ca\Weapons\Data\w_weapon_S;
cursoraim = \ca\Weapons\Data\t_select;
cursorSize = 1;
sound[]={,db-70,1};
reloadSound[]={,db-70,1};

aiDispersionCoefX=2.0;
aiDispersionCoefY=2.0;

reloadTime=0;
magazineReloadTime=0;

enableAttack=false;

showEmpty = false;
autoReload = true;

modelOptics="";

  minRange=30;minRangeProbab=0.5;
  midRange=45;midRangeProbab=0.20;
  maxRange=60;maxRangeProbab=0.03;
};
class SmokeShellMuzzle : ThrowMuzzle {
displayName = $STR_MN_SMOKE;
magazines[] = {SmokeShell};
};
class SmokeShellPinkMuzzle : ThrowMuzzle {
displayName = $STR_MN_SMOKE;
magazines[] = {SmokeShellPink};
};
};
class HandGrenade: GrenadeLauncher {
scope = 0;
cursor = \ca\Weapons\Data\t_select;
cursoraim = \ca\Weapons\Data\clear_empty;
cursorSize = 1;
autoAimEnabled=false;

ammo=GrenadeHand;
displayName=$STR_DN_HAND_GRENADE;
nameSound="handgrenade";
initSpeed=22;
reloadMagazineSound[]={\ca\Weapons\Data\Sound\z_sinus,db-70,1}; // reload HandGrenade
maxLeadSpeed = 7;
reloadTime=0;
magazineReloadTime=0;
count=1;
sound[]={,db-70,1};
};
class SmokeShell: HandGrenade {
autoAimEnabled=false;
ammo=SmokeShell;
displayName=$STR_DN_SMOKE;
nameSound="smokeshell";
};
class SmokeShellPink: HandGrenade {
autoAimEnabled=false;
ammo=SmokeShellPink;
displayName="Pink Smoke";
nameSound="smokeshell";
};
}

Thanks very much,
Jase

Offline Gnat

  • Addons Depot
  • Moderator
  • *****
  • I Bite!
    • Gnats
Re: New Smoke Colour?
« Reply #1 on: 27 Oct 2008, 11:11:00 »
Hi Jase
Im not big on config'in hand weapons, but wheres a few points
- Don't re-define existing stuff, like "SmokeShell", it already exists, so you just copy like this;

Quote
class SmokeShell;
class MySmokeShell : SmokeShell
{
....
....

Once you copy you only have to redefine whats different, the same will always copy in the background

So for ammo I suspect it should be;
Quote
class CfgAmmo {
            class SmokeShell;
   class SmokeShellPink : SmokeShell
              {
   model = \ca\Weapons\m18_green;
   smokeColor[] = {255, 0, 0, 0.2};
               class Smoke
               {
               cloudletColor[] = {255, 0, 0, 0.2};
              };
   };


Then for Magazine

Quote
class CfgMagazines {
            class SmokeShell;
   class SmokeShellPink: SmokeShell {
      displayName = "Smoke Pink";
      picture="\CA\weapons\data\equip\m_m18red_ca.paa";
      ammo = SmokeShellPink;
   };
};


My best guess ....

Offline Jase

  • Members
  • *
Re: New Smoke Colour?
« Reply #2 on: 27 Oct 2008, 14:24:53 »
Hi,

Thanks for your reply!

The only reason why I've left the defines there is for I can take this script further and produce a few more things, such as lightsticks etc...

Jase