Make a new handgrenade [AtStWalker]
|Back to Tuts index|


1) Make a folder in "o2_viewer" with the name of your addon

2) Make the .p3d file :o)

3) Go to LOD Geometry, copy and paste your model here (from the LOD 0.0)

4) Use the tool "Structure > Topology > Find Components" (automatic search tool)

Handgrenade
Pic 1


6) Make a .cpp file and add these rows (you can change the valour offcourse):

#define TEast0
#define TWest1
#define TGuerrila2
#define TCivilian3
#define TSideUnknown4
#define TEnemy5
#define TFriendly6
#define TLogic7
#define true1
#define false0
#define private0
#define protected1
#define public2
#define WeaponNoSlot0
#define WeaponSlotPrimary1
#define WeaponSlotSecondary16
#define WeaponSlotItem256
#define WeaponSlotBinocular4096
#define WeaponHardMounted65536

class CfgPatches
{
class NEWCLASSOFGRENADE
{
units[] = {NEWCLASSOFGRENADE};
weapons[] = {NEWCLASSOFTHROW};
requiredVersion = 1.75;
};
};

class CfgAmmo
{
class default {};
class Grenade: default{};
class GrenadeHand: Grenade{};

class NEWGRENADE_Ammo: GrenadeHand
{
hit=30;
indirectHit=25;
indirectHitRange=6;
model="NAMEOFNEWHANDGRENADEp3dMODEL.p3d";
soundHit1[]={soundHit1,0.25};
hitGround[]={soundHit1,0.25};
hitMan[]={soundHit1,0.25};
hitArmor[]={soundHit1,0.25};
hitBuilding[]={soundHit1,0.25};
};

};

class CfgWeapons
{
class Default{};
class GrenadeLauncher: Default {};
class Throw: GrenadeLauncher {};

class NEWCLASSOFTHROW: Throw
{
magazines[] = {NEWGRENADE};
};

class NEWGRENADE: GrenadeLauncher
{
scopeWeapon = public;
scopeMagazine = public;
magazineType = WeaponSlotItem;
ammo=NEWGRENADE_Ammo;
displayName="NAMEOFNEWHANDGRENADE";
displayNameMagazine="NAMEOFNEWHANDGRENADE";
shortNameMagazine="NAMEOFNEWHANDGRENADE";
initSpeed=21;
maxLeadSpeed = 5;
reloadTime=1.5;
count=1;
sound[]={"NEWTHROWSOUND.ogg",db-68,1};
picture="PICTUREOFNEWHANDGRENADE.paa";
};

};

class CfgVehicles
{
class All{};
class AllVehicles : All{};
class Land : AllVehicles{};
class Man : Land{};
class Soldier : Man{};
class SoldierWB : Soldier{};
class NEWCLASSOFGRENADE : SoldierWB
{
displayName="Soldier with Handgrenades";
weapons[]={NEWCLASSOFTHROW};
magazines[]={NEWGRENADE};
};
}; 


Well done Soldier, mission complete ! :o)
|Back to Tuts index|


O2 for Newbies