This tutorial will explain how to open doors using a lock-pick, or a key-card.
LOCK-PICK AND KEY-CARD
By baltic.forever
This tutorial will explain how to open doors using a
lock-pick, or a
key-card.
First, it might be helpful if you download the map that this tutorial is based on, and have it loaded into the editor. This map already includes the two doors for this tutorial, but they will still need a little setting up.
You can download it
HERE then just unzip it into you're SoF2 "
base" folder.
Ok, lets start with the lock pick.1. Create a brush
16 units (
grid units) square by 8 units thick and give it the "
tools/trigger" texture.
2. Make sure the brush is flush with the door handle (
click here for picture).
3. Right click in the 2d window, and select "
trigger_toolbox".
4. Press "
N" on the keyboard to bring up the entity editor, and enter the following "
key/value" pairs.
key
targetvalue
door1key
holdtimevalue
5 //{time in seconds to open the door}
key
iconvalue
hud/lock_pick //{this is the icon that is displayed on the screen}
key
actAngle //{make sure you use CAPITAL letters where shown}
value
0 0 0 //{actAngle values will be explained later}
//{these next three settings create the sound effects}
key
startSoundvalue
sound/misc/lockpick/pick_startkey
loopSoundvalue
sound/misc/lockpick/pick_loopkey
endSoundvalue
sound/misc/lockpick/pick_doneYou will also need to make sure that the "
directed" and "
once_only" spawnflag boxes are selected.
6. Highlight the
door and the
origin brushes and press "
N" and enter the following "
key/value" pair.
key
targetnamevalue
door1You will also need to make sure that the "
locked" box is selected. You could also select the "
usable" "
smart" and "
auto_close" boxes if you wanted to.
You should now have a door that will open after 5 seconds, by picking the lock.
Q. What does
actAngle and
0 0 0 do?
A. The
actAngle key simply forces the player to be facing in a certain direction, before the trigger can be used.
The "value"
0 0 0 means that the player has to be facing East (in the 2d window) to use the trigger. North is
0 90 0, West is
0 180 0 and South is
0 270 0.
Now onto the key-card. There is a bit more work involved with this part of the tutorial, so lets get started.
First, move to the table inside the building.
1. Create a brush,
16 x 8 x 8 units.
2. Click on "
curve" at the top of the editor, then click on "
simple patch mesh", then "
OK".
3. Press "
shift+S" to open up the "
patch inspector".
4. In the textures box at the top enter "
textures/common/keycard" and press the "
return or enter" key on you're keyboard, if the texture looks ok then click on "
done".
If the texture is facing the wrong way or not aligned with the patch, then use the patch inspector's arrow keys until the texture fits, before you click on "
done". {If you still cant get the texture to line up correctly, then just make a normal brush
16 x 8 x 1 unit and place the "
textures/common/keycard" texture on it. You can then change the texture of the four sides to make it look more natural}.
5. Place the patch mesh flush with the top of the table (
click here for picture).
{The texture may seem to disappear and reappear, but this is normal and will show up ok in the game}.
6. While the key-card is still highlighted, right click in the 2d window and select "
func_wall"
7. Press "
N", and enter the following;
key
targetnamevalue
card1T
hat takes care of the card, now onto the trigger.1. Create a brush in front of the key-card and place the "
tools/trigger" texture on it
2. Right click in the 2d window, and select "
trigger_multiple".
3. Press "
N" on the keyboard, and enter the following.
key
targetvalue
card14. Select the following spawnflag boxes
once_onlyplayer_useplayer_onlyNow that we have the key-card set up, we will need something to use it on.
Move over to the card-scanner next to the steel door and do the following
1. Create another "
trigger_multiple" brush that is the same size (roughly) as the scanner, and place the brush just in front of it.
2. Press "
N" on the keyboard, and enter the following;
key
targetnamevalue
door_trig1key target
value door2
3. Select the following spawnflag boxes
player_useinactive //{trigger cant be used until activated}
player_onlyWe now need a way to activate the trigger once the key-card has been picked up. For this we need a "
target_activate".
1. Right click on the 2d window, and select "
target_activate" and position it somewhere near the trigger brush.
2. Press "N" on the keyboard, and enter the following;
key
targetnamevalue
card1key
targetvalue
door_trig1Finally, we need to connect the trigger to the door.1. Select the door brush and press "
N" on the keyboard.
2. Enter the following
key
targetnamevalue
door2That's it. Compile the map and try it out.If you have any problems with this tutorial, then you can also download the completed map
HERE.