Structures/ENT

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(clarify when ClassName and Folder are filled in automatically)
(Updated RenderGroup description and default according to October 2016 Update)
Line 14: Line 14:
 
}}{{StructureField|string|Folder|The folder from where the entity was loaded. This should always be "entity/ent_myentity", regardless whether your ENT is stored as a file, or multiple files in a folder. '''This is set automatically ''before'' the entity file is loaded.'''}}{{StructureField|boolean|AutomaticFrameAdvance|(Clientside) Set this to true if your entity has animations.|false}}{{StructureField|string|Category|(Clientside) Category the ENT is in}}{{StructureField|boolean|Spawnable|Whether this ENT should be displayed in the Q menu|false}}{{StructureField|boolean|Editable|Whether the entity supports Editing. See [[Editable Entities]] for more info.|false}}{{StructureField|boolean|AdminOnly|Whether or not only admins can spawn the ENT from their Q menu|false}}{{StructureField|string|PrintName|(Clientside) Nice name of the ENT|""}}{{StructureField|string|Author|(Clientside) The author of the ENT|""}}{{StructureField|string|Contact|(Clientside) The contacts of the ENT creator|""}}{{StructureField|string|Purpose|(Clientside) The purpose of the ENT creation|""}}{{StructureField|string|Instructions|(Clientside) How to use your entity|""}}{{StructureField|number|RenderGroup|(Clientside) The entity's render group, see {{Enum|RENDERGROUP}}.
 
}}{{StructureField|string|Folder|The folder from where the entity was loaded. This should always be "entity/ent_myentity", regardless whether your ENT is stored as a file, or multiple files in a folder. '''This is set automatically ''before'' the entity file is loaded.'''}}{{StructureField|boolean|AutomaticFrameAdvance|(Clientside) Set this to true if your entity has animations.|false}}{{StructureField|string|Category|(Clientside) Category the ENT is in}}{{StructureField|boolean|Spawnable|Whether this ENT should be displayed in the Q menu|false}}{{StructureField|boolean|Editable|Whether the entity supports Editing. See [[Editable Entities]] for more info.|false}}{{StructureField|boolean|AdminOnly|Whether or not only admins can spawn the ENT from their Q menu|false}}{{StructureField|string|PrintName|(Clientside) Nice name of the ENT|""}}{{StructureField|string|Author|(Clientside) The author of the ENT|""}}{{StructureField|string|Contact|(Clientside) The contacts of the ENT creator|""}}{{StructureField|string|Purpose|(Clientside) The purpose of the ENT creation|""}}{{StructureField|string|Instructions|(Clientside) How to use your entity|""}}{{StructureField|number|RenderGroup|(Clientside) The entity's render group, see {{Enum|RENDERGROUP}}.
  
Among other things, this decides which draw hook is called: {{HookFunction|ENTITY|Draw}} and/or {{HookFunction|ENTITY|DrawTranslucent}}.|RENDERGROUP_OPAQUE
+
Among other things, this decides which draw hook is called: {{HookFunction|ENTITY|Draw}} and/or {{HookFunction|ENTITY|DrawTranslucent}}.
 +
 
 +
The default value is the engine’s default. It is recommended to specify a value to avoid the entity to be invisible.
 
}}{{StructureField|boolean|DisableDuplicator|(Serverside) Disable the ability for players to duplicate this SENT.|false}}
 
}}{{StructureField|boolean|DisableDuplicator|(Serverside) Disable the ability for players to duplicate this SENT.|false}}
 
}}
 
}}

Revision as of 16:54, 17 April 2017

Information about an ENT, used in ENT creation. For list of callbacks, see ENT 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 Base

The base entity to derive from. This must be a valid Lua entity

Default: "base_entity"

string Type

Type of the entity. This must be one of these:

  • anim - An "animated" entity, an shared entity with a model
  • brush - A server-side only brush entity. (This should really by named trigger entity)
  • point - A point entity, an entity without a model that is serverside only by default, but can be networked to clients
  • ai - An "old style" NPC
  • nextbot - A "new style" NPC
  • filter - A serverside only filter entity, a valid filter to be given to engine based trigger entities that accept filters

Default: "anim"

string ClassName

Entity class name of the ENT (File or folder name of your ENT). This is set automatically after the entity file is loaded.

string Folder

The folder from where the entity was loaded. This should always be "entity/ent_myentity", regardless whether your ENT is stored as a file, or multiple files in a folder. This is set automatically before the entity file is loaded.

boolean AutomaticFrameAdvance

(Clientside) Set this to true if your entity has animations.

Default: false

string Category

(Clientside) Category the ENT is in

boolean Spawnable

Whether this ENT should be displayed in the Q menu

Default: false

boolean Editable

Whether the entity supports Editing. See Editable Entities for more info.

Default: false

boolean AdminOnly

Whether or not only admins can spawn the ENT from their Q menu

Default: false

string PrintName

(Clientside) Nice name of the ENT

Default: ""

string Author

(Clientside) The author of the ENT

Default: ""

string Contact

(Clientside) The contacts of the ENT creator

Default: ""

string Purpose

(Clientside) The purpose of the ENT creation

Default: ""

string Instructions

(Clientside) How to use your entity

Default: ""

number RenderGroup

(Clientside) The entity's render group, see RENDERGROUP_ Enums.

Among other things, this decides which draw hook is called: ENTITY:Draw and/or ENTITY:DrawTranslucent.

The default value is the engine’s default. It is recommended to specify a value to avoid the entity to be invisible.

boolean DisableDuplicator

(Serverside) Disable the ability for players to duplicate this SENT.

Default: false

Personal tools
Navigation