locked door

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

omniscient
Major General
Posts: 694
Joined: Tue Sep 16, 2003 12:02 am

locked door

Post 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.
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post 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
//**********************************************************************
Last edited by bdbodger on Sat Jan 03, 2004 2:47 am, edited 1 time in total.
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

locked

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

Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post 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 ?
omniscient
Major General
Posts: 694
Joined: Tue Sep 16, 2003 12:02 am

Post by omniscient »

whats the point of giving it a target name, i dont see where its called.
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

lock:

for (local.i = 1 ; local.i <= $door_locked.size ; local.i ++)
omniscient
Major General
Posts: 694
Joined: Tue Sep 16, 2003 12:02 am

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

There is a tutorial for it here at .map

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

Image
omniscient
Major General
Posts: 694
Joined: Tue Sep 16, 2003 12:02 am

Post by omniscient »

where is the tutorial, i didnt find one.
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

tut

Post by tltrude »

here:

/t.php?id=41
Tom Trude,

Image
omniscient
Major General
Posts: 694
Joined: Tue Sep 16, 2003 12:02 am

Post by omniscient »

um, thats a tutorial on how to lock/unlock doors, im talkin one that is always locked.
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

locked

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

Image
omniscient
Major General
Posts: 694
Joined: Tue Sep 16, 2003 12:02 am

Post by omniscient »

would right clicking the brush and going to trigger->use do that same thing?
omniscient
Major General
Posts: 694
Joined: Tue Sep 16, 2003 12:02 am

Post 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?
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

the door_locked.scr is in pak0.pk3 in the global directory
Post Reply