Page 1 of 2
unlock door from somewhere else
Posted: Fri May 23, 2003 12:13 am
by solar
OK, I've done a lot of searching and can't find a thread that is exaclty what I need. Basically, all I need is a door that is locked and sounds like it is locked, but can be unlocked by a switch elsewhere. Can someone tell me an easy way to do this. Please provide me with both a way to simply unlock it and a way to make the switch triggerable so it will relock it if activated. I don't know which way I will use and would like to test both. Thx.
Posted: Fri May 23, 2003 12:17 am
by nuggets
what kinda door? metal/wood then i'll give u ur reply
Posted: Fri May 23, 2003 12:20 am
by solar
It's a wooden door. thx
Posted: Fri May 23, 2003 12:27 am
by nuggets
place a trigger over the door that'll trigger the locking sound,
key: targetname
value: door_trigger
key: setthread
value: my_door
place a trigger over the object that'll trigger the door (i'e the switch)
key: targetname
value: door_switch_trigger
key: setthread
value: door_switch
make the door a script object
key: targetname
value: lockable_door
then scripting
main:
level.lockeddoor = 0
end
my_door:
if (level.lockeddoor == 0)
{self playsound door_wooden_locked}
else
{
door_trigger nottriggerable
lockable_door time 3
lockable_door rotateYup 90
lockable_door waitmove
wait 5
lockable_door rotateYdown 90
lockable_door waitmove
door_trigger triggerable
}
end
door_switch:
if (level.lockeddoor ==0)
{level.lockeddoor = 1}
else
{level.lockeddoor = 0}
end
//though you may still want to add a team check if u need 1
Simple
Posted: Fri May 23, 2003 8:06 am
by tltrude
Her is an alterative remote door. Just download my tutorial map and look for the door with switches.
http://pages.sbcglobal.net/tltrude/Temp ... ngdoor.zip
There are also a locked door that has to be shot or blown open.
Posted: Fri May 23, 2003 12:45 pm
by solar
Didn't work nuggets, don't know why. Here is my logfile excerpt:
logfile:
unknown command: door_trigger
door_trigger nottriggerable (maps/obj/dbenztest1.scr, 35)
^
unknown command: lockable_door
lockable_door time 3 (maps/obj/dbenztest1.scr, 36)
^
unknown command: lockable_door
lockable_door rotateYup 90 (maps/obj/dbenztest1.scr, 37)
^
unknown command: lockable_door
lockable_door waitmove (maps/obj/dbenztest1.scr, 38)
^
unknown command: lockable_door
lockable_door rotateYdown 90 (maps/obj/dbenztest1.scr, 40)
^
unknown command: lockable_door
lockable_door waitmove (maps/obj/dbenztest1.scr, 41)
^
unknown command: door_trigger
door_trigger triggerable (maps/obj/dbenztest1.scr, 42)
^
^~^~^ Script file compile error: Couldn't compile 'maps/obj/dbenztest1.scr'
^~^~^ Game (Event: 'setthread', Object: 'TriggerUse') : Script 'maps/obj/dbenztest1.scr' was not properly loaded
^~^~^ Game (Event: 'setthread', Object: 'TriggerUse') : Script 'maps/obj/dbenztest1.scr' was not properly loaded
Will try your version as soon as I get a chance Tom, thx.
Posted: Fri May 23, 2003 1:00 pm
by jv_map
Just add key 'lock' (no value) and your door is locked 8)
Later you can do $door unlock or something to unlock the door.
$
Posted: Fri May 23, 2003 1:06 pm
by tltrude
All those targetnames in the script need the $ symbol in front of them.
$door_trigger
$lockable_door
Posted: Fri May 23, 2003 3:24 pm
by solar
Tom, I'm at work and can only view the map in radiant and I have the worst system here to boot. I'm having difficulty finding the door you're referring to. Can you pinpoint it for me? Thx.
door
Posted: Fri May 23, 2003 7:00 pm
by tltrude
It is made of window texture and has to posts with switches next to it. It also is the only door with script_origins that act as fake players.
Posted: Sat May 24, 2003 2:13 am
by solar
well nuggets, got it to work somewhat. The door rotates across its center axis and there's no way to bypass it, so I don't see how you can make "rotateYup" work. It also won't stay open if you stand next to it and there is no sound. The playsound won't work because of ubersound, I think.
Basically, I need this to work using a normal func_rotating door. JV- can you elaborate a bit on what you mentioned, maybe give me a sample script and I'll try to work out the rest. Thx
Origin
Posted: Sat May 24, 2003 7:01 am
by tltrude
You need an origin brush at the hinge of a script_object door just like you do with a func_rotating door. Normally the center of an object is its pivot point. But if you add an origin brush to the object, the center of that brush becomes the pivot point.
Posted: Sat May 24, 2003 7:16 am
by jv_map
Example (I assume your door has targetname door):
Code: Select all
main:
$door lock
$door.locked = 1
end
switch:
// called from setthread
if($door.locked)
{
$door.locked = 0
$door unlock
}
else
{
$door.locked = 1
$door lock
}
end
That's all, just use a trigger_use with setthread switch like nuggets suggested. You don't need a trigger for the locked sound.
Posted: Sat May 24, 2003 2:16 pm
by solar
So let me get this straight before I waste time with a compile, jv. In your example, the door is a func_rotating door, not a script object- correct?
Yes
Posted: Sat May 24, 2003 2:58 pm
by tltrude
Yes, his script is for a normal rotating door targetnamed door.
If you want the switch to play the locked sound you can add this line under the door lock and unlock lines.
$switch playsound door_metal_locked_clue
or
$switch playsound door_wood_locked_clue
Of course, you can have the door play that sound if you like. If it is a rotating switch you can add these lines to make it rotate on and off.
$switch anim turn
and
$switch anim idle