Your First Entity

From Valve Developer Community
Revision as of 13:36, 4 November 2005 by Maven (talk | contribs) (rv spam)
Jump to: navigation, search

One of the easiest ways to begin your MOD is by creating new entities inside the Source engine. Entities make up the objects in the world: NPCs, weapons, tin cans, or triggers; they’re the means by which we add life and interaction into the static geometry of the world.

Entities fall into three general categories: logical, model, and brush.

Logical Entity

These entities are the simplest of entities, because they have no position in the world, no visual component, and only exist to service input from the game map and make decisions based on the state of the world. Logical entities do not move and they do not have a model, they simply receive inputs and send outputs depending on their exact utility. An example would be a logic_counter entity that stores a value that can be added to or subtracted from. Other entities in the map can access the entity via inputs or get information from it via outputs. The entity’s position is irrelevant in this case, which is the major factor in declaring an entity logical.

Model Entity

Model entities are what we would most typically think of entities as being: they have a visual component, they can move around the map and often they are interactive. NPCs are an example of this sort of entity.

Brush Entity

These entities are constructed in Hammer out of brushes (See the Hammer Editor Documentation for more information). Brush entities are most often triggers: volumes in space that fire outputs when certain other entities (like the player) enter or exit them. These can also be moving entities, like doors and platforms.

Using these three major types of entities, we can express almost all the flora and fauna of the Source universe.

To learn how to create these entities, see the Logical Entity, Model Entity, and Brush Entity documents.