GM Structure

From Garry's Mod
Revision as of 18:59, 26 February 2016 by EstevanTH (Talk | contribs)
Jump to: navigation, search
Information about a gamemode, used in Gamemode Creation. For list of hooks, see GM Hooks.

While some of the fields may be serverside or clientside only, it is recommended to provide them on both so addons could use their values.

Type Name Description
string Name

The fancy name of your gamemode.

string Author

The name/contact info of the gamemode author.

string Email

The contact email associated with the gamemode.

string Website

The website associated with the gamemode.

string FolderName

The name of the gamemode folder, automatically set.

string Folder

The name of the gamemode folder prepended with "gamemodes/" (such as "gamemodes/sandbox"), automatically set.

boolean TeamBased

Set this to true if your gamemode is team-based. This doesn't appear to affect anything.

boolean IsSandboxDerived

True if the gamemode is derived from sandbox.

string ThisClass

The name of the gamemode folder prepended with "gamemode_" (such as "gamemode_sandbox"), automatically set.

table BaseClass

The table of the base gamemode to derive from, set automatically by DeriveGamemode.

Note: It is recommended to use DEFINE_BASECLASS when referencing the gamemode's BaseClass to prevent unintended behavior.

Note: DeriveGamemode modifies the main gamemode's BaseClass, which is shared with parent gamemodes. Because of this, in parent gamemodes the BaseClass can be incorrect, so for instance you need to use self.BaseClass.BaseClass in the 1st parent instead.

Personal tools
Navigation