Page 1 of 1

How to add grenades for mods without grenades?

PostPosted: Sat Mar 20, 2021 6:26 am
by doomos
Windows 10 Home SP3 with GZDoom g4.5.0.

I like to play original Doom games with the Supercharge mod.

Last time I checked, I understood that this mod, similarly to other possible minimalist mods (which I can define as mods which keeps the game pretty much vanilla but improve existing mechanics and graphics a bit) doesn't include grenades.

How to add grenades for mods without grenades? Is there a "grenade module" which is generally "mod-agnostic" (not adjusted to a particular mod) for that sake?

Thanks,

Re: How to add grenades for mods without grenades?

PostPosted: Sat Mar 20, 2021 8:22 am
by Jarewill
Would something like this work?

To make a universal mod like this, you'll have to add an item to the player's inventory without changing the player class. ZScript or ACS can do that.
The item itself would be better with just having infinite ammo and a cooldown between throws rather than limited ammo, since replacing ammo pickups can mess with other mods.
And personally I would not add any new sprites or animations, since different sprites can clash with each other. Instead I used the rocket ammo pickup sprite and just rolled it around.

The cooldown is shown with the Inventory.Icon in the upper right corner. I know ZScript has a way of drawing stuff on screen without replacing the HUD, but I don't know of it.
I'm not a fan of adding special binds for grenades, but that will be a better thing than adding the item to the inventory bar. Some mods might break with that.

Finally, I haven't done proper testing with this, since I don't have a lot of time currently, so please report any issues.

Edit: Fixed grenades not exploding on liquids. (Hopefully)
Updating this post too in case anyone wants the cooldown version.

Re: How to add grenades for mods without grenades?

PostPosted: Sun Mar 21, 2021 8:06 am
by doomos
Hello Jarewill, so nice to get this reply from you with a nice modular supplement such as this.

Just a note, I am a humble webmaster that in all that has to do with "computer behavior languages" working primarily with Bash and secondarily with JavaScript so I don't know anything about game development.

The main issues I can report are:

* There is no amount counter to indicate finite or infinite amount.
* I think it should be topped up to 4 units with an amount counter
* I think the Doomguy should start with half of the maximal amount, in each episode start
* Doomguy should be able to add grenades from backpacks
* UPDATE: Grenade didn't explode when thrown on acid (green)

The rest is pretty much cosmetic, I assume.

Again my appreciation. Maybe in the future some developers would also contribute 2 other nice modules --- a kick module and a machete module (just an idea sharing; I just so like modularity in generally every aspect of development).

Doomos,

Re: How to add grenades for mods without grenades?

PostPosted: Wed Mar 24, 2021 12:31 pm
by Jarewill
Sorry for the late answer, but I didn't see the reply before.
I applied the suggestions into this file. The ammo for it should appear in the inventory bar. (If a HUD doesn't have it, then it won't show. Both default Doom HUD and ZDoom HUD have inventory bars.)
The previous one had unlimited ammo and a cooldown between throws, the cooldown should have appeared in the upper right corner.
Now, I wasn't able to replicate the issue with grenades not exploding on liquids, but I added a flag and hopefully that fixed it.

doomos wrote:a kick module

Fun you mention that, because I have made a quick kick mod before. It can be found here.
It was originally made for NTMAI, but it works with other mods just fine.

Re: How to add grenades for mods without grenades?

PostPosted: Sat Mar 27, 2021 9:23 am
by doomos
Very nice indeed,

As a small side question, because we are discussing modularity deeply here;
What do you think about the idea of suggesting some "Doom modding standards" that would emphasize the benefit of making things modular as with:

  • Grenade mod: standard key --- G?
  • Kick mod: standard key --- Q?
  • Machete mod: standard key --- F?
  • Sliding mod (I personally find the sliding mechanics in Hellrider terrific): standard key --- V?
  • Flashlight mod: standard key ---X?

Of course, one could discuss more complicated standardization about harsher bullets ("secondary fire") as activated by Z key and as separated from weapon zooming (generally activated by mouse right button) but I wouldn't say it is as trivial as the aspects above; also, one could further discuss topics such as porting for mobile devices with virtual keyboards, etc.

Of course, I am just fantasizing and sharing ideas for possible future implementation/initiative here.

Re: How to add grenades for mods without grenades?

PostPosted: Sun Mar 28, 2021 9:26 pm
by doomos
Oh and one more suggestion for the Grenade mod after I've recently played the first two levels of "No Rest for the Living" (NERVE.WAD):

While playing I went through lots of secrets but didn't find backpacks; perhaps it is a good idea to give Doomguy 4 grenades instead 2 on start, just in case someone plays a WAD with no or very few backpacks.

Re: How to add grenades for mods without grenades?

PostPosted: Sun Mar 28, 2021 11:33 pm
by Jarewill
doomos wrote:While playing I went through lots of secrets but didn't find backpacks; perhaps it is a good idea to give Doomguy 4 grenades instead 2 on start, just in case someone plays a WAD with no or very few backpacks.

You can edit the mod further to your liking by opening it with SLADE and modifying the ZScript file.
For example: Line 9 of the ZScript file can be changed to change how many grenades the player starts with:
Code: Select allExpand view
e.Thing.GiveInventory("GrenadeItem",2); //Change 2 to any number