RRWM reloading system [1.5.0] [ZS/DEC/SBARINFO]
Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.
Got a cool project idea but nothing else? Put it in the project ideas thread instead!
Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.
Please read the full rules for more details.
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.
Got a cool project idea but nothing else? Put it in the project ideas thread instead!
Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.
Please read the full rules for more details.
-
-
- Posts: 1684
- Joined: Wed May 13, 2009 3:15 am
- Graphics Processor: nVidia with Vulkan support
Re: RRWM reloading system [1.3.0a] [ZS/DEC/SBARINFO]
No, you will get a VM abort if you do that, and removing the code that triggers it will almost surely result in all kinds of unexpected behavior and/or errors (e.g. division by zero).
-
- Posts: 225
- Joined: Fri Jan 30, 2015 10:32 pm
- Location: Pittman Center
Re: RRWM reloading system [1.3.0a] [ZS/DEC/SBARINFO]
Are you referring to setting the capacity to a null value or making the secondary fire use a normal ammo actor?
-
-
- Posts: 1684
- Joined: Wed May 13, 2009 3:15 am
- Graphics Processor: nVidia with Vulkan support
Re: RRWM reloading system [1.3.0a] [ZS/DEC/SBARINFO]
The former, although not null but rather zero or negative.Ultimate Freedoomer wrote: ↑Tue Jan 17, 2023 10:35 pm Are you referring to setting the capacity to a null value or making the secondary fire use a normal ammo actor?
-
- Posts: 853
- Joined: Mon May 10, 2021 8:08 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): EndeavorOS (basically Arch)
- Graphics Processor: Intel with Vulkan/Metal Support
Re: RRWM reloading system [1.3.0a] [ZS/DEC/SBARINFO]
Quick question: If I want a weapon to use the same type of ammo as all other bullet weapons (pistol, chaingun), is it OK if I do this?
Class RClip : ReloadableAmmo replaces Clip { Default { Inventory.MaxAmount 200 } }
Or will this break other weapons?
Class RClip : ReloadableAmmo replaces Clip { Default { Inventory.MaxAmount 200 } }
Or will this break other weapons?
-
-
- Posts: 1684
- Joined: Wed May 13, 2009 3:15 am
- Graphics Processor: nVidia with Vulkan support
Re: RRWM reloading system [1.3.0a] [ZS/DEC/SBARINFO]
There is no limitation that a single ammo type can only be used by one weapon. You can share ammo types between weapons without any issues.
-
- Posts: 853
- Joined: Mon May 10, 2021 8:08 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): EndeavorOS (basically Arch)
- Graphics Processor: Intel with Vulkan/Metal Support
Re: RRWM reloading system [1.3.0a] [ZS/DEC/SBARINFO]
What I mean is that will the vanilla pistol for example break with the code snippet above?
-
-
- Posts: 1684
- Joined: Wed May 13, 2009 3:15 am
- Graphics Processor: nVidia with Vulkan support
Re: RRWM reloading system [1.3.0a] [ZS/DEC/SBARINFO]
No, it won't, but it will still use the original Clip ammo type.
-
- Posts: 853
- Joined: Mon May 10, 2021 8:08 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): EndeavorOS (basically Arch)
- Graphics Processor: Intel with Vulkan/Metal Support
Re: RRWM reloading system [1.3.0a] [ZS/DEC/SBARINFO]
What if I replaced the pistol and made it use my new clip?
-
-
- Posts: 1684
- Joined: Wed May 13, 2009 3:15 am
- Graphics Processor: nVidia with Vulkan support
Re: RRWM reloading system [1.3.0a] [ZS/DEC/SBARINFO]
As I've said before, sharing ammo types between weapons is a perfectly valid scenario. It doesn't matter whether any of these weapons are reloadable. ReloadableAmmo does not contain any magic to support reloading by itself, and can be used with normal weapons too. It's largely a hack of sorts to prevent the player from automatically switching to a reloadable weapon when there's really no need to - there is one particular case the engine does not handle properly.
-
- Posts: 853
- Joined: Mon May 10, 2021 8:08 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): EndeavorOS (basically Arch)
- Graphics Processor: Intel with Vulkan/Metal Support
-
- Posts: 225
- Joined: Fri Jan 30, 2015 10:32 pm
- Location: Pittman Center
Re: RRWM reloading system [1.3.0a] [ZS/DEC/SBARINFO]
so I’ll use the normal ammo actors to handle altfire not using the clip. What about my answers to the other 3 questions?Player701 wrote: ↑Tue Jan 17, 2023 11:56 pmThe former, although not null but rather zero or negative.Ultimate Freedoomer wrote: ↑Tue Jan 17, 2023 10:35 pm Are you referring to setting the capacity to a null value or making the secondary fire use a normal ammo actor?
-
-
- Posts: 1684
- Joined: Wed May 13, 2009 3:15 am
- Graphics Processor: nVidia with Vulkan support
Re: RRWM reloading system [1.3.0a] [ZS/DEC/SBARINFO]
Those questions were examples of what you should ask yourself before starting to edit the code, so that you have a clear picture of how your modifications are supposed to work. I don't know what else to say because you didn't ask me to clarify anything.Ultimate Freedoomer wrote: ↑Wed Jan 18, 2023 7:24 pm What about my answers to the other 3 questions?
-
-
- Posts: 1684
- Joined: Wed May 13, 2009 3:15 am
- Graphics Processor: nVidia with Vulkan support
Re: RRWM reloading system [1.3.0.1] [ZS/DEC/SBARINFO]
RRWM reloading system has been updated to version 1.3.0.1. Download the new release HERE. The link in the first post has been updated too.
This version adds the following convenience features:
This version adds the following convenience features:
- ZScript only: IsFullClip method for ReloadableWeapon to easily check if the clip is full. Previously, you had to compare GetClipAmount() with GetClipCapacity() for that.
- ZScript and DECORATE: Jump functions A_JumpIfClipAmount and A_JumpIfFullClip. Although they are available in both ZScript in DECORATE, usage of the former makes them redundant, and A_JumpIf should be used instead. Please refer to the manual (or the first post in this thread) for more info, search for "DECORATE jump functions". Thanks to Ultimate Freedoomer for the idea.
-
- Posts: 853
- Joined: Mon May 10, 2021 8:08 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): EndeavorOS (basically Arch)
- Graphics Processor: Intel with Vulkan/Metal Support
Re: RRWM reloading system [1.3.0.1] [ZS/DEC/SBARINFO]
I have a problem:
When I use this code, it's possible for the weapon to "fire" visually, when there's no ammo.
BDL_Weapon
BDL_Pistol:
When I use this code, it's possible for the weapon to "fire" visually, when there's no ammo.
BDL_Weapon
Spoiler:
BDL_Pistol:
Spoiler:
-
-
- Posts: 1684
- Joined: Wed May 13, 2009 3:15 am
- Graphics Processor: nVidia with Vulkan support
Re: RRWM reloading system [1.3.0.1] [ZS/DEC/SBARINFO]
Sorry for a somewhat late reply.
First of all, there is no DryReload state, this state label does not actually do anything.
And to fix your issue, you need to change A_ReFire("Fire") to just A_ReFire. This is necessary because if you pass a state label to A_ReFire, there is no way to override it from weapon code. I suppose I haven't mentioned that in the manual, so I'll fix it when I have the time.
First of all, there is no DryReload state, this state label does not actually do anything.
And to fix your issue, you need to change A_ReFire("Fire") to just A_ReFire. This is necessary because if you pass a state label to A_ReFire, there is no way to override it from weapon code. I suppose I haven't mentioned that in the manual, so I'll fix it when I have the time.