GMA
GMA ("Garry's Mod Addon") is an archive file extention used by
Garry's Mod to store addon content, such as models, materials, sounds and maps.
GMA files from the Steam Workshop are stored in these folders: \Steam\steamapps\workshop\content\4000\, GarrysMod\garrysmod\cache\workshop. The game will also load GMA files from GarrysMod\garrysmod\addons.
GMA files installed from Steam Workshop are named by their Workshop item's ID in \cache\workshop\, but they preserve their original filenames in \content\4000. The item ID is instead used as the name of the folder where the .gma is located.
GarrysMod\bin\gmad.exe to extract such archives by double-clicking them. GarrysMod\garrysmod\addons. This was changed in the early 2020s.[When?] GMA tools
gmpublisher is capable of creating GMA files and uploading them to the Workshop, as well as downloading and unpacking addons to any given folder.
Crowbar- Garry's Mod Publishing Utility
- gmad.exe at
GarrysMod\bin\gmad.exe
The following tools are unsupported and are unlikely to function with modern versions of Garry's Mod.
Publishing an addon using GMA
Addons for Garry's Mod need to be packaged into GMA archives to be distributed on Steam Workshop. The required components for a compile are:
- Addon assets & content (models, materials, maps, sounds, Lua code, etc).
- An addon.json file, containing information about the addon.
- A compiling application, in this case,
gmad.exe - A publishing application, in this case,
gmpublish.exe
Setting up
Assuming your assets are ready, you will need to create a new folder (will be referred to as the root or addon folder), in which your assets will be stored. Addon folders use the game folder structure, however some folders are not allowed. Generally, an addon folder looks like this:
Example_addon addon.json lua/ maps/ backgrounds/ materials/ models/ sound/ gamemodes/ scenes/ scripts/vehicles/ particles/ resource/fonts/ resource/localization/
/garrysmod/adddons/. The game has a legacy system that mounts non-GMA addons from that folder. It's also convenient to develop starting with a non-GMA addon for easier file management. .sw.vtx files are unused by the game and therefore not allowed. You can safely remove them. addon.json
addon.json is a mandatory file for compiling GMA files. It contains basic metadata about the addon, mostly used for the Workshop page. Here is an example of an addon.json file:
{
"title" : "My Server Content",
"type" : "ServerContent",
"tags" : [ "roleplay", "realism" ],
"ignore" :
[
"*.psd",
"*.vcproj",
"*.svn*"
]
}
- title is the name of your addon as seen in the Workshop.
- type is the type of your addon. Note that mistagged addons (e.g. an NPC tagged as a weapon) are against Facepunch's workshop rules. Allowed values are:
"ServerContent" "gamemode" "map" "weapon" "vehicle" "npc" "tool" "effects" "model" "entity"
- tags is up to two of these Workshop tags.
Confirm: Gmpublisher can add up to three. Is this a gmpublish or a gmad limitation?
"fun" "roleplay" "scenic" "movie" "realism" "cartoon" "water" "comic" "build"
- ignore is a wildcard list of files to ignore when creating the addon file. The example shown above will prevent all .psd, .vcproj and .svn files from stopping you from making a .gma. The number of ignored files or filetypes is unlimited. Common unallowed file types are:
.psd,.blend,.max,.DS_Store,.db,.bak,.tmp,.pdf,.txt(other than vehicle scripts),.docx,.rtf,.zip,.rarand others.
Compiling with gmad
Open your GarrysMod\bin folder and find gmad.exe. Drag your addon's root folder onto it, probably from another file manager window.
If successful, a new .gma file should appear in the same directory as your input root folder.
Alternatively, open the Command Prompt in GarrysMod\bin. Then write this command putting actual paths in:
gmad.exe create -folder "Full path to your addon folder" -out "Full path to the folder where the GMA file should be created"
The -out parameter is optional, and if not set, the GMA file will be created in the same directory as the input folder.
Testing
It is recommended to test your compiled addon before distributing it on the Workshop. To do this, put your compiled GMA file in the GarrysMod\garrysmod\addons folder and load up the game to see if your addon is there.
Creating a thumbnail
Your addon's thumbnail should be a 512x512 .jpg file. Do not save it to anywhere inside the addon.
Publishing
Open the Command Prompt in your GarrysMod\bin directory. Write this command, changing the GMA and thumbnail (icon) file paths to yours:
gmpublish.exe create -addon "C:\example_addon.gma" -icon "C:\example_thumbnail.jpg"
If successful, you will see the ID of your newly created Workshop item. New addons are private by default - you will need to change that by going to the addon's Workshop page.
Remember Steam Workshop's rules.
- Do not publish pirated or leaked content
- Do not publish malicious code
- Do not publish content that promotes discrimination, violence, or illegal acts
- Do not publish broken mods or empty GMAs
- If you use someone else's work, you must get their permission and give them credit in the description
- NSFW content (nudity, gore) should be marked as such through content descriptors on the addon page
- Your addon's thumbnail should represent what is actually in the mod