How do I trigger certain events?

OctoBlitz

Sabotage related, and Tak approved!
aa
Jan 15, 2016
357
193
Hi guys,
I am currently working on a map using moving brushes, example is when a team captures a point, a platform will rise and fall. I am fairly new to mapping and I only know how to make brush entities, ramps, place props, etc. so if anyone could teach me how to make them I will be very grateful for your help. (p.s. a good example of what I am trying to do is in koth_probed with the lasers...)
 

killohurtz

Distinction in Applied Carving
aa
Feb 22, 2014
1,016
1,277
https://developer.valvesoftware.com/wiki/Inputs_and_Outputs

The I/O system is what controls every dynamic event in a map. If you want Entity B to do something when a certain thing happens to Entity A, then you create an output in Entity A that points to Entity B and tells it what to do. For example, a typical spawn door output looks like this:

In trigger_multiple: OnStartTouchAll | name of func_door | Open
Which translates to: when a player is standing in the trigger, this func_door should open.
Then you have another output that closes the door using OnEndTouchAll.

Some inputs take parameters, like SetOwner for control points, which accepts a team number. You can also set a delay on one output in a pair to make two things happen.

Now, if you want a platform to move when a control point is captured, you can format the output like this:

In trigger_capture_area: OnEndCap | name of platform entity | <Input>
You can also use OnCapTeam1 (red) or OnCapTeam2 (blu) for team-specific outputs.

The input named in this output depends on the entity you use for the platform. If you just want it to move up and down, you could parent it to a func_door, or perhaps a func_movelinear, and send it the input Open or Close depending on the Start Position you entered in its keyvalues.

Hope this helps!
 

Tumby

aa
May 12, 2013
1,085
1,194
You will need to learn how the I/O system works. Most entities are able to fire an Output when something specific happens (examples: timer entitiy hitting its time limit, counter reaching a number, trigger getting touched by a player). The contents of the Output are highly dependent of the entity recieving it. Most entities can have an Input called "Enable" and "Disable" but only ambient_generic can have "Playsound". An Output can also have a delay, meaning you can have a bunch of Outputs that would fire at once, but do so in order because each one has a different delay.
A laser like on probed (without the exploding alien which has to respawn and all that) would simply be a env_laser or env_beam, targetting an info_target and getting enabled and disabled by a logic_timer. When the timer hits the time, it instantly enables the laser and disabled it on a delay of 1 second or so.
From here on we can get a lot more complicated with all the weird logic_ entities, as well as editing a vmf in notepad to allow certein Outputs to not only be fired once or infinitly, but instead any specific number of times.
It's also important to note that any entitiy can be targeted by an Output. You can target either one named entity, a bunch of entities with the same or similar name and even any entitiy of a specific type.

https://developer.valvesoftware.com/wiki/Inputs_and_Outputs

Edit: Damn you killohurtz