View Full Version : Multiple Ammo Types
11th Oct 2001, 02:25 AM
How would I go about using 2 different ammo types for a weapon. I supposed I could do this via a subclass of all the tournament players and add in special variables, which are modified by the pickups (which isn't too bad seeing as I'm making a new game type).
Any help would be appreciated.
11th Oct 2001, 03:09 PM
Well there are several ways to do this, but the easiest way really depends on how you want to give the different types of ammo. As pickups? You could just hack your ammo types to replace the current ammo in the weapon, so if a player walks over the explosive ammo it will jettison the normal ammo, and vice versa. I think you'll probably want a way for the player to switch ammo, and if that's so you might consider just using altfire to do this, and just setup a toggle between the ammo modes in your weapon. Basically with the second method you would sort of 'fake' having multiple ammos... :)
11th Oct 2001, 03:33 PM
There are several ways to do this
One, change the guns ammo type(which works fine from something like the multimag), but if you want to use 2 different firing modes(like a m16/m203) if you run out of one ammo, if your codes not good, you cant use the gun
(I have a good working verson of this, but I dont think I want to part with it)
I hate thwe idea of custom playerpawn, there are other ways to do that
or you could have the gun use a different var for ammo(a var int in the gun) and have a special ammo class that addes the that var in the gun
there was a third way I have made multi-ammo, but I cant think of it right now
26th Oct 2001, 11:41 PM
make your own ammo class, have the weapon toggle a boolean or int value, and have the ammo behave as such:
What mode am i in?
mode one: ammoamount = Mode1AmmoTotal
Mode two: .....
Thats pretty much it, one ammo type, keeping track of different variables, officially using whatever type is set to the current mode.
vBulletin® v3.8.7, Copyright ©2000-2014, vBulletin Solutions, Inc.