Language files are a means to make translations for users easier by putting translations into their own folder and therefore keeping things cleans. Those files will be automatically included in their respective realm, therefore AddCSLuaFile() is not needed. However those files can't be placed directly inside this folder, but have to be placed in one of those three subfolders: server/, client/, shared/. To prevent TTT2 addons from throwing errors in other gamemodes, TTT2 now has its own fileloader.įiles have to be placed in lua/terrortown/autorun to be loaded.
HOW TO CREATE A GMOD ADDON MOD
While Garry's Mod provides its own autorun folder, this folder has the drawback that it is loaded independant from the selected gamemode. Here's a list of the different types that can be used: General Purpose Lua Files ¶ See this source for a detailed overview over the standard Garry's Mod project structure.īesides the general Garry's Mod files, TTT2 also automatically loads different types of lua files from lua/terrortown/. addons/ Folder With Many Addons as Symbolic Links Inside Adding a new addon folder into this directory needs a restart of the game however. Project Structure ¶Īll your addon files have to be placed into GarrysMod/garrysmod/addons and are automatically loaded when the game is started. Personally on windows I use a graphical interface ( tutorial on setup and use), however it is up to your own preferences. Symbolic links are a neat solution for this. This creates a problem though, since it is really tedious to copy the contents from the addons/ folder to your projects folder and back. Personally I do not like to create my local repository folders inside the garrysmod addons/ folder since I prefer to have all my projects inside one folder to keep them organised.
HOW TO CREATE A GMOD ADDON SOFTWARE
Once your software is set up, you can create your first repository. Easy to Use Graphical Interface for GitHub GitHub also offers an easy to use client that is really beginner friendly. We're using GitHub as our hosting platform, however you are free to use any alternative that you like. It is generally recommended to use Git for the management of projects.
![how to create a gmod addon how to create a gmod addon](https://i.ytimg.com/vi/-cP89jc2n_A/maxresdefault.jpg)
Ready to Use Editor With Version Control and GMod Linting All addons can be easily installed from inside VSCode itself with a single click. The glualint linter is perfect for the development of TTT addons since it combines normal lua linting with code completition of gmod functions (you have to follow the installation steps found in glualint description).Īdditionally there are other lua addons available. However any editor can be used, even the default Microsoft editor works.Īdditionally a linter is a nice to have tool to make sure the code is clean and works. I recommend the use of Visual Studio Code.
![how to create a gmod addon how to create a gmod addon](https://javabird25.github.io/PyGmod/_images/browse_local_files.png)
The first step to get started with lua or any coding in general is the choice of an editor.
![how to create a gmod addon how to create a gmod addon](https://static.wikia.nocookie.net/yogscast/images/4/4f/Gmodlogo.png)
Creating an Addon ¶ Workspace Setup ¶ Editor ¶