Garry's Mod

Garry's Mod

70 ratings
Simple Customizable Pistol
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Weapon
Addon Tags: Fun, Roleplay
File Size
Posted
1.860 KB
3 Jan, 2019 @ 1:28pm
1 Change Note ( view )

Subscribe to download
Simple Customizable Pistol

In 1 collection by Constable Reginald
Simple Customizable Weapons
8 items
Description
An extremely customizable gun (using CSS's Glock) with console variables and sliders for fun, gameplay, experimentation, and learning for those new to lua scripting! (I still am, as there are far more options I want to get working, see below)

What this does:
  • Select the damage each bullet transmits. Pew pew! ("smallpistol_dmg")

  • Select the spread, given by the Vector (x/100, x/100, 0). Never miss, or fire like a potato. ("smallpistol_spread")

  • Select how fast the gun fires with rounds per minute (RPM). If set to 0, fire as quickly as you can click. As the formula for this is 60/RPM, I suggest either 0, or 60 (one shot per second) or significantly higher. I believe at most you can fire is 30 shots per second, which is why the slider is capped at 1800RPM ("smallpistol_rpm")

  • Choose the amount of force the bullet does when it kills a target, this unit is expressed in kg * inches per second ("smallpistol_force") Valve uses realistic grains and speeds to calculate how much force, but then add an exaggeration multiplier of 3.5 so that even pistols make ragdolls jerk around, so see what you like. This will require a restart as this creates its own ammo.

  • Adds the CS font for accurate kill icon, as well as the ability to completely customize the color of the kill icon. Or, for a surprise, set the variables ("smallpistol_killicon*") to -1 to randomize the kill icon color per session (yes, the ability to randomize none, one, or all four parameters of the color structure).

  • Right-click introduces "bullet time" (not really, you're moving slower too) so you can get those satisfying headshots and see just how far your overly powered bullet sends the target flying. Right-click again (if you've set it low, you may have to hold it) to restore time back to normal ("smallpistol_bullettime").

What this DOESN'T do:
  • Adhere to realistic bullet inventory. The clip would not accurately count, even when trying to "feed" the swep vanilla bullets while firing my custom bullets, the clip would stay "0" while the full count of ammo went down with each shot. It was weird, and I'm too dumb or too lazy to figure it out currently. I'm still hoping I can fix it to bring some more realism for those that want it.

  • "View punch" and recoil. I don't like the idea of coming up with some arbitrary formulas that might succeed in acheiving those, but is still "made up" and is based on rules that I ultimately have to decide on. View punch isn't valid on NPCs, which is where I'd eventually like to steer this anyhow.

  • Due to limitations within the SWEP structure itself, you can not change the force multiplier employed by the swep to extremely high numbers. Therefore, this weapon creates its own ammo within the game to fix that, but as a result, you're required to restart your session if you're changing the bullet force.

  • Have spawn icons. Apparently it's as easy as just throwing .png in vgui/entities, but I wanted this addon as light as possible. If it required anything outside of what I could type, I wasn't about to do it.

  • Have weapon select icons. I thought this could be done with finding the proper font like I did with the kill icon. I either couldn't figure it out and gave up, or forgot to fully try and research to see if I could figure it out on my own.

  • Coding for NPCs. I wish I knew, it's the one thing I've wanted to do since discovering I could make my own SWEPs, and extracting others that have has gotten me nowhere near closer to figuring it out. Maybe one day. Or someone smarter than me can build upon this and make it better.

The rest:

Pistol (Damage, Force, Spread, RPM, BulletTime)


Automatics (Damage, Force, Spread, RPM, BulletTime)


Close-Range (Damage, Pellets, Force, Spread, RPM, BulletTime)


Long-Range (Damage, Force, Zoom FOV, Spread, RPM, BulletTime)

11 Comments
Constable Reginald  [author] 9 Feb, 2022 @ 11:33pm 
@bib unreal? Hmm?
Constable Reginald  [author] 9 Feb, 2022 @ 11:33pm 
Press Q. under Tools you should see my panels for customizing weapon attributes.
bib 26 Jul, 2021 @ 5:58am 
customization seems to be unreal
arrificialidiot 15 Oct, 2020 @ 7:40pm 
HOW DO YOU COSTIMIZE
Maple_Brigade 6 Aug, 2020 @ 2:16pm 
how do you get to the customizing settings?
BLACKWATCH TROOPER 16 May, 2019 @ 3:57am 
Best weapon. ;D
хто-то 23 Mar, 2019 @ 11:25pm 
it work! thx
Nuki The Agent 14 Mar, 2019 @ 11:11pm 
the all good now
Mackodanian 14 Jan, 2019 @ 12:07am 
ok thanks
Constable Reginald  [author] 13 Jan, 2019 @ 2:21pm 
Nah, I'm no artist, the model comes straight from Counter Strike, you can only customize the color of the kill icon on the next session.