unlock door from somewhere else
Moderator: Moderators
unlock door from somewhere else
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.
-
nuggets
- General
- Posts: 1006
- Joined: Fri Feb 28, 2003 2:57 am
- Location: U-england-K (england in the UK) :P
- Contact:
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
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
hope this helps, prob not cos it's all foreign 2 me :-/
Simple
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.
http://pages.sbcglobal.net/tltrude/Temp ... ngdoor.zip
There are also a locked door that has to be shot or blown open.
Didn't work nuggets, don't know why. Here is my logfile excerpt:
logfile:
logfile:
Will try your version as soon as I get a chance Tom, thx.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
$
All those targetnames in the script need the $ symbol in front of them.
$door_trigger
$lockable_door
$door_trigger
$lockable_door
door
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.
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
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
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.
Example (I assume your door has targetname door):
That's all, just use a trigger_use with setthread switch like nuggets suggested. You don't need a trigger for the locked sound.
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
Yes
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
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

