Difference between revisions of "Your First Entity"

From Valve Developer Community
Jump to: navigation, search
(Menus are not an entity... unless your definition is so vague you'd consider an entire server to be an entity as well.)
 
(58 intermediate revisions by 33 users not shown)
Line 1: Line 1:
[[Category:Programming]]
+
{{otherlang2
 +
|ru=Your First Entity:ru
 +
|fr=Your First Entity:fr
 +
|de=Your_First_Entity:de
 +
|zh-cn=Your_First_Entity:zh-cn
 +
|pt-br=Your_First_Entity:pt-br
 +
}}
  
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.
+
'''Everything in Source is an [[entity]].''' Even the world and the player. Despite this, they all trace back to only a handful of categories: the most common by far are "logical", "model" and "brush".
  
Entities fall into three general categories: logical, model, and brush.
+
This series of articles will guide you through the process of creating three new entities. Start with a logical entity, as it is assumed knowledge for the others.
  
=[[Authoring_a_Logical_Entity|Logical Entity]]=
+
== [[Authoring a Logical Entity|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.
+
'''Do this first.'''
  
=[[Authoring_a_Model_Entity|Model Entity]]=
+
Logical entities are the simplest of entities because they have no position in the world, no visual component, and only exist to service [[input]] from other entities.
  
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.
+
In this tutorial we'll create a logical entity that performs the simple task of storing a value and incrementing that value every time it receives an appropriate input. Once the counter has reached a value we'll define, the entity will fire an [[output]].
  
=[[Authoring_a_Brush_Entity|Brush Entity]]=
+
== [[Authoring a Model Entity|Model Entity]] ==
  
These entities are constructed in Hammer out of <i>brushes</i> (See the Hammer Editor Documentation for more information). Brush entities are most often <i>triggers:</i> 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.
+
[[Image:My model entity.jpg|thumb|We will create this moving entity.]]
  
Using these three major types of entities, we can express almost all the flora and fauna of the Source universe.
+
[[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.
  
To learn how to create these entities, see the [[Authoring_a_Logical_Entity|Logical Entity]], [[Authoring_a_Model_Entity|Model Entity]], and [[Authoring_a_Brush_Entity|Brush Entity]] documents.
+
In this tutorial we'll create a model entity that flies randomly around the world.
  
 +
== [[Authoring a Brush Entity|Brush Entity]] ==
  
 +
These entities are constructed in Hammer from [[brush]]es. They are often [[trigger]]s: volumes in space that fire outputs when a set of conditions are met within them. They can also be moving parts of the world like doors and platforms.
  
 +
In this tutorial we'll create a brush entity that moves when touched.
  
<div id="wikitikitavi" style="overflow:auto; height: 1px; ">
+
[[Category:Programming]]
[[http://WTHP1.coolhost.biz] [WTHPD1]]
+
[[Category:Tutorials]]
[http://WTHP2.coolhost.biz  WTHPD2]
 
[[http://WTHP3.coolhost.biz | WTHPD3]]
 
[http://WTHP4.coolhost.biz | WTHPD4]
 
[WTHPD5 | http://WTHP5.coolhost.biz]
 
[[http://WTHP6.coolhost.biz WTHPD6]]
 
[[WTHPD7|http://WTHP7.coolhost.biz]]
 
http://WTHP8.coolhost.biz
 
</div>
 

Latest revision as of 09:28, 28 May 2019

Deutsch Français Português-Brasileiro Русский 简体中文

Everything in Source is an entity. Even the world and the player. Despite this, they all trace back to only a handful of categories: the most common by far are "logical", "model" and "brush".

This series of articles will guide you through the process of creating three new entities. Start with a logical entity, as it is assumed knowledge for the others.

Logical Entity

Do this first.

Logical entities are the simplest of entities because they have no position in the world, no visual component, and only exist to service input from other entities.

In this tutorial we'll create a logical entity that performs the simple task of storing a value and incrementing that value every time it receives an appropriate input. Once the counter has reached a value we'll define, the entity will fire an output.

Model Entity

We will create this moving 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.

In this tutorial we'll create a model entity that flies randomly around the world.

Brush Entity

These entities are constructed in Hammer from brushes. They are often triggers: volumes in space that fire outputs when a set of conditions are met within them. They can also be moving parts of the world like doors and platforms.

In this tutorial we'll create a brush entity that moves when touched.