Book Image

Source SDK Game Development Essentials

By : Brett Joseph Bernier
Book Image

Source SDK Game Development Essentials

By: Brett Joseph Bernier

Overview of this book

Table of Contents (18 chapters)
Source SDK Game Development Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Using different flags


Triggers have flags that can be set to specify what entity type can trigger them. Check the box to select which entity type can activate the trigger. Any trigger defaults to allowing only clients (players) to activate them, but this can easily be changed to allow or forbid multiple activator types.

As an example, if you want a window to break if you throw a rock at it, put a trigger_once entity in front of a func_breakable entity (named window01) and set the flags of the trigger_once entity to Physics Objects only.

The output obtained for the trigger_once entity would be as follows:

OnTrigger, window01, Break, 0.00s delay

The window will break if any physics object, such as a rock, touches the trigger, but it will not break if the player touches the trigger.

Using filters

We can provide even more control over which objects or NPCs trigger which event using filters. Filters help to tell a trigger which entities can or cannot affect them. The filter_activator_class entity...