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

Creating subroutines


Every entity, regardless if it possesses specific outputs, can be used to fire a sequence of events via the FireUser input. The FireUser input can be related to a subroutine. FireUser inputs are useful for complex entity setups that can be triggered multiple times in a cascading fashion.

In the example map provided, there is a env_explosion entity parented (attached) to a prop_physics garden gnome. There is a point_teleport entity that teleports the garden gnome on the pedestal behind the glass. There is a trigger_multiple entity behind the button that controls and teleports the gnome to the pedestal and fires a series of explosions to bounce the gnome around the room. Since the env_explosion entity is parented to the gnome, wherever the gnome is, the env_explosion entity is in the same relative position. The button on the post tells the trigger to use FireUser1, and the trigger_multiple entity activates all the outputs relative to the User1 input.

Now, any other entity...