Add-On Creation & Folder Structure

From GMod Wiki

Revision as of 10:42, 27 December 2009 by AnthoniC (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Contents

Introduction

Add-Ons are one of the major components to Garry's Mod, because they allow users to easily add custom content to Garry's Mod in an easy, and organized way. This page will teach you how to create your own Add-Ons that you can distribute to other players.

The Info File

The info file named "info.txt" is the key to making any Add-On work. Below I have shown the format of an Add-On file.

 "AddonInfo"
 {
    "name"                ""
    "version"             ""
    "up_date"             ""
    "author_name"         ""
    "author_email"        ""
    "author_url"	  ""
    "info"                ""
    "override"            "0"
 }

Then you just fill in the quotes with your Add-On's information.

The Folder Structure

An Add-On is just a folder with an info file inside it with content is their respective directories. For each piece of content you add to your Add-On, depending on the file type it needs to be added to a certain folder. Also, Add-Ons themselves should go into a certain folder. Below I have listed where each type of content should go.

Note: $SteamUserDir is the directory in your steam file where game content is stored. Also, I will refer the name of your Add-On with an <addon-name> tag.

Add-On

../Steam/steamapps/$SteamUserDir/garrysmod/garrysmod/addons/

Lua (.lua)

../Steam/steamapps/$SteamUserDir/garrysmod/garrysmod/addons/<addon-name>/lua

Models (.mdl)

../Steam/steamapps/$SteamUserDir/garrysmod/garrysmod/addons/<addon-name>/models

Textures & Materials (.vtf, .vmt)

../Steam/steamapps/$SteamUserDir/garrysmod/garrysmod/addons/<addon-name>/materials

Maps (.bsp)

../Steam/steamapps/$SteamUserDir/garrysmod/garrysmod/addons/<addon-name>/maps

Sound (.wav, .mp3)

../Steam/steamapps/$SteamUserDir/garrysmod/garrysmod/addons/<addon-name>/sound

Data

../Steam/steamapps/$SteamUserDir/garrysmod/garrysmod/addons/<addon-name>/data

Settings

../Steam/steamapps/$SteamUserDir/garrysmod/garrysmod/addons/<addon-name>/settings

Scripts

../Steam/steamapps/$SteamUserDir/garrysmod/garrysmod/addons/<addon-name>/scripts

Conclusion

Hopefully this article as helped you in you creation of Add-Ons. Post any suggestions, questions, or comments, in the discussion tab.

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox