CYXNIGHT Portfolio
456 words
2 minutes
Garry's Mod Gun Game
2024-03-22

Shoot up your friends with cod weapons, or obliterate them with the most disgusting weapons imaginable, in this Call of Duty Gun Game inspired mod.

Every time you get a kill, you go to a new weapon. The first person to kill with the final weapon wins!


Links#

How to use is within the workshop description.

Steam Workshop


Videos#

// Will have to figure out how


Screenshots#

Mmmm. Dynamic UI 🤤

20240322173339_1

20230706141107_1

JUST LOOK AT DA BULLETS

gungamebulletsgungamebullets

My stats as of 22/03/2024

stats


Some Stuff#

I used a paint stroke to give the elements a background. They dynamically scale based on the content behind it. But it doesn’t scale how you’d expect as if you just stretched the original image behind it, you would get areas not affected by it (as the paint doesn’t stretch the whole image).

The way around this was to use the original image to find out where I wanted the content, and then stretch that to the content, then find out how the original image would have to scale based on it.

You can see that in action here. The yellow is where I wanted the content and it matches it perfectly! (I apologise for the yellow. I guess it wasn’t such a good colour to use lmao)

20230630182502_1

The uh. The greatest named hud in existence

cl_hud.lua
function thiswasfuniguess_hud:DrawTexturedRectRebounded(x, y, w, h, minBound, maxBound, material, color)
local scaledWidth = w / (maxBound.x - minBound.x)
local scaledHeight = h / (maxBound.y - minBound.y)
local newX = x - minBound.x * scaledWidth
local newY = y - minBound.y * scaledHeight
local newW = material:Width() * scaledWidth
local newH = material:Height() * scaledHeight
surface.SetDrawColor( color )
surface.SetMaterial( material )
surface.DrawTexturedRect(newX, newY, newW, newH)
end

Final Words#

I really enjoyed creating this mod

I learnt how to use LUA and create mods with Garry’s Mod. I still have a little bit to learn as there are quite a few bugs that make finding and using weapons that work a little frustrating.

I have planned to add in a GUI for creating and modifying weapon lists to make it not only creating one easier, but allow for more dynamic servers with multiple maps and weapon lists. It would be cool to see it change depending on the map too.

It’s a real spaghetti mess of code as I haven’t used LUA before, and trying to refactor it will be harder than rewriting it, so I’ll leave what’s already done as done.


I will continue to update this page if changes occur.


Music I’ve Been Listening To#

Garry's Mod Gun Game
Author
CYXNIGHT
Published at
2024-03-22