Vlatitude: Advanced Triggers Tutorial Last edited 6 months ago2019-04-25 11:47:07 UTC by Penguinboy Penguinboy

Download example

In this tutorial, I will cover all trigger_ entities other than trigger_once, trigger_multiple, and those fully covered in other tutorials. I won't go into a lot of detail with some of them, because they are fairly easy. If you have not read the Introduction to Triggers tutorial, read it now so you know the basics, and what I mean by point-based and brush-based. Others, however, are quite complicated. This tutorial will serve as a reference for all of them. The triggers covered are

Trigger_auto

I get quite a few e-mails with questions that can be answered and fixed with this helpful entity. This point-based entity will trigger its target when the player first launches the level. That's it, nothing to it. If you want a scientist to start the level in a certain idle animation, trigger its scripted_sequence with a trigger_auto. Set a trigger_auto to target a multi_manager for a sequence that starts immediately. This is much more elegant and bug-free than having your player start in a trigger_once box. Another tip is to set the delays of the trigger_auto to something like .5 to make sure that all entities load before the trigger_auto activates them.

Trigger_autosave

A brush-based entity that will save the game to the quicksave slot. Make sure to place these in your single-player levels so people don't have to start from the beginning when they die, or they won't get thrown back to a saved game in a different level altogether.

Trigger_camera

This is such a complex entity that it has its own tutorial. Be prepared for some thinking and experimenting.

Trigger_cdaudio

A point-based entity that is about as simple as they come. Put it in your level, give it a name, and tell it what number track to play. When it's triggered, it will play this CD track. Use this to create suspense and drama, but don't overuse it.

Trigger_changelevel

Another entity that has its own tutorial.

Trigger_changetarget

This is a nice little point-based entity. When it's triggered, it changes the target of a designated entity to something else. Here's how its arguments work: Target is the entity whose target we want changed, and New Target is what we want to change it to. Possibilities are numerous with this entity, see the example map for one of them.

Trigger_counter

Finally, more complex stuff! This entity can be either brush-based or point-based, depending on whether the No Clients flag is checked. If it's checked, then it's a point-based entity: if not, brush-based. Here is what it does: it will trigger its target after it itself is triggered a designated amount of times. This number is designated in the Count before activation attribute. So if you set it to be brush-based, and set the count before activation to 3, the trigger_counter's target will be activated the 3rd time a client touches it.

Trigger_endsection

This entity will send the player back to the Half-Life menu when triggered. It can be either brush-based or point-based, and this is designated by the Use Only flag. If it's checked, the entity can only be activated by a trigger. Trigger_endsection was used to bring the player back to the menu after completing the hazard course. Mayber, you will want to end your single-player levels by going back to the menu, instead of just fading the screen with enf_fade. The accepted values for section are:

Trigger_gravity

This is used to change the force of gravity in your entire level. Those familiar with Quake, will surely recall the Ziggurat Vertigo effect. This trigger is strictly brush-based. I have tried to activate it using its name, but have been unsuccessful so far. If you can do it, e-mail me and tell me how you did it. Anyway, the only unfamiliar attribute should be Gravity. This is a scale, which should be set between 0 (0 gravity) to 1 (normal gravity, 9.81 m/sē to be exact). Do not set your gravity at 0, because this will not work. Instead, use .1 for a really low gravity. This is how you should apply this entity in practice; since it affects the whole level, you should put it on entrances and exits to the rooms with altered gravity, so when the player leaves them, the gravity goes back to normal. You need at least two trigger_gravity entities: one to change the gravity to something abnormal, another to change it back to normal. So when entering the affected room(s), have the player pass through a trigger_gravity with a gravity value of 1, and right after it, through a trigger_gravity box with a gravity value representing the new gravity. The same order should be set when leaving the room(s), but logically in reverse. So first the player would walk through the altered gravity trigger, and then through the one that makes gravity normal. Although it might seem limiting that you cannot trigger this entity, it will still abide Multisource entities, giving it some flexibility. For realism, I suggest using this with large fans, or buttons, or blinking lights. To clarify how the 4 triggers in the above example should be arranged, take a look at the example map.

Trigger_hurt

This is the most sadistic trigger entity. It's extremely easy to use, and is quite versatile. This entity simply inflicts damage on the unfortunate player. The damage type attribute detemines what hazard icon will flash in the H.E.V. display, and Damage is how much it will hurt. Setting the damage to 1 for example, will only display the damage type icon, but will not actually hurt the player. This is useful to notify the player that the surface they're standing on is hot hot hot! Like any good trigger entity, the trigger_hurt can be targetted, and controlled by a Multisource. Something very important to remember is that this is a brush-based entity, and it must completely cover the area in which damage will be inflicted. So if your floor is electrified, put the trigger_hurt brush on the floor. Some good uses for this entity are: burning surfaces, freezers, poisonous gas sprites, radioactive liquids, and more.

Trigger_monsterjump

This is a brush-based entity. When a monster enters its field, the monster will make a jump in the direction of the black coordinate system in the entity properties of the Trigger_monsterjump. However, this jump will be awkward looking, unrealistic, and very one-dimensional. Therefore, I suggest that you only use this entity in extreme emergencies, when you absolutely need to have the houndeye jump onto a platform, or a human grunt to jump down into a well, or off a train or something. In order to activate this entity, you need to make a multisource Master for it, and then activate the multisource.

Trigger_multiple

This is pretty throughly covered in the basic triggers tutorial.

Triger_once

See above.

Trigger_push

This entity is a barrel of fun. I briefly touched upon it in my water tutorial, but here I'll explain how it works. This is a brush-based entity, that will push the player, or pushables in the direction designated by its white on black line in entity properties. Its uses are limited by your creativity. The most common uses are water current, and air propelled by a fan. All of its flags and attributes are self-explanatory, but keep in mind that the speed of push is probably higher than you think. Having values near one thousand and over is not umcommon. The direction of push is of course designated by the white-on-black coordinate.

Trigger_relay

A super-handy little gem of a trigger :) This entity is extremely useful, and delightfully simple. It's entity-based only, and works as a sort of link between a targeting entity, and its targeted entity. Here is a (poorly made) flowchart to show one example. In this example, a button is pressed, a door opens. Two seconds later, an explosion (near the door perhaps) explodes, and the room shakes a bit.
User posted image
As you can see, the trigger_relay can be used to insert a delay between objects targetted by the same entity, or it can go on a totally independent targetting sequence. What makes it nice are the options that come with it. It can kill target, remove on fire, and can be either toggled or switched just once. This entity is great for a quick fix, but if you plan to target 3 or more entities, the multi_manager entity should be used to replace your 3+ relays. With a multi_manager your sequence is more organized, and doesn't have a bunch of point-based entities cluttering your Worldcraft windows.

Trigger_teleport

A brush-based trigger used for teleporting. Learn about it in the Teleporters Tutorial.

Trigger_transition

Another trigger described in the Level Transitions tutorial.

That's it, have fun!
This article was originally published on 69th Vlatitude.
TWHL only archives articles from defunct websites. For more information on TWHL's archiving efforts, please visit the TWHL Archiving Project page.

Comments

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