Weapon flag: WEAPON.ALT_USES_AMMO1

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

Weapon flag: WEAPON.ALT_USES_AMMO1

Postby wildweasel » Sun May 13, 2012 10:39 pm

My usual method of programming weapons with reloading is to use Ammo2 as the "reserve" ammo and Ammo1 as the "loaded" ammo. However, with weapons that have altfires that use the same ammo type as the primary, this turns into a bit of a roundabout hack, since I either need to make the altfire specifically check Ammo1 and then take the proper amount (remembering to set TIF_NOTAKEINFINITE), or else just set Ammo1 and Ammo2 to the same thing and make an exception in SBARINFO to make it show the reserve ammo over top of the Ammo2 counter.

Basically, I'd like a cleaner way to do this.
User avatar
wildweasel
change o' pace.
Moderator Team Lead
 
Joined: 15 Jul 2003

Re: Weapon flag: WEAPON.ALT_USES_AMMO1

Postby NeuralStunner » Mon May 14, 2012 1:07 pm

What you could do: Set AmmoUse2 to 0, add WEAPON.ALT_USES_BOTH. Though I'm guessing you'd like to be able to set AmmoUse2 to a different number, so the AltFire will use the same ammo but a different amount.

Personally I'm content to do the ammo taking with A_TakeInventory. :shrug:
User avatar
NeuralStunner
Not "Neutral"
 
 
 
Joined: 21 Jul 2009
Location: capital N, capital S, no space
Discord: NeuralStunner#4201
Operating System: Windows Vista/7/2008 64-bit
Graphics Processor: nVidia (Modern GZDoom)

Re: Weapon flag: WEAPON.ALT_USES_AMMO1

Postby wildweasel » Mon May 14, 2012 1:09 pm

Yeah...specifically I was needing this for ww-nazis-v2's flamethrower, which takes 10 fuel units to shoot a fireball but only 1 per projectile for the usual burst. Ah well...
User avatar
wildweasel
change o' pace.
Moderator Team Lead
 
Joined: 15 Jul 2003


Return to Feature Suggestions

Who is online

Users browsing this forum: No registered users and 0 guests