Page 1 of 1
Timed ammo depletion
Posted: Sun Nov 04, 2007 12:05 pm
by -Treetoad-
Once again, needing some help to get started on the basics of a mod. What i need is for a gun to be able to run out of ammo and be unusable after a period of time (3 minutes).
I had the idea to have a second projectile that is always firing, but again I have no way of knowing how to do this.
It also needs to be a plasma weapon since the ammo will need to be released one at a time.
Posted: Sun Nov 04, 2007 12:16 pm
by xzodia
i remember this being discussed a few months ago but i dont think a solution was found
Re: Timed ammo depletion
Posted: Sun Nov 04, 2007 12:43 pm
by Prey
-Treetoad- wrote:Once again, needing some help to get started on the basics of a mod. What i need is for a gun to be able to run out of ammo and be unusable after a period of time (3 minutes).
Try setting the ammo recharge value in the weap tag to -1.
Posted: Sun Nov 04, 2007 3:59 pm
by CaptainPoopface
Prey's idea is clever. I wonder if that works. If that doesn't work with ammo (can you set an Int16 to a negative number?), try it with overheating. Set the heat loss per second to a negative number, so that the gun overheats and never dissipates the heat. You'll have to tweak it to get the time limit you want.
If neither of those ideas work, you're in for a longer evening. Here's what I'd do:
Use a human gun. The magnum, let's say. Change the trigger to Automatic. Add a second projectile (invisible, no damage) and assign it to the same trigger and magazine as the first projectile. Give the magazine a capacity of 90. For the second projectile, set the rate of fire to 0.5 rounds per second (1 round every 2 seconds), and set the shots per burst to 90. Make your regular projectile deplete no ammo when fired.
The way I hope it works, you are firing an invisible projectile every two seconds that will deplete your ammo after 3 minutes. Once you push the trigger for the first time, the countdown begins. Ideally, you'll be able to pulse the trigger and squeeze in the regular rounds between those shots. I suspect it might not work, however, because in my experience, when two projectiles are mapped to the same trigger, the second projectile does not start firing until the first projectile has depleted its magazine (or you interrupt it by reloading). You also cannot set the R trigger to be semi-automatic for one magazine and automatic for the other, unfortunately.
You might be able to get away with the same method on a plasma weapon (second automatic invisible projectile continuously aging the gun) , since they don't have magazines.
Posted: Sun Nov 04, 2007 11:58 pm
by Prey
CaptainPoopface wrote:(can you set an Int16 to a negative number?)
Yes, as it's a signed data-type. If the value I'm talking about though is unsigned, UInt16, then no :\
Posted: Wed Nov 07, 2007 7:56 pm
by -Treetoad-
I had an idea that was similar to yours, but I need the time that the gun runs out and the time that the ball is destroyed to be at almost the exact second. If prey's idea works, that will save me a ton of effort. I will actually start working on my mod once I know that the entire thing can actually be done