GShake – New generation shake (API)
(It took about a year to make this addon :3)
Tired of GMod’s default, jerky screen shake? Ever felt like a massive explosion should feel more… explosive? Or that a Strider walking past should rattle your bones?
Well, this addon fixes that.
It completely replaces the default util.ScreenShake function with a new, smooth, trauma-based system. This makes all shakes feel more natural, responsive, and (most importantly) awesome.
- [] Replaces the Core Shake: Say goodbye to the janky default shake. This new system is smooth and uses a "trauma" value that decays over time, just like in modern AAA games. [] Dynamic NPC Shakes: NPCs now cause screen shake!
- Developer Friendly: Comes with a simple API and easy-to-edit config files so you can add your own custom shakes for other addons or entities.
- [] Striders: Feel their heavy footsteps and the power of their warp cannon. [] Gunships, Helicopters & Dropships: Their rotors create a rumble effect when they fly close to you (it even checks line-of-sight!).
[] Better Explosions: All standard HL2 explosions (grenades, RPGs, explosive barrels, etc.) now use the new system and have carefully tuned values for max impact. [] Map Integration: Automatically hooks into map-based env_shake entities, upgrading them to the new smooth system instantly.
For Players: Just subscribe and you’re done! Seriously, that’s it. It works out of the box.
For Servers: This addon is required by both the server and all clients. Make sure you add it to your server’s workshop collection so everyone downloads it.
Hey, so what if you’re a driver who gets carsick? No problem.
By default, all these awesome new shakes work even when you’re in a vehicle. If you’d rather not have your screen rattle while you’re trying to pull off a sweet jump, you can easily turn it off.
Just open your console (the ~ key) and type:
That’s it! All shakes will be blocked as long as you’re in a driver’s seat.
Want it back on? Just set it back to 1:
You’re in control!
This is the "how to do everything" part. It’s super easy to add your own shakes for other addons or props.
The easiest way is to edit the config file. You’ll find it in the addon folder at: lua/autorun/hl2naetcs.lua (You might have a different file name, but it’s the one with all the tables!)
Inside, you’ll see two tables: ExplosiveEntities and DestructibleShake.
To add a new prop that shakes when it breaks: Add a new line to the DestructibleShake table. You just need the prop’s model path.
To add a new explosive entity (like a custom grenade): Add a new line to the ExplosiveEntities table. You just need the entity’s class name.
Table Key:
- [] maxAmplitude: How strong the shake is at its center (max strength). [] minAmplitude: (For explosions) The minimum random strength. It picks a value between min and max. [] frequency: How "fast" the shake is. Higher = more jittery. [] duration: How long the shake lasts in seconds.
- radius: How far away you can feel the shake from.
Since this addon overwrites the default util.ScreenShake, you can just call the normal function from your own LUA code and it will automatically use the new system!
This addon WILL CONFLICT with any other addon that tries to modify or replace util.ScreenShake. You can only have one "shake overhaul" addon at a time.
Other than that, it should be compatible with pretty much everything!
Enjoy the shakes!