Ultimate Guide: How to Use the Garry’s Mod Addon Tool for Beginners

Creating Custom Content: Step-by-Step with the Garry’s Mod Addon Tool

Overview

This guide walks through creating, packaging, and installing a simple Garry’s Mod addon using the Addon Tool (gmad/gmpublish or in-game tools). It assumes basic familiarity with Garry’s Mod file structure and a text editor.

What you’ll create

  • A simple Lua scripted entity that spawns a colored cube.
  • Basic textures and a model placeholder (prop_physics cube).
  • A working addon folder packaged as a .gma suitable for local use or publishing.

File structure (example)

  • my_custom_cube/
    • lua/
      • entities/
        • my_cube/
          • init.lua
          • cl_init.lua
          • shared.lua
    • models/ (optional)
    • materials/
      • models/
        • my_cube.vmt
    • addon.txt (metadata)

Step-by-step

  1. Create addon folder
  • Create folder named my_custom_cube in your Garry’s Mod addons directory or a workspace folder for packaging.
  1. Add addon metadata
  • Create addon.txt with fields:
    • “title”: “My Custom Cube”
    • “type”: “gamemode” or “swep”/“tool” as appropriate (for entity use “server” + “client” via Lua files)
    • “tags”: [“utility”]
    • “ignore”: []
  1. Write shared entity file (shared.lua)
  • Define basic entity properties (Base, Type, PrintName, Author, Spawnable).
  • Example: set Model to “models/props_junk/wood_crate001a.mdl” or a cube prop.
  1. Write server init (init.lua)
  • Implement Initialize to set model, physics, and color.
  • Implement Use or Think as needed.
  1. Write client drawing (clinit.lua)
  • Optionally add client-side effects or HUD hints.
  1. Add materials/textures
  • Place VMT/VTF files under materials/models/ and reference them from the model or via SetMaterial / SetColor.
  1. Test locally
  • Place the folder in garrysmod/garrysmod/addons/ and launch Garry’s Mod.
  • Use the spawn menu or console commands to spawn the entity and debug errors via console.
  1. Package with gmad
  • From Garry’s Mod bin folder run:

    Code

    gmad.exe create -folder “path\to\my_custom_cube” -out “my_custom_cube.gma”
  • For Linux/mac use the corresponding binary.
  1. Install or share
  • Install locally by placing the .gma into garrysmod/garrysmod/addons/ or upload to the Steam Workshop using gmpublish or the in-game publishing tool.

Quick troubleshooting

  • Lua errors: check garrysmod/garrysmod/lua/errors.txt and the game console.
  • Missing textures/models: confirm paths and that files are in the right folders.
  • Entity not spawnable: ensure Spawnable = true and AddCSLuaFile() where needed.

Tips & best practices

  • Use AddCSLuaFile() in shared files to send client code.
  • Keep client/server logic separated.
  • Test iteratively; start minimal and add features.
  • Use descriptive addon.txt metadata for Workshop publishing.

If you want, I can generate the example Lua files (shared.lua, init.lua, cl_init.lua) and a sample addon.txt for this addon.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *