Tertiary and/or Quarternary Ammo Types
Moderator: GZDoom Developers
-
Exosphere
- Posts: 168
- Joined: Sun Jun 11, 2017 11:42 am
- Location: New England, US
Tertiary and/or Quarternary Ammo Types
This might be a pipe dream, or something that would've already been included in the past, but I wonder if it would be possible to have one or two other AmmoTypes, making the total amount of ammo types weapons could use to 3 or 4. This would be helpful with users who are making weapons that use more than two ammo types. They would function exactly the same as AmmoType, AmmoType2, and the other related Weapon Decorate functions.
-
Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Tertiary and/or Quarternary Ammo Types
The code would require a bit of a workover to allow more than two ammo types. It was sadly written without any flexibility in mind 12 years ago...
-
Exosphere
- Posts: 168
- Joined: Sun Jun 11, 2017 11:42 am
- Location: New England, US
Re: Tertiary and/or Quarternary Ammo Types
BummerGraf Zahl wrote:The code would require a bit of a workover to allow more than two ammo types. It was sadly written without any flexibility in mind 12 years ago...
Shame the code isn't more easier to work with, but still, thank you for the response Graf.
-
Apeirogon
- Posts: 1606
- Joined: Mon Jun 12, 2017 12:57 am
Re: Tertiary and/or Quarternary Ammo Types
a_takeinventory and countinv can emulate this feature even if you want use >9000 types of ammo.
But yeah, this require more line of code and work than simple a_spawnprojectile.
But yeah, this require more line of code and work than simple a_spawnprojectile.
-
Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Tertiary and/or Quarternary Ammo Types
You can use this to have a different ammo type, but what it doesn't do is the internal checks to auto-switch from empty-weapons.
-
Ultimate Freedoomer
- Posts: 235
- Joined: Fri Jan 30, 2015 10:32 pm
- Location: Pittman Center
Re: Tertiary and/or Quarternary Ammo Types
I thought of a way without completely rewriting it:
As any DECORATE coder worth their salt knows, we have the following for ammo consumption:
As any DECORATE coder worth their salt knows, we have the following for ammo consumption:
- WEAPON.AMMO_OPTIONAL
- WEAPON.ALT_AMMO_OPTIONAL
- WEAPON.AMMO_CHECKBOTH
- WEAPON.PRIMARY_USES_BOTH
- WEAPON.ALT_USES_BOTH
- Weapon.AmmoGive1
- Weapon.AmmoGive2
- Weapon.AmmoType1
- Weapon.AmmoType2
- Weapon.AmmoUse1
- Weapon.AmmoUse2
- WEAPON.AMMOX_OPTIONAL (so you can specify what ammo types are optional or required beyond types 1 & 2)
- WEAPON.AMMO_CHECKALL (used like WEAPON.AMMO_CHECKBOTH on weapons that have 3 or more ammo types assigned to them)
- WEAPON.PRIMARY_USES_AMMOX (So you can make primary use that weapon’s ammo 2 or 3, for example)
- WEAPON.ALT_USES_AMMOX (So you can do the same with alt fire. These would mostly be useful with magazine counters on weapons where both firemodes need to be reloaded into separate clips, like when dual wielding)
- Weapon.AmmoGivex (the “weapon.ammogive” flag for assigned ammo types 3 onwards.)
- Weapon.AmmoTypex (same as “AmmoGivex”, except it determines the actual ammo actor for that ammo number in that weapon)
- Weapon.AmmoUsex (same as “AmmoGivex”, except it determines the amount of ammo used for that ammo actor by that weapon)