Locking door Created 18 years ago2005-10-03 19:19:20 UTC by J3r3my J3r3my

Created 18 years ago2005-10-03 19:19:20 UTC by J3r3my J3r3my

Posted 18 years ago2005-10-03 19:19:20 UTC Post #139091
How would you make a door thats normally opened by a trigger_multiple lock by pressing a switch?
Posted 18 years ago2005-10-03 19:41:48 UTC Post #139093
Use a multisource and fill it's name in in the master property of the door. Now set up an env_global and set the global state of that multisource off whenever you trigger the env_global. Trigger the env_global by the switch and you can lock the door.
Basically, the state of the doors master (the multisource here) controls whether it can open or not. The same can be applied to buttons and a lot of other entities.

Alternately, you can give the door the name 'locked' so it's always locked (thanks to Muzzle for that one ;)). Not what you need here but just in case, that's the easy way for always locked doors.
Posted 18 years ago2005-10-03 19:47:41 UTC Post #139094
So does the trigger_multiple target the multisource too or does it still just target the door?
Posted 18 years ago2005-10-03 20:12:43 UTC Post #139098
No, the env_global should be used to change the state of the multisource. Since the multisource is set as the master of the door, it's state controls whether the door can be opened or not.

So you should trigger the env_global by the switch, so he changes (sets off) the state of that multisource.

EDIT: I've still got an old example map on a site somewhere, here it is. I just hope it's the right one... ;)
Posted 18 years ago2005-10-03 20:20:52 UTC Post #139100
I think I get it now thanks.
Posted 18 years ago2005-10-04 02:39:35 UTC Post #139163
jaardsi has an Example Map too, without the global, I believe.
Seventh-Monkey Seventh-MonkeyPretty nifty
Posted 18 years ago2005-10-04 04:04:48 UTC Post #139190
Alternately, you can give the door the name 'locked' so it's always locked (thanks to Muzzle for that one ).
Naming the door 'locked' (target name) won't actually make it locked. To make a locked door, without the ability to ever open it, use these properties:

(func_door_rotating)
name: dummydoor
speed: 0
delay before close: 0
Locked sound: Latch Locked
Distance (deg) 0

With these properties added to the door, the door never will open, and when you touch it, you will hear the locked sound.
Use a multisource and fill it's name in in the master property of the door. Now set up an env_global and set the global state of that multisource off whenever you trigger the env_global. Trigger the env_global by the switch and you can lock the door.
Basically, the state of the doors master (the multisource here) controls whether it can open or not. The same can be applied to buttons and a lot of other entities.
Sigh. And again: you don't need an env_global to achieve that effect! All you need is:

The locked door
A lock
One multisource

Required properties to fill in:

The locked door:
master: lock_ms

The lock:
target on break: lock_ms

The multisource:
name: lock_ms

What will hapen:

When you destroy the door lock with your crowbar or any other weapon, it'll target the multisource, and the multisource will target the door making it unlocked.

I haven't tested this yet, but i used this method before, and i believe this is the way to do it.
The Mad Carrot The Mad CarrotMad Carrot
Posted 18 years ago2005-10-04 07:17:11 UTC Post #139206
Seventh you should post my tutorial it has a section on disabling stuff with a multisource or a trigger_changetarget. :glad:
Posted 18 years ago2005-10-04 14:01:20 UTC Post #139333
Yeah, but I've got to mark it up first, and I'm very busy at the moment. Yours is the second in line (don't worry, madcow, I haven't forgotten yours!)
Seventh-Monkey Seventh-MonkeyPretty nifty
Posted 18 years ago2005-10-07 02:28:00 UTC Post #139993
I tried it but it still didnt work :
Posted 18 years ago2005-10-07 03:50:46 UTC Post #140007
Read my post! It'll definitely work.
The Mad Carrot The Mad CarrotMad Carrot
Posted 18 years ago2005-10-07 04:33:20 UTC Post #140012
Posted 18 years ago2005-10-07 22:50:39 UTC Post #140201
Ok let me explain it better. The button is an on/off switch. When the switch is on the door will be unlocked. When someone turns the the swith off the door locks. Thats what im trying to do.
Posted 18 years ago2005-10-08 02:25:33 UTC Post #140205
jaardsi has an Example Map too, without the global, I believe.
Seventh-Monkey Seventh-MonkeyPretty nifty
Posted 18 years ago2005-10-08 03:28:50 UTC Post #140218
And the tutorial has no global in it too!

An extraction from my yet to come tutorial:

Disabling Objects With MultiSources
Multisources can be used to disable any object with a master value! If you disable a button or a door/rotating door it will sound it locked sound if you try using it. The thing wont move at all and the texture change when it's disabled. (if it can)

1) Create your door, I called it dr.
2) Create a multisource, I called it dr_ms. In the door's master value write the name of that multisource.
3) Create a button/trigger that will target the multisource.

Easy isn't it! When the multisource is off you wont be able to open the door. The only problem is that if you going to target the multisource with more then one object you'll have to activate all the objects only then it will be triggered. There are two ways to fix this:

First Way:
1) Make all the object that you want to target that multisource target a trigger_relay and make it target that multisource. You can set the trigger state if you want, off means it will only turn things off, on means it can only turn things on and toggle means it can only toggle things between on and off.

This way we created only one object that targets the multisource while all the other objects target the other object!
Posted 18 years ago2005-10-08 15:33:26 UTC Post #140358
Ok it sorta works now. I have the switch targetting the multisource and the multisource is the doors master. But it only unlocks the door half the time. And when it does unlock the door it still makes the locked sound when you open it.
You must be logged in to post a response.