Too short for a thread, too long for the ShoutBOX.
I have three doors. (Actually I have five, but I'm not going to make this more complicated than you need to know. So three doors.) All of them are Use-Only and Toggled. Two of them should be openable and closable at will. We'll call these doors A and B. The other, door C, can only be opened if and only if door A is open and door B is closed. If door C is open, doors A and B can't be moved (I.E. door A cannot be closed and door B cannot be opened). When door C is closed, A and B should be freely moveable again.
What setup of multisources and (if required) trigger_relays is needed to make this work? If it makes things simpler, one of door A or B could be set to Starts Open to make the conditions the same for both.
This could be simple or complicated; I'm not good at wrapping my head around these kinds of setups either way.
I'm sure there is some way of replicating gates, I've just never gotten round to figuring out if there is.
Perhaps the doors will set themselves as +1 on the counter whenever they're closed, and +0 when open? So that means that you can have the door be unlocked or enabled whenever the counter is set to +2.
The door positions(A open, B closed) would activate trigger multiples, which could open thin, invisible forcefields walls in front of door C? You could use func_doors, func_wall_toggles, etc.
If this was for Source, it'd be VERY easy to accomplish what you need with the input/output system, but again, I'm not sure exatly how offhand
Multisource acts as an AND gate, but I don't know if a door evaluates to 1 when open and 0 when closed. If it does, you might be able to toggle a hidden toggle button to invert the value of door B, and then use a multisource as the master of door C. You could set door C to toggle the enabled status of doors A and B, which would disable them when C opens and re-enable them when it closes. As CapT said, if you can't toggle enabled/disabled status, you might be able to use a clip brush instead.
In Source it would be super easy
Looked at the entity guides myself, l think I've got how do it. Will let y'all know.
Hosted By Jessie
1) trigger: activates the target when opened or closed
2) fire on close: activates the target when closed only
So you can probably use the target field to trigger an event, but use the 'fire on close' field to reset a trigger relay to a wanted state.
Door A: Trigger: Trigger Relay > ON > Door_C_Multisource
Door A: Fire on Close: Trigger Relay > OFF > Door_C_Multisource
Door B: Trigger: Trigger Relay > OFF > Door_C_Multisource
Door B: Fire on Close: Trigger Relay > ON > Door_C_Multisource
Door C: Trigger: Trigger Relay > OFF > Multimanager > Doors A+B multisource
Door C: Fire on Close: Trigger Relay > ON > Multimanager > Doors A+B Multisource
So by my best guess without actually trying it, here's what's going on:
Door A, when opened, is enabling 1/2 of door c's multisource.
Door A, when closed, is disabling door c's multisource.
Door B, when opened, is disabling door c's multisource.
Door B, when closed, is enabling the other half of door c's multisource
You'll need a trigger_auto in there to set your initial values. For example: doors A and B both have masters which you would need to enable by default.. there's probably more but i can't test ATM.
Once door C opens, it targets a multimanager that will fire 'off' state relays to disable door a and door b masters.
Once door C closes, it does the opposite.
Seeing as how the 'target' field fires in both open and close states, fire that first (delay of 0). I would put a 0.5s delay onto the "Fire on close" field so that will override any triggering done by the target field.
Let me know if it works
Is there any "NOT" gate in GoldSource? Because if yes, you could build a NAND. And NAND gates are a basis for everything.
It seems multisource is reading active states from the things that trigger it. Instead of activating or deactivating itself. (if that makes sense)
So if you have two trigger_relays targeting a multisource, one with an ON state and one with an OFF state, it will never fire because the relay with the OFF state will always negate the multisource.
The plot thickens....
EDIT!
I figured it out. It's actually much simpler.
I'll upload an example map and a write-up on the logic
All in all, i'm using a trigger_relay inbetween the door and the master that acts like a not.
So when the map loads, it triggers the 'inverter' relay to be normally 1.
When you open a door, it toggles that relay so it's now in a zero state.
So door A triggers door c's master normally, but there's an inverter relay between door b and door c's master.
SOLUTION
Since func_doors WILL NOT activate trigger_multiple, func_button, NOR func_breakables for my backward solution, I'm gonna try using Stojke's method of employing env_beam and a shootable button to detect the position of the doors.
So much fun.. =P
PB is right in his speculation. Func_doors evaluate to a 1 when open and a 0 when closed. At least when they're triggering multisources.
All we needed was a way to invert the door values. Put a trigger relay in the way that's initialized to 1 and BAM. 1 becomes 0