RRWM reloading system [1.5.0] [ZS/DEC/SBARINFO]

Post your example zscripts/ACS scripts/etc here.
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.
User avatar
Player701
 
 
Posts: 1640
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support

Re: RRWM reloading system [1.3.0a] [ZS/DEC/SBARINFO]

Post by Player701 »

You can put it anywhere you want, as long as it is #included into your ZScript lump.
Ultimate Freedoomer
Posts: 222
Joined: Fri Jan 30, 2015 10:32 pm
Location: Pittman Center

Re: RRWM reloading system [1.3.0a] [ZS/DEC/SBARINFO]

Post by Ultimate Freedoomer »

So, can you meet me in PMs? I'm trying to add support for a secondary clip. & I have no idea what isn't working.
User avatar
Player701
 
 
Posts: 1640
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support

Re: RRWM reloading system [1.3.0a] [ZS/DEC/SBARINFO]

Post by Player701 »

Regarding your PM and modding this library in general: I've already said in the first post that the latter might be a non-trivial task, especially if you want to go as far as adding a second reload. I will therefore reiterate that while you are free to edit the provided code in any way you wish (the only requirement being that you credit me as the original author), I cannot guarantee stable and/or correct behavior once sufficiently major changes have been introduced.

The system is guaranteed to work as designed - if you can prove otherwise, I will investigate and try to fix the issue. For modded versions, however, all bets are off because the code is huge, and a large number of changes is likely to have significant, often unexpected consequences. As such, I really wish I could help, but I simply don't have enough time for debugging, especially when I don't have a clear vision of how the altered code is supposed to work in the first place. Sorry about that.
yum13241
Posts: 781
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]

Post by yum13241 »

You could check to see if the player is pressing altfire, and if so, go to an offset Fire state or something.
User avatar
Player701
 
 
Posts: 1640
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support

Re: RRWM reloading system [1.3.0a] [ZS/DEC/SBARINFO]

Post by Player701 »

It's not nearly that easy because there's a lot going on under the hood besides state selection.
Ultimate Freedoomer
Posts: 222
Joined: Fri Jan 30, 2015 10:32 pm
Location: Pittman Center

Re: RRWM reloading system [1.3.0a] [ZS/DEC/SBARINFO]

Post by Ultimate Freedoomer »

Player701 wrote: Tue Jan 10, 2023 12:46 am Regarding your PM and modding this library in general: I've already said in the first post that the latter might be a non-trivial task, especially if you want to go as far as adding a second reload. I will therefore reiterate that while you are free to edit the provided code in any way you wish (the only requirement being that you credit me as the original author), I cannot guarantee stable and/or correct behavior once sufficiently major changes have been introduced.

The system is guaranteed to work as designed - if you can prove otherwise, I will investigate and try to fix the issue. For modded versions, however, all bets are off because the code is huge, and a large number of changes is likely to have significant, often unexpected consequences. As such, I really wish I could help, but I simply don't have enough time for debugging, especially when I don't have a clear vision of how the altered code is supposed to work in the first place. Sorry about that.
The altered code would've basically made it so secondary fire would work like primary fire in regards to reloading. This would mostly be for things like dual-wield reloads or both fire modes using a clip.
User avatar
Player701
 
 
Posts: 1640
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support

Re: RRWM reloading system [1.3.0a] [ZS/DEC/SBARINFO]

Post by Player701 »

It's still not that simple as just duplicating some parts of the code. Here are some of the issues that come to mind:
  1. How would you handle the scenario when some weapons in your mod use a secondary clip for alt-fire and others don't?
  2. What happens if the weapon uses the same ammo type for primary and secondary fire? Will it always use different clips for both, or only when its ammo types are different? Can this behavior be customized?
  3. How is the reload button supposed to work for separate clips? Should there be a separate reload button for the secondary clip?
  4. How would you handle auto-reloading for the secondary clip?
What I'm saying here is that before you start editing the code, you need to have clear answers to the above questions (and possibly several others too, as those are only the tip of the iceberg). Otherwise, whenever you find out that something isn't working as expected, it can get real messy real quick. I'd also advise perusing the flowchart, as it might help you understand the original implementation better, and you can also use it as a base to plan out your future modifications.
Ultimate Freedoomer
Posts: 222
Joined: Fri Jan 30, 2015 10:32 pm
Location: Pittman Center

Re: RRWM reloading system [1.3.0a] [ZS/DEC/SBARINFO]

Post by Ultimate Freedoomer »

To answer the questions:
  1. How does the system currently handle a weapon not using clips for primary fire in the event it still uses this setup?
  2. I'm hoping to make it so the secondary clip is just when it uses separate ammo types for both. I do hope to make the behavior customizable at some point, yes.
  3. The fire modes would only have separate reload states in the event they have separate reload animations (like an assault rifle & a grenade launcher). It'd jump to whichever is needed when the normal reload button is pressed (with order of state label activation being random if both are).
  4. I was trying to create separate reload action functions for the secondary clip, but now I realized it'd probably make more practical sense to just expand the existing reload action functions to account for both the primary & secondary clips.
User avatar
Player701
 
 
Posts: 1640
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support

Re: RRWM reloading system [1.3.0a] [ZS/DEC/SBARINFO]

Post by Player701 »

Ultimate Freedoomer wrote: Fri Jan 13, 2023 3:56 pmHow does the system currently handle a weapon not using clips for primary fire in the event it still uses this setup?
This is not supported, primary fire always uses the clip. It just wouldn't make sense otherwise.
yum13241
Posts: 781
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]

Post by yum13241 »

It's illogical. Otherwise why bother?

Here be dragons...
User avatar
Player701
 
 
Posts: 1640
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support

Re: RRWM reloading system [1.3.0a] [ZS/DEC/SBARINFO]

Post by Player701 »

The current setup is as follows:
  • Primary fire always uses the clip.
  • Secondary fire (if present) uses the clip as long as the ammo type is the same as the one used for primary fire. Otherwise, it draws directly from the ammo pool.
Personally, I don't see anything one might find illogical here. Making primary fire use the ammo pool directly wouldn't make sense because the weapon wouldn't be reloadable anymore.
yum13241
Posts: 781
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]

Post by yum13241 »

Personally, I don't see anything one might find illogical here. Making primary fire use the ammo pool directly wouldn't make sense because the weapon wouldn't be reloadable anymore.
The second sentence is what I called illogical if you tried.

There was a misunderstanding.
User avatar
Player701
 
 
Posts: 1640
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support

Re: RRWM reloading system [1.3.0a] [ZS/DEC/SBARINFO]

Post by Player701 »

Yeah, right, sorry about that. It's been a very busy week for me...
yum13241
Posts: 781
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]

Post by yum13241 »

No biggie.


I bet you have more important things to do right now.
Ultimate Freedoomer
Posts: 222
Joined: Fri Jan 30, 2015 10:32 pm
Location: Pittman Center

Re: RRWM reloading system [1.3.0a] [ZS/DEC/SBARINFO]

Post by Ultimate Freedoomer »

But anyway, I was thinking that not setting the clip capacity at all (or setting it to 0 or -1) would make it not draw from a clip. If push comes to shove, I could even make it so the mode that uses a clip draws from the reloadable ammo entity while the mode that doesn’t just draws from an ammo type that inherits from the base ammo actor.
Last edited by Ultimate Freedoomer on Sat Jan 14, 2023 10:28 pm, edited 1 time in total.

Return to “Script Library”