Working on a weapon base for my addiction with guns

*This post is being edited a lot since well… I keep adding more stuff…
Over the past year, I’ve been making weapons in lua just for my own hobby. Because I felt that even for a game that runs on an engine about 16 years old, there is still a lot of potential.

This weapon base uses a bunch of little tricks to give an experience in which I would call, close enough to realism as it can be on source engine.

When I first started on this, I wanted it to be completely unique in what it can offer, and try to make it feel as if you are playing a triple A game or something…

Shared lua based viewpunch system (Using tick to fps smoothing & prediction for sv/cl support)

Shared weapon movement system (Aka, the bullet goes in the direction of where the gun is pointing, literally, using tick to fps smoothing & prediction for sv/cl support)
Green = Direction of where the bullet should go
Red = Same as green but affected by weapon’s FOV (used to determine if the weapon is correctly setup to compensate the FOV for on-point aiming)

Scope system using some wacky vector manipulation and all kinds of stuff (I swear the source code looks like I got drunk on a friday night)

Sights which follows the laws of how sights should work (I think)
Look at how the reticle renders on top of the gun but not on top of the sight itself

A bullet ballistic system, like… Mathematically done…
Aka → Damage is affected by velocity is affected by water, air, wind (require stormfox), gravity, surfaces and etc

Attachments where you can modify even the bullet system itself. (I some what created cyberpunk 2077 smart bullets, idk why, I got drunk when I did it)

A REALLY customizable attachment system.
I suggest looking at “Effects” and “Conditions” as it explains what I mean by “customizable”
On pastebin, since the doc is too big to be pasted here.

And my not so great UI for the base…
But to make it better I included a cat so enjoy that atleast.

And some more shinanigans
image

Stuff I used from other creators,
Weapon Models - FA:S 2.0
Optics and Sights - FA:S 2.0/TFA’s [AT] models
Muzzle Effects - FA:S 2.0

6 Likes

this is thoroughly epic

I added more stuff to it, such as the ability to add rail mods to make crazy stuff
Such as an attachment system ecosystem so that you can be as creative as you would like to be
The weapon base automatically assigns and designates models and attachments for you, this is so that if people do start making attachments, all you need to do is this.

-- An attachment with more attachable points lmao
ATTACHMENT.Attachments = {
	{
		Name = 'Reflex Sights', -- the name
		index = {'optic_main'}, -- what can be attached to here?
        region = "optic_main" -- what region in the model table is the attachment supposed to go?
	},
}

And here’s an image of 3 scopes stacked on top of each other
image
image
Because I have lost my sanity making this work.

Oh and here’s more shenanigans.

2 Likes