Page 1 of 1

Locking a door

Posted: Wed Jun 29, 2005 12:32 am
by MasterMind
I was wondering, how do i make a door that can be locked and unlocked from a single switch? Also I'd like the swicth to be animated and the door to make a locked sound when its locked :)

thx

Posted: Wed Jun 29, 2005 3:38 am
by lizardkid
This is from a scripters perspective:

Make a regular func_rotatingdoor
Give it a key/value of

$targetname/door

Make a switch model, and put a trigger-use around it

give the trigger key/values of

wait/5
setthread/doDoor

Give the switch key/values of

$targetname/switch

Open script, make a new thread.

Code: Select all

doDoor:

//switch anim code, don't know it right offhand
if(level.doorLock == 0)
{
$door unlock
$switch anim alarm_turnon
$switch playsound alarm_switch
}
if(level.doorLock == 1)
{
$door lock
$switch anim alarm_turnoff
$switch playsound alarm_switch
}

end
in your main thread after level waittill spawn:

Code: Select all

$door lock
level.doorLock = 0

lock

Posted: Wed Jun 29, 2005 4:56 pm
by tltrude
Here is a tutorial map that has lockable doors. The zip file contains the .map file, a playable pk3, and a text version of the script.

http://pages.sbcglobal.net/tltrude/Temp ... e_test.zip

Image

Posted: Wed Jun 29, 2005 5:09 pm
by MasterMind
thanks guys

i got my lockable door up and running :D

if i know that you could just say "$door lock" to lock the door i wouldnt have asked the question, lol

thx for the code lizardkid, there were a few bugs in it but i fixed em

Posted: Wed Jun 29, 2005 5:18 pm
by MasterMind
one more question, is there any way i could put something on the scoreboard(the tab thing) that shows if the door is locked or unlocked?

Posted: Wed Jun 29, 2005 8:36 pm
by MasterMind
nevermind i found what i was looking for :)