Page 1 of 2

locked door

Posted: Fri Jan 02, 2004 4:37 am
by omniscient
quick easy question. how do u make a locked door? just like u walk up to it and it makes the lock noise.

Posted: Fri Jan 02, 2004 7:40 am
by bdbodger
exec global/door_locked.scr

//**********************************************************************
//*** locked sounds for doors
//*** place a trigger_use in front of the door you want to be locked
//*** make the targetname of the trigger 'door_locked'
//*** add a keyvalue to the trigger of $type [wood | metal | metal_garage]
//*** if you put nothing, then wood is default
//**********************************************************************

locked

Posted: Fri Jan 02, 2004 8:38 am
by tltrude
There is a value missing from the comment, it is "large". Here is an example:

key: $type
Value: large


And the line that goes under "level waittill prespawn" is:

exec global/door_locked.scr::lock

Posted: Fri Jan 02, 2004 6:59 pm
by bdbodger
Just wondering if you execute a .scr and don't call a thread in that script it will run the first thread untill it hit the word end ? I mean main has no meaning just a common thread name ?

Posted: Sat Jan 03, 2004 2:22 am
by omniscient
whats the point of giving it a target name, i dont see where its called.

Posted: Sat Jan 03, 2004 2:46 am
by bdbodger
lock:

for (local.i = 1 ; local.i <= $door_locked.size ; local.i ++)

Posted: Sat Jan 03, 2004 2:54 am
by omniscient
that doesnt make much sense to me, im kinda dumb aobut that stuff. and i dont quite understand what im supposed to do, what are the locked door sounds?

There is a tutorial for it here at .map

Posted: Sat Jan 03, 2004 5:34 am
by tltrude
There is a tutorial for it here at .map and it explains everything.

Basically that line from the door_locked script bdbodger showed you is the one that looks for the targetname "door_locked" and assigns different index numbers to each trigger_use it finds--with that name.

Hmmm, just noticed that there is no sound in ubersound for "door_locked_large", so don't use:

Key: $type
Value: large

because it wont work.

bdbodger -- You are right, that line would still work without the "lock" thread being called, because it is the first thread in the script anyway. I just added it, because that is how 2015 has it in their scripts.

Yes, "main" is just a name and any name can be used for the first thread in a script. And, as you probably know, the first thread can be bypassed using the "::" command to make it point to a different thread.

Posted: Sat Jan 03, 2004 10:23 pm
by omniscient
where is the tutorial, i didnt find one.

tut

Posted: Sun Jan 04, 2004 3:15 am
by tltrude
here:

/t.php?id=41

Posted: Sun Jan 04, 2004 6:35 am
by omniscient
um, thats a tutorial on how to lock/unlock doors, im talkin one that is always locked.

locked

Posted: Sun Jan 04, 2004 11:50 am
by tltrude
Ok then:

1. Under "level waitill prespawn" in your script add this line.

exec global/door_locked.scr::lock

2. In your map, place trigger brushes in front of all the doors you want locked.

3. Highlight one of them and hit key N.

4. Find "trigger_use" on the list and double click it.

5. Add this key/value.

Key: targetname
Value: door_locked

6. do the same (steps 3-5) for all the trigger brushes.

7. The end.

Posted: Mon Jan 05, 2004 2:20 am
by omniscient
would right clicking the brush and going to trigger->use do that same thing?

Posted: Mon Jan 05, 2004 2:31 am
by omniscient
exec global/door_locked.scr::lock

why would tthat be needed, i dont have a door_locked.scr. do i have to make one?

Posted: Mon Jan 05, 2004 2:41 am
by bdbodger
the door_locked.scr is in pak0.pk3 in the global directory