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.
yum13241
Posts: 780
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
Contact:

Re: RRWM reloading system [1.3.0.1] [ZS/DEC/SBARINFO]

Post by yum13241 »

Thanks for your answer, but I have another problem:

My weapon visually disappears if it goes into the DryFire: state sequence if the user was holding fire.

BDL_Weapon:
Spoiler:


BDL_Pistol:
Spoiler:


Is this related to the use of ####?
User avatar
Player701
 
 
Posts: 1636
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support
Contact:

Re: RRWM reloading system [1.3.0.1] [ZS/DEC/SBARINFO]

Post by Player701 »

yum13241 wrote: Mon Feb 20, 2023 5:58 amIs this related to the use of ####?
No, it isn't: the problem is that you don't have a control flow statement/function call (e.g. A_Jump, Goto etc.) at the end of your DryFire state sequence, so when control reaches the last state it presumably gets treated as if there were a Stop. Although I'm not sure if the latter is indeed the case, it doesn't really matter because you do need to jump somewhere regardless, preferably to the ready state.
yum13241
Posts: 780
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
Contact:

Re: RRWM reloading system [1.3.0.1] [ZS/DEC/SBARINFO]

Post by yum13241 »

I did that and it doesn't work. In both scenarios, when you release fire and then fire again, it works properly.
User avatar
Player701
 
 
Posts: 1636
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support
Contact:

Re: RRWM reloading system [1.3.0.1] [ZS/DEC/SBARINFO]

Post by Player701 »

Please post the updated code then.
yum13241
Posts: 780
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
Contact:

Re: RRWM reloading system [1.3.0.1] [ZS/DEC/SBARINFO]

Post by yum13241 »

BDL_Pistol:
Spoiler:


BDL_Weapon:
Spoiler:
User avatar
Player701
 
 
Posts: 1636
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support
Contact:

Re: RRWM reloading system [1.3.0.1] [ZS/DEC/SBARINFO]

Post by Player701 »

With the code you've provided, I'm unable to make the weapon disappear entirely for me. But I've just noticed something else: namely, the state where you call A_ReFire has TNT1 as the sprite name. Since your DryFire starts with "####", this might be a problem. I'd recommend against combining TNT1 and ####.
yum13241
Posts: 780
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
Contact:

Re: RRWM reloading system [1.3.0.1] [ZS/DEC/SBARINFO]

Post by yum13241 »

Sorry for a very late reply, but your solution works.
yum13241
Posts: 780
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
Contact:

Re: RRWM reloading system [1.3.0.1] [ZS/DEC/SBARINFO]

Post by yum13241 »

Sorry to bother you (again) but I have a weird error.
Script error, "BD_LITE_1.0.pk3:bdl/actors/weapons/bdlweapon.zs" line 40: Call to member function CheckClick with incompatible self pointer.

I don't see self. anywhere!


BDL_Weapon:
Spoiler:
User avatar
Player701
 
 
Posts: 1636
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support
Contact:

Re: RRWM reloading system [1.3.0.1] [ZS/DEC/SBARINFO]

Post by Player701 »

Should either be action(Weapon) void CheckClick (self is PlayerPawn), or replace CheckClick(); with invoker.CheckClick(); (self is the weapon instance).
yum13241
Posts: 780
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
Contact:

Re: RRWM reloading system [1.3.0.1] [ZS/DEC/SBARINFO]

Post by yum13241 »

Sorry to bother, but how would I make https://github.com/3saster/fullscrn_huds compatible with your reloading system?


BTW, the standalone HUD package doesn't work with your own reloading system.
User avatar
Player701
 
 
Posts: 1636
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support
Contact:

Re: RRWM reloading system [1.3.0.1] [ZS/DEC/SBARINFO]

Post by Player701 »

yum13241 wrote: Fri Mar 24, 2023 1:05 pm Sorry to bother, but how would I make https://github.com/3saster/fullscrn_huds compatible with your reloading system?
There is an example ZScript-based HUD provided with the library, which you can learn from, but I'm afraid I can't help much with integrating the code into third-party mods - especially this particular one, as I've never seen its code before. But it should be simple: first, you have to check if the current weapon is reloadable, and if it is, call GetClipAmount to retreive the amount of ammo left in the magazine, then draw it somewhere on the screen (See the last paragraph of p.5 in the manual).

Keep in mind that the very nature of the system's implementation makes it poorly suitable for integration with standalone HUD mods. Generic HUDs usually support only what the engine itself supports by default - that is: primary and secondary ammo. Beyond that, as far as I know, it's all mod-dependent - so the HUD code has to be written specifically to allow for any extra icons/counters to be displayed when needed, and that would automatically make it incompatible with anything else.
yum13241 wrote: Fri Mar 24, 2023 1:05 pm BTW, the standalone HUD package doesn't work with your own reloading system.
You're right, but that's by design - see what I've said just above your quote. The standalone RRWM HUD package does not have any code to handle reloadable weapons because it's intended for generic use. It is a non-trivial task to make it work the way you want it to, and it mostly boils down to the same issues we've already discussed before.
yum13241
Posts: 780
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
Contact:

Re: RRWM reloading system [1.3.0.1] [ZS/DEC/SBARINFO]

Post by yum13241 »

Player701 wrote: Generic HUDs usually support only what the engine itself supports by default - that is: primary and secondary ammo. Beyond that, as far as I know, it's all mod-dependent - so the HUD code has to be written specifically to allow for any extra icons/counters to be displayed when needed, and that would automatically make it incompatible with anything else.
I can do what you did and just override the Ammo counter on the left.
User avatar
Player701
 
 
Posts: 1636
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support
Contact:

Re: RRWM reloading system [1.3.0.1] [ZS/DEC/SBARINFO]

Post by Player701 »

yum13241 wrote: Sat Mar 25, 2023 12:46 amI can do what you did and just override the Ammo counter on the left.
You could, but I only did it for the status bar because there is not enough space to display both counters at the same time. Ideally, the magazine counter should complement the ammo counter, not replace it.
yum13241
Posts: 780
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
Contact:

Re: RRWM reloading system [1.3.0.1] [ZS/DEC/SBARINFO]

Post by yum13241 »

You have the right side for your ammo. You in theory could've replaced Doomguy's head but that would be blasphemy.

I'll consider what you wrote.

Why does making/modifiying a HUD have to be so hard?
User avatar
Player701
 
 
Posts: 1636
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support
Contact:

Re: RRWM reloading system [1.3.0.1] [ZS/DEC/SBARINFO]

Post by Player701 »

yum13241 wrote: Sat Mar 25, 2023 5:11 amYou in theory could've replaced Doomguy's head but that would be blasphemy.
Agreed. :P
yum13241 wrote: Sat Mar 25, 2023 5:11 am Why does making/modifiying a HUD have to be so hard?
You can still use SBARINFO if you find ZScript too difficult for you to handle.
Post Reply

Return to “Script Library”