id Tech Forums

id Tech 4 (Doom3/Prey/Q4) => id Tech 4 Scripting => Topic started by: Balistine on February 01, 2021, 03:35:46 PM

Title: Regenerate A Specific Custom Ammo Type When Weapon is Idle
Post by: Balistine on February 01, 2021, 03:35:46 PM
Hi, I am completely new to modding Doom 3 and scripting in general. I need a way to recharge a custom ammo type when the weapon is in its idle state. How can I go about doing that?
Title: Re: Regenerate A Specific Custom Ammo Type When Weapon is Idle
Post by: The Happy Friar on February 04, 2021, 07:34:27 AM
Easiest way would be to spawn ammo pickups at your location every X seconds while in idle function in the script.  Then the player would pickup the ammo as long as you need more.
EDIT: check out the weapon grenade script in my mod here: https://www.moddb.com/mods/the-happy-friars-last-stand/downloads/the-happy-friars-last-stand-v12-beta-2
when you explode the grenade in your hand it spawns a med kit at your location.  You'd want something similar, but spawns ammo vs med kits.