Submitted by
Andy on Thu, 2005-03-31 23:08.
Hammer 3.4
Security Cards - by Andy
Here's a really quick tutorial about getting a key to open a door (there might be an easier way to do this but I found that this method works pretty well). You can also use the key in other levels by just cloning the door, trigger and multisource.
The idea here is to make sure that the door will not open until you have the key. First up place an item_security entity, an env_global entity and a multisource in your map. Oh yeah, don't forget the door and the card scanner.
In the properties of the item_security entity, set the 'Target' to the name of the env_global.
I have used the name card to make things easy. [ Something of interest here is that you could also use a world_items entity because it does the same thing.]
In the properties of the env_global entity, set the Name to card, Global State to Set to cardtaken, Trigger Mode to On and Initial State to Off.
In the properties of the multisource set the Name to Cardms and Global State Master to cardtaken.
You need to set the properties of the door and the door's func_button (card scanner) so that it actually works. The card scanner does not need a name; the only properties that really need
setting are the Target, in this case door2 (the name of the door) and
Master, cardms (the name of the multisource). If you want the door to close behind the player, make sure that Toggle is not checked in the flag properties and that the door has the same flag.
So What's Going On?
Picking up the security card calls the global (card) which sets the state to cardtaken.
The multisource will not let the func_button operate until the cardtaken
state has been called and now that it has, it allows the func_button to operate.
There are two maps provided because I wanted to prove the Global.
So this is what it looks like. Someone has bashed poor old Barney on the head, and the key is by his side . Try using the card scanner on the table before you get the card. The set of entities used lend themselves to endless possibilities, so have fun and if you find more uses then let us know through the forum.
This tutorial first appeared at TWHL in 2002, as an attempt to duplicate a tutorial I once read. I believe the original article was written by Venomus @ The SpawningTank and all credit for the initial guide should go to him.
Grunts and Gun's
Day of Defeat Tutorials