A_CheckReload equivalent when ammo not empty?
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
A_CheckReload equivalent when ammo not empty?
Is there some way to trigger an A_CheckReload "switch to highest priority weapon" change even if the player isn't out of ammo?
Before someone mentions it, A_SelectWeapon isn't what I'm looking for since it requires a specific weapon name.
Before someone mentions it, A_SelectWeapon isn't what I'm looking for since it requires a specific weapon name.
- NeuralStunner
-

- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: A_CheckReload equivalent when ammo not empty?
A_CheckReload also doesn't seem to work if the weapon is empty but flagged for optional ammo. I don't know of any alternative, but I sure would like one too.
(Something something "just" [convoluted hack])
(Something something "just" [convoluted hack])
Re: A_CheckReload equivalent when ammo not empty?
If it doesn't exist, it's probably something I'll code up. Just checking first to make sure I don't dupe it. 
- DoomRater
- Posts: 8270
- Joined: Wed Jul 28, 2004 8:21 am
- Preferred Pronouns: He/Him
- Location: WATR HQ
- Contact:
Re: A_CheckReload equivalent when ammo not empty?
I can think of a particular use for A_SelectWeapon that makes it go to previously selected weapon, or to select a certain priority instead. Consider extending A_SelectWeapon for these functions instead?Xaser wrote:Is there some way to trigger an A_CheckReload "switch to highest priority weapon" change even if the player isn't out of ammo?
Before someone mentions it, A_SelectWeapon isn't what I'm looking for since it requires a specific weapon name.
- NeuralStunner
-

- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: A_CheckReload equivalent when ammo not empty?
That's a possibility. An extra parameter could specify the mode:
- Previous (like weapprev)
- Next (like weapnext)
- Best (lowest SelectionOrder)
- Worst (highest SelectionOrder)
- DoomRater
- Posts: 8270
- Joined: Wed Jul 28, 2004 8:21 am
- Preferred Pronouns: He/Him
- Location: WATR HQ
- Contact:
Re: A_CheckReload equivalent when ammo not empty?
If we keep track of the last weapon seclected, I'd like to recall that too. Greaser Enhanced keeps track of this internally and then specifically calls the last weapon selected, but boy is that a mess for quick weapons. I know there's now a better way to do it- embed the weapon on another layer. But that didn't exist back when I made it and it's so dependent on knowing what weapons are in a modpack, where it would be really nice to make it so that a quick weapon switch doesn't depend on the modder knowing every weapon present to make it work.
Re: A_CheckReload equivalent when ammo not empty?
For the sake of syntactic sanity, I'd probably make it a new action function so you don't have a bum extra parameter... or A_SelectWeaponEx. D:
"Last Selected" is a neat idea that doesn't seem like it'd be that hard to add in theory. Speaking without looking, though.
"Last Selected" is a neat idea that doesn't seem like it'd be that hard to add in theory. Speaking without looking, though.
Re: A_CheckReload equivalent when ammo not empty?
Maybe filter to select only weapons that are derived from the specified weapon class (e.g. best weapon inheriting from shotgun)?NeuralStunner wrote:Though the question is how it should behave if the given class name isn't null ("").
This is where overloading would come in handyXaser wrote:For the sake of syntactic sanity, I'd probably make it a new action function so you don't have a bum extra parameter... or A_SelectWeaponEx. D:
- zrrion the insect
- Posts: 2432
- Joined: Thu Jun 25, 2009 1:58 pm
- Location: Time Station 1: Moon of Glendale
Re: A_CheckReload equivalent when ammo not empty?
Prioritize that weapon over all other weapons. If the player does not have that weapon, then look at the other args to see what to switch to.NeuralStunner wrote:Though the question is how it should behave if the given class name isn't null ("").
