OFPEC Forum

Addons & Mods Depot => OFP - Addons & Mods General => Topic started by: Ares1978 on 27 Sep 2002, 17:45:31

Title: Multiple ammo types?
Post by: Ares1978 on 27 Sep 2002, 17:45:31
I am currently making a shoulder fired weapon that uses 2 types of ammo, HE and AP. Could someone give some instruction on how to define the two ammo types in the config.cpp? One type is no problem to make, but I can't get the two to work together. One should explode on impact and the other shouldn't.
Title: Re:Multiple ammo types?
Post by: Lucknow on 28 Sep 2002, 14:17:24
This should work...

You'll notice the M16 can fire mortars as well as bullets (i.e. 2 ammo types).

So define 2 'magazines' in the main body of the weapon cfgweapon section, i.e.

magazine[]={"HEmag","APmag"};

then make sure you define these 'mag' types as seperate classes which include the proper ammo type that you've already defined in the cfgammo section of the cpp file, i.e.

class HEmag: YourRifle
ammo="HEbullet";

and ...

class AP mag: YourRifle
ammo="APbullet";

If you then give the soldier say 4 mags of each type in his inventory you should get the option to reload whichever one you want to fire, AP or HE.