VERC: Concepts: Triggers and Targets Last edited 16 years ago2003-01-02 23:23:00 UTC by Penguinboy Penguinboy

This article was recovered from an archive and needs to be reviewed

  1. The formatting may be incorrect as it was automatically converted to WikiCode from HTML, it needs to be revised and reformatted
  2. Some information may be out of date as it was written before Half-Life was available on Steam
  3. After the article is re-formatted and updated for Steam HL, remove this notice
  4. Please do not remove the archive notice from the bottom of the article.
  5. Some archive articles are no longer useful, or they duplicate information from other tutorials and entity guides. In this case, delete the page after merging any relevant information into other pages. Contact an admin to delete a page.
Most editing tutorials throw around the words trigger and target without a real explanation of what they mean. As they are at the heart of almost every entity event, it is extremely important to understand what they are and how they work.

We'll start with a visual example:
A trigger is something that can activate another event. In the example above, I've used a trigger_once entity, which requires that the player walk through it to set it off. A button or some other method could also have been used here, but this keeps it simple.

In an entity capable of acting as a trigger there is a Target property. The value of this property is the name of the event that will be affected or used. This can be where things get confusing - the term "target" can refer to any entity capable of being named. People occasionally have the idea that this must refer to an info_target entity, but this is not correct -- it can be an info_target, but it doesn't have to be.

In the example above, you can see that the trigger_once targets the env_beam in a way that will activate it. This would be active targeting or simply triggering.

The env_beam has two properties associated with it that allow you to target objects -- the Start Entity and Ending Entity. In the example, you can see that these properties do target info_target entities, but as mentioned above, they could easily have been any other entity, including moving ones. (note: if you are referencing a non-point-based entity (like a func_door) for its location, that entity needs to have an origin brush (Link: index.php?go=rotating_objects) as part of it which will act as a targeting point).

The env_beam uses the two info_targets' locations as the start and end points of its beam, but does not actually trigger or activate them in any way. This would be benign targeting, or simply targeting.

Special Targeting: The Killtarget

Aside from the active and benign targeting, some entities possess the ability to remove other entities by targeting them with their killtarget property. When an entity is killtargeted, it is completely removed from the game -- there is no way to re-enable the killed entity.
So, to recap, triggering something refers to one entity (generally a trigger_ something , but not necessarily) targeting and activating another entity or event, whereas targeting something is simply the act of making one entity aware of another, possibly for triggering, and possibly not.
This article was originally published on the Valve Editing Resource Collective (VERC).
TWHL only archives articles from defunct websites. For more information on TWHL's archiving efforts, please visit the TWHL Archiving Project page.


You must log in to post a comment. You can login or register a new account.