Custom Ammo System

Custom Ammo System has been my pet project for some months now, it’s a simple system for allowing custom ammo types, and creating weapons easily.
Each weapon just defines some constants about it, which then get used by the base weapon to reload, fire, and then do damage.

Custom Ammo System is split into 3 addons,
the Core, which is the ammo system, the base weapon, and a sample weapon.
the Basic Weapons, which are versions of the pistol, magnum, and smg.
the Powerful Weapons, which are overpowered weapons, such as the dopple, repulsor, or heavy.

They can be downloaded:
Version 1.2
http://www.garrysmod.org/img/?t=dll&id=77994
Version 1.1
http://www.garrysmod.org/img/?t=dll&id=77575
Version 1.0
http://www.garrysmod.org/img/?t=dll&id=77423

Adding a weapon is simple, copy the sample weapon from the Core addon, and then edit the constants (the file contains descriptions).

Any client can set their ‘autoreload’ flag using “cammo_autoreload 0” (or 1), if 0 (default) you can only reload manualy, if 1, that, or when you try to fire and are out of ammo.

PLEASE DO NOT REUPLOAD THIS.
You can upload addons that contain weapons for this, as long as you don’t reupload any part of the ammo system or base weapon.

sorry about all the information, and the fact I don’t have any screenshots.

sounds good.

I have been looking for something like this.
Even almost got to the point of making one myself.

Very useful thanks!

Custom heavy ammo that reduces speed of you? That’s an idea you could work on.

Yes, well, the problem is that ammo types are dynamically allocated when you equip a weapon that uses it, so you can’t add a parameter to ammo types very well.

I could, however, have prefixes before the ammo names, such as (H) which would mean heavy ammo.

Does anyone think that’s a good idea?

Yes. That would give it another dimension of features that hopefully won’t over-complicate things.

[editline]12:29AM[/editline]

!!! A brilliant idea has just struck me: Infinite Regenerative Ammo. It obviously means that the gun has however much ammo you want it to have, but once you use it, it will come back at a set rate and ammount. i.e, For a quick-firing SMG you could have a max ammo cap of, say, 50. You shoot about 10 rounds. A half-second later (or less), the ammo counter starts its count back up to 50, perhaps finishing within a time of about one second. For a heavier gun, such as a Shotgun or the like, you empty a mag of 7 shells, then it starts to refill after three seconds or something, and each shells’ regen time could be a little hefty, like 3/4ths of a second, as opposed to weaker single bullets, which would be much faster, like 1/16 of a second.

Hopefully that made sense. How you would do this, I have a small inkling of an idea. Just make some more tables that you choose whether or not to use, and that control ammo regen time. What do you think of that?

Sounds good, I’ll start work on that tomorrow, I gotta get to bed (9:51 here)

OK, progress update:
[ul]
[li]Fixed some secondary-fire things[/li][li]Fixed the resulting bugs[/li][li]Created (But not tested) Infinite Ammo Idea[/li][li]Testing Heavy Ammo[/li][li]Newer:[/li][li]Fixed the fact that heavy ammo can make you have negative speed[/li][li]Decreased the amount that ammo slows you down[/li][li]Now testing infinite ammo idea[/li][li]Newer 2:[/li][li]Finished testing Heavy Ammo![/li][li]Bug in infinite ammo, that when you switch to a different weapon, then back, the ammo display keeps flopping between maximum, and the current amount, trying to fix.[/li][li]Newest[/li][li]Infinite ammo bug fixed[/li][li]Posting release 1.1[/li][/ul]

Is that what your looking for, Tsachi?

(The infinite ammo)

Someone should make a swep that goes with that regenerative ammo, like a laser pistol, i.e. the dispersion pistol from unreal with an effect and everything.

So this is weapons that support several ammo types, like Normal, Armour-piercing, incendiary, etc?

Hmm… seems to doesn’t working on dedicated server… gonna try on listen…

Working without any sound, and:

OMG

Well, not different damage types, this lets you create ammo types like “mysuperoverpoweredgunsammotype”, which you can’t do with regular sweps easily.

I haven’t tried it on a dedicated server, since I don’t have a good computer for a dedicated.
EDIT: If you can get me the errors, I’ll try to fix it.

Well, the sound was there last I checked, but I’ll check again.
EDIT: Ok, sound works fine for me, do any weapons play sounds for you? (not Custom Ammo)

Woops, forgot to get rid of the debugging messages, posting fix soon…

Well, I just (and I mean just) finished a little assault rifle SWEP with the cammo system, and I look here and discover that I’ll have to do it again with the new version… And so far, the infinite ammo system sounds like it slightly missed the mark, so I’ll have to try it out to see if it does what I suggested…

And I can’t believe you actually tried to do it! Very cool. So, I’ll test the new version out now.

[editline]08:28PM[/editline]

By George, you’ve done it!!! I think. Could you script up a weapon that does regenerate, and that uses the 1-through-6 system thingy that you made?

1-through-6 system thingy?
Could you explain?
I don’t remember any 1-through-6 thingy.