interacting with entities

There are as many ways for the player to interact with entities as there are entities. The purpose of this section is to give you an idea of what some of the common entities are, and what you can do with them.

Doors, Platforms, and Buttons

These are probably the most common physical entities in a level.

This type of entity can provide a sense of realism for the player and create a more immersive game environment.

These entities can be activated in a number of ways. By themselves, they can be activated by "using" them, or simply by walking up to them.

Note: You can make a "use" key by binding +use to a key of your choice. For example, to make Enter the "use" key, at the console, you would type "bind Enter +use" (without the quotes).

All of these entities can also be triggered by other entities. This is most commonly done with a func_button or one of the triggers (trigger_once, trigger_multiple, etc).

In the above picture, when the player runs into the trigger (circled), the door (dotted-outline) will open.

Another reason to use a trigger in this manner is when you have two objects that must act in concert with each other. The two pictures above show the same scene in the game (top) and in the editor. In the game picture, you will notice that the window in the door is translucent. Because of the way entities and transparency work, the window must be a separate entity from the door. However, they both must be activated at the same time obviously. To make this work, both the door and window (which is also a func_door) are given the same "targetname" keyvalue, and the trigger (circled) targets that keyvalue.

As with entities in general, triggers can be brush based or entity based. Brush based entities create an activation field which the player must walk through. Point based entities must be activated by some other trigger.

For more detailed information, please refer to the tutorials and the Half-Life entity guide.

Related Topics:

creating entities