lockable doors

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
fuhrer
Captain
Posts: 253
Joined: Sun Mar 14, 2004 3:36 am

lockable doors

Post by fuhrer »

hey, im pretty new to scripting, :shock: 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..
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

tutorial map

Post by tltrude »

Is this the locking door tutorial map you used?

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

Image

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.
Tom Trude,

Image
fuhrer
Captain
Posts: 253
Joined: Sun Mar 14, 2004 3:36 am

Post 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.
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

lock

Post 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.
Tom Trude,

Image
fuhrer
Captain
Posts: 253
Joined: Sun Mar 14, 2004 3:36 am

Post 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. :D 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?
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

properties

Post 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.
Tom Trude,

Image
fuhrer
Captain
Posts: 253
Joined: Sun Mar 14, 2004 3:36 am

Post by fuhrer »

ty, i had toggle set, thats why it wasnt closing. :)
Post Reply