Overriding existing TTT lua files?

I have my own version of the newton launcher and many other items in trouble in terrorist town, but I have this paranoia that if an update happens, I will have to spend a bunch of time replacing lua files.
I’m pretty scrubby when it comes to these sorts of things, and I was wondering if there is a way I can override the existing gamemode lua files like weapon_ttt_push.lua with my own, without having to actually get into the gamemode folder itself (the area I feel is unstable and will require a lot of work to undo).
Some sort of addon or autorun lua include?

Just replace the files externally. Hopefully you don’t break a lot of stuff.

Replace them externally? You mean like in addons D:?
(did I mention I am quite the scrub). I know how to edit and write a little, and I figure things out as I go, but I am not really sure on more specific details like replacing things :x

If you don’t know much about doing coding and stuff at the moment, learn first before trying to accomplish a task this challenging.

I know plenty about programming, but my learning style is by experience. If it’s really some super complicated task just please humor me for a moment and let me just see a basic example. I looked around online for quite some time, but I could not find anything clear on how this specific thing would work.
I want to know how to do something like this a lot sooner than 3 years of practice later, and it just didn’t seem like it was so hard.
I just need to know how to create, say, an addon that replaces gamemodes errortown\entities\weapons\weapon_ttt_push.lua with my own. I recoded it so it pushes things differently than using bullets, but instead using a more direct approach in the bullet.callBack (because I had added a reload ability that pulled players, but it wouldn’t pull props) so now it pushes and pulls every entity with a physicsObj.
I have lots of other items in TTT that I changed just to make them either more interesting, or more effective. Is it really so much more complicated to just tell gmod that I want to use mine?

Make the addons/entities/weapons folder in an addon, and throw them all there, and then rename the originals to something like “name.lua.backup” so they aren’t parsed.

I just tried that as many different ways as I could think of:
-Literally: Created “addons\entities\weapons” in an addon (which I don’t know the details of doing and the internet would not help, so I just made a folder called “magicword”). I renamed the original “weapon_ttt_push.lua” in “gamemodes errortown\entities\weapons” to “weapon_ttt_push.backup”. Then I put my version of it in “addons\magicword\addons\entities\weapons”. No luck after I restarted the server.
-A bit more figuratively: I thought maybe you didnt mean to literally put a folder named addons so I tried it again with just addons\magicword\entities\weapons\weapon_ttt_push.lua. No luck.
-Raise it up a bit more: Maybe you meant a folder named entities in addons? Idk, doesn’t seem right to me, but I just need something that works! So i pulled it up a bit higher. Didn’t work.
-Maybe I don’t know how to make an addon?: Looked up some information online, found some vague cl_init.lua, init.lua, shared.lua information. Tried using their include and addcslua file commands to add it in (and the init and cl_init and even shared which i didnt have any use for). Still no good.

Sorry for not knowing enough. I am clearly missing some basics I know, but I only need to learn them once in a context I care about and I’m done. Reading through tutorials is almost impossible for me, so I’m just asking for a simple and straightforward example that works if that’s possible :?

http://wiki.garrysmod.com/page/Workshop_Addon_Creation Here’s a guide for workshop, and most of it still applies. I did mean it literally. You’re making an addon folder in garrysmod/garrysmod/addons. Call it something like “tttweaponreplacement”, so the folder is garrysmod/garrysmod/addons/tttweaponreplacement. Inside that folder make a folder called lua, and in that entities, and then in that weapons. Look at that guide for the addon.json formatting, and put that in the base folder, garrysmod/garrysmod/addons/tttweaponreplacement.

He obviously knows at least the basics of Lua scripting. He’ll never learn if you put him down like that. He never suggested he was a bad developer, simply uninformed. I didn’t even realize you could create an addon folder to replace files in a gamemode until just a few weeks ago, and have a look at how long I’ve been on Facepunch.

Now things are getting tricky. So far the file is at least being downloaded, but now I am getting the error:

[ERROR] addons/magicword/lua/entities/weapon_ttt_push.lua:3: attempt to index global ‘SWEP’ (a nil value)

  1. unknown - addons/magicword/lua/entities/weapon_ttt_push.lua:3

The newton launcher lua in it’s own context obviously doesn’t mean anything (the code does run fine if it’s inside of the real gamemode folder).
The line in question by the error is just:


SWEP.HoldType = "physgun"

I just including a few more files, but it just doesn’t seem to work (including the ttt weapon base file).
This may be more difficult than I had thought if the game is going to take it all out of context. But it is clearly still possible, maybe extracting an already working workshop weapon would work, but I wonder if you can extract a .gma.

Make a weapons folder inside entities, and put all the files in it. That’s all I can think of that would be causing that error.

Still no good. They actually aren’t even showing up now, let alone being downloaded. I was really hoping for a good clean way to keep everything up to date without the possibility of lots of mixups, but it doesn’t look like that’s going to happen. Thanks for all the help though.
(unless you’ve got another idea).