Author Topic: Ammo system  (Read 3206 times)

The title says it all, I'd like an ammo system to balance out all the wepons, when you run out of ammo, you just discard the weapon you were using (can't pick it up again).

That would require RADICAL CHANGES to each weapon, a big project.
Maybe if the admin had a window with a list of all avalible items and an editable number of uses...

fishpen0

  • Guest
Or you could have clips...and make a minigame option that requires you to pick up clips after a certain number if shots...but I don't really like the idea....

good idea.
this would be best for the minigun, becouse right now I think people have a rock on the trigger button.

The minigun shouldn't run out of ammo, it should overheat and not be able to fire for a while.

That would require RADICAL CHANGES to each weapon, a big project.
Maybe if the admin had a window with a list of all avalible items and an editable number of uses...
You don't seem to know a lot about coding, it wouldn't be hard at all, all you have to do is add some variables and if statements.
I haven't done much coding, but basically all you have to do is add a statment saying what the ammo is, and every time it fires count down, and if the counter reaches 0 then the wepon is removed from your inventory. Simple.

R-R-R-RADICAL CHANGES.

Sounds like a good idea. Would be useful for the zombie mod that someone has been ignoring lately.

   // Images have a state system which controls how the animations
   // are run, which sounds are played, script callbacks, etc. This
   // state system is downloaded to the client so that clients can
   // predict state changes and animate accordingly.  The following
   // system supports basic ready->fire->reload transitions as
   // well as a no-ammo->dryfire idle state
.

Should be quite easy to implement... Unless the Ammo system has been edited. The Rocket Launcher seems to have an ammo system in it but when I try to add a RocketAmmo item and using some code from the TGE Demo's Crossbow, it ignores ammo completely.
« Last Edit: May 02, 2007, 10:51:00 AM by Space Guy »

Well you could make a statescript in the thingey where it would be like this:

Code: [Select]
Function Gunfire(%ammo)
{
if(%ammo == 0)
{
return();
}
else
{
Fire the weapon
%ammo = %ammo - 1;
}
}

Very rough code

Code: [Select]
function WeaponImage::onFire(%this, %obj, %slot)
{
if(%obj.[%this]ammo $= ""){
%obj.[this]ammo = %this.ammo; //If you have not fired yet, reset the ammo to "ammo =" in the datablock
}
if(%obj.[%this]ammo == 0){
return;
}
%obj.[%this]ammo--;
parent::onFire(%this, %obj, %slot);
}

Or if you wanted it constant for every weapon, and not have to change it all, just change the "%obj.[this]ammo = %this.ammo;" to "%obj.[this]ammo = #;"
« Last Edit: May 02, 2007, 08:33:16 PM by Aloshi »

Well I was close.
« Last Edit: May 03, 2007, 07:32:38 PM by 1529op »

ok idea, but i think the guns are ok as they are.