GMA

From Valve Developer Community
Jump to navigation Jump to search
This article or section is a stub. You can help by expanding it.

GMA ("Garrys Mod Addon") is an archive file extention used by Garry's Mod to store addon contents, such as models, materials, sounds, maps and other.

GMA files from Steam Workshop are usually stored in one of these folders: \Steam\steamapps\workshop\content\4000\, \Steam\steamapps\common\GarrysMod\garrysmod\addons, \garrysmod\cache\workshop. GMA files installed from Steam Workshop are named by their Workshop item's ID.
GMA Files cannot exceed 2 Gigabytes in size.

Applications able to work with GMA files

And other applications.

Compiling a GMA addon

Addons for Garry's Mod need to be compiled into GMA files to be distributed on Steam Workshop. The required components for a compile are:

  1. Addon assets & content (models, materials, maps, sounds, LUA code, etc).
  2. An addon.json file, containing information about the addon.
  3. A compiling application, in this case, gmad.exe
  4. 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 folder), in which your assets will be stored. Example of the root folder's structuring:

Example_addon
	addon.json
	lua/
	maps/
	backgrounds/
	materials/
	models/
	sound/
	gamemodes/
	scenes/
	scripts/vehicles/
	particles/
	resource/fonts/
	resource/localization/

addon.json

addon.json is a mandatory file for compiling GMA files. Here is an example of an addon.json file structure:

{ "title": "Example Addon", "type": "weapon", "tags": [ "fun", "roleplay" ], "ignore": [ "*.psd", "*.vcproj", "*.svn" ] }

The type field can be weapon, tool, npc, entities, effects, vehicles, map, playermodel, gamemode, ServerContent. Only one type can be picked.
The tags field can be fun, roleplay, scary, scenic, realism, cartoon, water, build, movie. There can be only up to two tags, each inside the square brackets and separated by a comma.
Always use lowercase letters for both tags and types.
The ignore section is entirely optional, although recommended. Gmad.exe will fail to compile if there are file types present in the addon folder that are not allowed. Common file types not allowed are: .psd, .blend, .max, .DS_Store, .db, .bak, .tmp, .pdf, .txt (other than the vehicle scripts), .docx, .rtf, .zip, .rar and others. The files can be wildcarded (eg. *.psd), or can be specific files (eg. texture.psd)

Compiling with gmad

Open your \Steam\steamapps\common\GarrysMod\bin folder, and find the gmad.exe application. Then, drag your addon's root folder on to the gmad.exe application. If successful, a new .gma file should appear in the same directory as your original root folder.
Alternatively, open the Command Prompt in your \Steam\steamapps\common\GarrysMod\bin directory. Then, write this command:

gmad.exe create -folder "Full path to your root folder" -out "Full path to the folder where the GMA file should be created"

The -out parameter is optional, if not set the GMA file will be created in the same directory as your original root 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 \Steam\steamapps\common\GarrysMod\garrysmod\addons folder. If it works as intended, congrats, you have successfully compiled a Garry's Mod addon.

Creating a thumbnail

Your addon's thumbnail should be a 512x512 .jpg file. The thumbnail's name does not matter. Your thumbnail should not be compiled with the addon. The thumbnail must be under 1 megabyte in size.

Publishing

Open the Command Prompt in your \Steam\steamapps\common\GarrysMod\bin directory. Then you need to 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, it should give the Published File ID.
By default, the visibility settings of new addons are private. You will need to change that by going on 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
  • "Not Safe For Work" and other sexual content is generally prohibited and should be marked as such
  • Your addon's thumbnail should represent what is actually in the mod

See Also

External Links