Vlatitude: Two-way Trigger Last edited 1 year ago2022-09-29 07:56:37 UTC

Download example

This is my first tutorial, so bear with me if it is hard to follow. It explains how to make two-way triggers. Walk through one way, and it will do one thing, walk back through the other way it will trigger another. I say walk back through, because if you have a map like below:
User posted image
Where the pink strip is your two-way trigger, you can walk through direction a and get one thing triggered, or go round the other way (direction b) and it will trigger another thing. If you don't understand this, then hopefully it will become clear as you read the tutorial.

Now the entities we will be using are as follows, so if you don't know them, find a tutorial for them: First create a trigger_multiple and call it trigger, this is the brush-based trigger that the player will pass through. Give it a target of mm1 and a delay before reset of 1. Now create two multi_manager s named mm1 and mm2. Add to mm1 the targets and to mm2, add these: Now create two game_texts/ambience_generic entities, one called message1 and the other message2 and give them the same message text as their name: wav name of vox/one.wav and vox/two.wav. You can replace these with what you want to trigger, but use game_texts/ambience_generics to test it. These are used simply to demonstrate which "direction" is being triggered. Now make two trigger_changetargets, calling them change1 and change2. Give them both a target of "trigger", and make KillTarget "target". This last step is somewhat misleading since usually KillTarget does just that, gets rid of the specified entity. However, in this case, KillTarget specifies which field of the targeted entity will be replaced. Since we are interested in changing trigger's target, KillTarget is set to "target". Depending on whether you have the old or new fdg, you will have a property called New Target or m_iszNewTarget. Whichever one you have, make it mm2 for change1 and mm1 for change2.

Now whenever you walk through one way, it will say "text 1"/"one", and when you walk back, it will say "text 2"/"two". The only bug I have found in this technique is that if you stay inside the trigger, it will loop through the text or whatever you trigger. To avoid this happening very often, make the trigger 1 unit thick, so it is difficult to stay inside.
This article was originally published on 69th Vlatitude.
The original URL of the article was http://www.vlatitude.com/tutorials.php?tutID=47.
The archived page is available here.
TWHL only publishes archived articles from defunct websites, or with permission. 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.