Jump to content
Sign in to follow this  
Uncle Imshi

"Simple" addon - where to start.

Recommended Posts

Hi,

I'm trying to make what should in theory (yeah I said it) be a simple addon.

What I want to do use a pipebomb/satchel model with a throw class cfg to create a throwable grenade with a large blast and a much longer than normal delay on detonation.

In my naivety I thought I would just unpbo the BIS weapons pbos to see how the grenade class weapons worked, then cleverly figure out how to alter the blast effect and detonation time and rewrite the model and texture paths to use a duplicate of the existing put type weapon I was seeking to emulate the throwing of.

However, I can't find any mention of grenades or throw or put type weapons in either ArmA 2 Weapons pbo.

Can someone start me off in the right direction please?

Thanks in advance,

Share this post


Link to post
Share on other sites

Hi, both Throw and Put weapons can be found in "weapons.pbo"

class Put : Default {

scope = protected;

value = 0;

type = VSoft;

displayName = $STR_DN_PUT;

canDrop = false;

muzzles[] = {"TimeBombMuzzle", "PipeBombMuzzle", "MineMuzzle", "MineEMuzzle"};

class PutMuzzle : Default {

sound[] = {"", db-70, 1};

reloadSound[] = {"", 0.000316228, 1};

enableAttack = false;

optics = false;

showEmpty = 0;

canLock = LockNo;

primary = 10;

minRange = 0;

minRangeProbab = 0.1;

midRange = 3;

midRangeProbab = 0.9;

maxRange = 15;

maxRangeProbab = 0.04;

};

class TimeBombMuzzle : PutMuzzle {

displayName = $STR_DN_TIME_BOMB;

magazines[] = {"TimeBomb"};

enableAttack = true;

};

class PipeBombMuzzle : PutMuzzle {

displayName = $STR_DN_PIPE_BOMB;

magazines[] = {"PipeBomb"};

enableAttack = true;

};

class MineMuzzle : PutMuzzle {

displayName = $STR_DN_MINE;

magazines[] = {"Mine"};

};

class MineEMuzzle : PutMuzzle {

displayName = $STR_DN_MINE;

magazines[] = {"MineE"};

};

};

class Throw : GrenadeLauncher {

scope = protected;

autoAimEnabled = false;

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

cursoraim = "Vehicle_Grenade_W";

cursorSize = 1;

value = 0;

type = VSoft;

displayName = $STR_DN_THROW;

canDrop = false;

muzzles[] = {"HandGrenade_Stone", "HandGrenadeMuzzle", "SmokeShellMuzzle"};

class ThrowMuzzle : GrenadeLauncher {

cursor = "Air_Dot";

cursoraim = "Vehicle_Grenade_W";

cursorSize = 1;

sound[] = {"", db-70, 1};

reloadSound[] = {"", 0.000316228, 1};

aiDispersionCoefX = 6;

aiDispersionCoefY = 6;

reloadTime = 0;

magazineReloadTime = 0;

enableAttack = false;

showEmpty = 0;

autoReload = true;

modelOptics = "";

minRange = 30;

minRangeProbab = 0.5;

midRange = 45;

midRangeProbab = 0.2;

maxRange = 60;

maxRangeProbab = 0.03;

};

class HandGrenadeMuzzle : ThrowMuzzle {

magazines[] = {"HandGrenade", "HandGrenade_West", "HandGrenade_East"};

};

class HandGrenade_Stone : ThrowMuzzle {

magazines[] = {"HandGrenade_Stone"};

displayName = $STR_DN_STONE;

minRange = 5;

minRangeProbab = 0.01;

midRange = 45;

midRangeProbab = 0.1;

maxRange = 80;

maxRangeProbab = 0.01;

};

class SmokeShellMuzzle : ThrowMuzzle {

displayName = $STR_MN_SMOKE;

magazines[] = {"SmokeShell", "SmokeShellYellow", "SmokeShellRed", "SmokeShellGreen", "SmokeShellPurple", "SmokeShellBlue", "SmokeShellOrange"};

cursor = "Vehicle_Grenade_W";

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

};

};

In the same config you'll find the "Handgrenade magazine" used in Handgrenade muzzle

class HandGrenade : CA_Magazine {

scope = public;

value = 1;

displayName = $STR_MN_HAND_GRENADE_EAST;

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

type = 256;

ammo = "GrenadeHand";

count = 1;

initSpeed = 22;

nameSound = "handgrenade";

maxLeadSpeed = 7; // max estimated speed km/h

sound[] = {"", db-70, 1};

descriptionShort = "$STR_DSS_HandGrenade";

};

class HandGrenade_West : HandGrenade {

displayName = $STR_MN_HAND_GRENADE_WEST;

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

ammo = "GrenadeHandTimedWest";

descriptionShort = "$STR_DSS_HandGrenade_West";

};

which in turn use "GrenadeHand" ammo with its model "\ca\Weapons\frag_rgd5" to be edited (but I'd suggest you create a new ammo class used in a new magazine class to be added to Throw weapon in preferred muzzle)

class GrenadeHand : Grenade {

typicalspeed = 20;

model = "\ca\Weapons\frag_rgd5";

visibleFire = 0.5; // how much is visible when this weapon is fired

audibleFire = 0.05;

visibleFireTime = 1; // how long is it visible

fuseDistance = 5;

};

Shitty thing with Throw weapon is that if you create a new one like "my_Throw" and add it to your soldiers it will not be added upon respawn (no matter using respawnWeapons array)

Good luck.

/theOden

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  

×