![]() BSP Headquarters Logo by Chainsaw ![]() ![]() Lesson 11 - Trigger BrushesIn earlier lessons we've used triggers without really explaining much about them. So I thought I'd take this lesson and delve deeper into the trigger entity and show you some different uses that can be applied to triggers. Before we start, make a copy of the 'lesson10.map' file and name it 'lesson11.map'. (If you don't have 'lesson10.map, click here to get a copy). Now load 'lesson11.map' into BSP and we'll get going. Basically, a trigger is an invisible brush which interacts with other entities (doors, lifts, even monsters!) to make things happen in the Quake world. The list of things you can do with triggers would fill several lessons, so I'll just focus on a few things here. All triggers work pretty much the same way: when a player touches the trigger, the target of the trigger activates. Now one thing you might notice (you might have already noticed this). When you make triggers in your level, you don't have to assign a texture to them, since they're invisible. However, when QBSP runs, you might see an error message complaining that 'ENTITY is not a texture' or something similar. This is caused by having no texture assigned to a trigger brush. If you want you can assign a 'TRIGGER' texture to your trigger brush, but it's not required. As far as I know, Quake runs fine without it, despite the error. 'Nuff said, let's make some triggers... In this lesson, we're going to make a secret room, hidden by a secret door (duh). Let's start off by making the room. Draw a 128x128 brush in the Top view, centered on (-640, -392). In a side view drag the ceiling of this brush to 128 and make sure the floor is at 0. Now make this brush into a room, with wall thickness of 8. (Remember you can edit the BSP.INI file to use the grid size as the default wall thickness). While all the brushes of this new room are still selected, apply a texture of 'BRICKA2_2' to them. Switch to the Right View and select only the floor brush. We need to drag the right hand side of this brush over 8 units, to fill the space under the door we're going to make. This is just like we did when we made our other door in lesson 4. With the floor brush still selected, apply the 'FLOOR01_5' texture to it, so it will blend in with our other floor. Now we're ready to make our door. Select the wall brush from our new room which is inside the wall brush of the room we originally made. When you get the proper brush selected, subtract it from the map, but don't delete it. This will make a hole in the wall, but leave the brush in place so we can make it into a door. Now since we want this to be a secret door, we don't want the player to know it's there, so we need to change the texture to match the surrounding wall. If you followed my suggestions in earlier lessons, the surrounding wall has a 'TECH03_1' texture which is stretched to 2.0 in the vertical direction (an SY value of 2.0). Go ahead and give your new door brush this same texture (or whatever texture you used on your wall). That way it will blend in and be invisible to the player. With this door still selected, we might as well make our door entity, so switch over to the entity window and make this brush into a 'func_door_secret' entity with an angle of 180. Let's also assign a key/value pair of 'wait' '-1'. That way the door will stay open once it's triggered. Now if you want, you can switch over to Quake and try out your level. The secret door works, but you have to shoot it to open it. We'll fix that next by adding triggers, hence the name of this lesson :-) Let's make it so the player has to shoot two buttons in order for the door to open. That way we can use the 'trigger_counter' entity. In order to do this, we'll need to make two buttons, so let's draw a 48x48 brush in the Right View, centered on (-120, 120). Assign this brush the 'SLIPTOPSD' texture. Now select the side of the brush which faces out into the room and assign it the '+2SHOOT' texture. Switch to the Top View and draw your brush so that the top left corner sits on (-912, -96). Before we make this into a trigger, go ahead and copy the brush. Paste a copy and move it so that it is centered on (120, 120) in the Right View and the top left corner sits on (-912, 144) in the Top View. That should make our two buttons, so now let's make them into triggers. Select one of the brushes (it doesn't matter which one) and make it into a 'func_button' entity. Assign a key/value pair of 'health' '1' and another key/value pair of 'wait' '-1'. This tells Quake that the button must be shot in order to work and it will only be triggered once. Now, instead of linking these buttons to the door, we want to make an intermediate trigger to use instead. If we linked them to the door now, either one of them will open the door by itself. This isn't what we want. Since we want the player to have to shoot both of them, we need to make a 'trigger_counter'. Draw a new brush somewhere inside the room. It really doesn't matter where, since it's invisible, so just draw it somewhere out of the way, but make sure it's inside the room. If it's out in the void, we'll have a leak to fix! Make this new brush into a 'trigger_counter' entity and assign a key/value of 'count' '2'. This tells Quake that there are 2 separate triggers which must be activated. The 2 is the default value and you really don't have to do this step, but I wanted you to see how it worked. Okay, we've got our door, our two buttons and the counter; now let's link them together. To make this work properly, you must link all these entities together in the proper order. Any trigger that is improperly linked will not work. First, we need to connect our buttons to the counter, so select one of the brushes and then CTRL-CLICK on the 'trigger_counter' brush. This will link them together. Now select the other button and link it to the 'trigger_counter'. That has completed the first step in making our door work. We've linked the two buttons into one entity and made it so that they both must be activated for the trigger to fire. Now we need to link that to the door. To do this, select the 'trigger_counter' brush and then CTRL-CLICK on the secret door brush. Voila! That's all there is to it. Now if you look in the top view, you should see purple lines leading from each button to the trigger counter and another purple line leading from the trigger counter to the door. Here's what mine looks like. Your map may vary slightly depending on where you drew your trigger counter brush. ![]() Click to Enlarge The yellow brush in the center of the screen is my trigger counter. Notice how the purple lines lead from the two buttons to this brush and then a single line leads from there to the door. Okay, now run your map in Quake and play around with your new buttons. Shoot one of them and you'll see a message appear telling you that there's one more. Shoot the second one and the message 'Sequence Complete' appears and the door opens. It doesn't matter which button you shoot first, the result is the same. You might be wondering how Quake knew to display these messages. That's because they are built into the trigger counter entity. You can override them by assigning a message key/value of your own, but it's not necessary. Well, since this is a secret room, let's give the player credit for entering it. Let's also move the grenade launcher we drew earlier into this room so that it's hidden from the player at first. It's usually a good idea to hide the better weapons and artifacts from your player at the beginning of the game. This makes the game more challenging as they search for bigger and better weapons. Go ahead and select the grenade launcher entity and drag it into the secret room, making sure that it remains sitting on the floor. Now, let's have Quake grant a 'secret' credit for the player entering the room. Switch to the Top View and draw a brush from (-704, -328) to (-576, -352). Switch to the side view and set the top of this brush at 128 and the bottom at 0. Now switch over to the entity window and make this brush into a 'trigger_secret' entity. Assign two key/value pairs: 'sounds' '1' (makes a quick beep) and 'message' 'You have discovered a secret area!' (shows a message to the player). Now when this trigger is activated, the player is granted credit for discovering a secret and a message is displayed. Re-run your level now and notice that the secret section of the status bar shows you have discovered 0 out of 1. Enter the secret room and the counter changes to 1 out of 1. Cool, huh? Now there's one more trigger I want to show you before we wrap up this lesson. Our secret room is cool, but it's pretty dark. Let's put a light in this room, but have it turned off until the player enters the room. To do this, we'll need to make a light attached to a trigger. Make a light entity in the normal way. I assigned a key/value of 'light' '150' to mine. Put this new light in the center of your secret room, centered vertically and horizontally. That way it provides light for the entire secret room. It's not too bright, but provides enough light for the player to see the grenade launcher sitting in the room. Once you've got the light created, click the 'START_OFF' flag in the entity window. This will make the light dark until it's triggered. To trigger our light, let's make a trigger the same size and location as the one we just made (the secret trigger). Make this new trigger into a 'trigger_once' entity. With this new entity selected, link it to the light you just created. Now when the player enters the room, the light will come on at the same time the player sees the message. Try it out and see for yourself. Pretty slick! Well, that should give you an overview of triggers. There are numerous other trigger types available in Quake, but they all work basically the same way. I may go into some of them in a later lesson, if there is a demand for them. In the next lesson, I'll show you how to use groups, which is a really cool feature that BSP incorporates into map editing that can speed up your work. See you soon! ![]() ![]() BSP is the sole creation of
Yahn Bernier. I am only a
dedicated user, reporting news and making tutorials so Yahn can spend
more time enhancing BSP. QUAKE is a registered trademark of Id Software,
Inc. QUAKE(r), the stylized reproduction of the QUAKE(r) trademark,
including, without limitation, the Q in QUAKE(r), and the images
depicted in QUAKE(r) are the copyrighted property of Id Software, Inc.
So there :-P
This web page was created and is being maintained by me (DeadMeat). The main logo for this site was made by QuakeGod. Most everything else was made by me.
All content appearing on this site after August 30, 1997 was written by DeadMeat. Also, DeadMeat's BSP Tutorials were created entirely by DeadMeat. All unauthorized use is prohibited. (c) 1997 |