Page 1 of 1
lockable doors
Posted: Sun Mar 14, 2004 3:40 am
by fuhrer
hey, im pretty new to scripting,

slowly gatherin pieces of information from the tutorials but the door locking tut isnt working,
i basically have a locked door, and i want a switch on one side that opens it for say 10 seconds then closes again.
where do i begin? i got the door locked usin the locekd doors tut but i cant make a switch to open it, and the 10 second thing.....
i got a fan workin which was cool but some of those script commands variables etc etc confuse the hell out of me.
oh and the scriptin tuts dont really help much, its cool to copyt and paste it and watch it work but it dont really explain line by line why it works..
tutorial map
Posted: Sun Mar 14, 2004 4:46 am
by tltrude
Is this the locking door tutorial map you used?
http://pages.sbcglobal.net/tltrude/Temp ... e_test.zip
I does not have a step by step readme file, but if you highlight stuff and hit key N you will see the properties of the door, triggers, and switches. When you see "setthread" it means "run that thread" in the script. There is a text version of the script you can look at in the zip.
Posted: Sun Mar 14, 2004 5:43 am
by fuhrer
ok this is cool i got the lock to work, however......the door is unlocked at the beginning of the map, i want it to be locked, ive gone thru the test script and mine, and as far as i can tell everything to do with the lock is the same, i am using a rotating door inside of a sliding door, not sure if that is the problem.
lock
Posted: Sun Mar 14, 2004 5:49 am
by tltrude
Maybe you missed these lines at the top of the script.
$door1 lock
level.door1_locked = 1
$door2 lock
level.door2_locked = 1
They lock the doors when the game starts and set the intitial value of the variables.
Posted: Sun Mar 14, 2004 5:57 am
by fuhrer
i made sure of that, but nevermind, i changed the lines if (level.door1_locked == 1) etc around and the door is now locked at the start.

that only took 5 hours
nother question, how come that door doesnt close by itself? as the normal doors do, how can i make it close automatically after a set period of time?
properties
Posted: Sun Mar 14, 2004 6:03 am
by tltrude
It's all in the door properties (Key N). If you set key/value wait/10 it will wait ten seconds before closing. If TOGGLE is set in the check box, it will wait until a player closes it.
You can also script it to close with:
wait 10
$door1 close
I don't remember how I did it.
Posted: Sun Mar 14, 2004 6:46 am
by fuhrer
ty, i had toggle set, thats why it wasnt closing.
