doors
Moderator: Moderators
-
dr shenker
- Sergeant
- Posts: 65
- Joined: Mon Jan 26, 2004 7:23 pm
- Contact:
doors
how do i make it that you must unlock the door from another place as where the door acualy is?

-
dr shenker
- Sergeant
- Posts: 65
- Joined: Mon Jan 26, 2004 7:23 pm
- Contact:
-
RiceKrispies
- Private
- Posts: 9
- Joined: Thu May 06, 2004 8:01 pm
Well first find your spot to put your trigger (or your "switch" so-to-speak). Once you find the spot you can make our own switch looking brush or use a model, but thats not important. Thats just there to look like a switch, and tell you where it is.
Then place a brush over it, then right click and select func/trigger/use. It should green, transperant texture over it now. Now with that still selected open your entity window (N), and in the blank where is says "key" put this in: "target" (without the quotes). Then in the "value" blank put: "door1" (or anything you want to name it and of course without quotes).
Now once you've built your door select it and open your entity window once again. In the "key" blank put: "targetname" (without the quotes again). In the "value" blank type: door1 (or whatever you named your door earlier)
There should now be a blue line connecting the switch and the door. If you've got that, your almost done. Now with the door still selected and the entity window still open, select the checkbox that says "targeted" which is right above the key and value blanks.
If you have any questions E-mail me at rk@ck-clan.com . Or AIM me at midgetmafia00. Hope it helps!
Then place a brush over it, then right click and select func/trigger/use. It should green, transperant texture over it now. Now with that still selected open your entity window (N), and in the blank where is says "key" put this in: "target" (without the quotes). Then in the "value" blank put: "door1" (or anything you want to name it and of course without quotes).
Now once you've built your door select it and open your entity window once again. In the "key" blank put: "targetname" (without the quotes again). In the "value" blank type: door1 (or whatever you named your door earlier)
There should now be a blue line connecting the switch and the door. If you've got that, your almost done. Now with the door still selected and the entity window still open, select the checkbox that says "targeted" which is right above the key and value blanks.
If you have any questions E-mail me at rk@ck-clan.com . Or AIM me at midgetmafia00. Hope it helps!

But if you don't want to open it, just unlock it you can make the trigger_use and door like the others said. THen in the script you can do:
(with the door targetname of door1 and the trigger_use a targetname and setthread of door1_unlock)
likewise to lock it again just add:
if you had a trigger_use on the other side to lock it...
(with the door targetname of door1 and the trigger_use a targetname and setthread of door1_unlock)
Code: Select all
door1_unlock:
$door1 unlock
endCode: Select all
$door1 lock
-
dr shenker
- Sergeant
- Posts: 65
- Joined: Mon Jan 26, 2004 7:23 pm
- Contact:
well make a file in Notepad and call it mymapname.scr, of course change mymapname to whatever it is. Put this with your bsp file. Then what type of game is it? (DM, SP?) then I could get you set up...dr shenker wrote:but where and how do i script??
and for that switch, can i just use a little peice of a wall(in a different brush offcourse) ?
Well you can use anything to be your 'switch' of course the actuall switch will be a trigger_use you should have something to mark the location of the switch...
-
dr shenker
- Sergeant
- Posts: 65
- Joined: Mon Jan 26, 2004 7:23 pm
- Contact:
do you have msn??blue60007 wrote:well make a file in Notepad and call it mymapname.scr, of course change mymapname to whatever it is. Put this with your bsp file. Then what type of game is it? (DM, SP?) then I could get you set up...dr shenker wrote:but where and how do i script??
and for that switch, can i just use a little peice of a wall(in a different brush offcourse) ?
Well you can use anything to be your 'switch' of course the actuall switch will be a trigger_use you should have something to mark the location of the switch...
add me if you have it::jorenvdb@hotmail.com
that is easyer to talk
-
dr shenker
- Sergeant
- Posts: 65
- Joined: Mon Jan 26, 2004 7:23 pm
- Contact:
i have a door like this in one of my maps
rotating door,
targetname
door1
soundlocked
door_metal_locked1
add a switch, right click > animate > equipment > electric_switch_nopulse
add a trigger use infront of the switch
setthread
door1_key
SCRIPT:
before level waittill spawn add
then add this thread
rotating door,
targetname
door1
soundlocked
door_metal_locked1
add a switch, right click > animate > equipment > electric_switch_nopulse
add a trigger use infront of the switch
setthread
door1_key
SCRIPT:
before level waittill spawn add
Code: Select all
$door1 lock
level.door1_locked = 1Code: Select all
door1_key:
if (level.door1_locked == 1)
{
$door1 unlock
level.door1_locked = 0
$switch1 anim on
iprintln "Door1 unlocked!"
end
}
if (level.door1_locked == 0)
{
$door1 lock
level.door1_locked = 1
$switch1 anim off
iprintln "Door1 locked!"
end
}

