# Logic confusion

Discussion in 'Mapping Questions & Discussion' started by VegetableFace, Sep 4, 2011.

1. ### VegetableFaceL1: Registered

Messages:
8
Positive Ratings:
0
Heyo. I'm looking to set up a simple logic system with trigger_multiples, so that when both of the seperate triggers are touched (regardless of order and time between each trigger), they'll activate a func_door. I'm pretty clueless when it comes to the various logic entities, but I'm guessing that's where I wanna go. I hear you guys are pretty handy, and I would appreciate it if someone would kindly enlighten my dumb ass.

2. ### Da_ManL4: Comfortable Member

Messages:
173
Positive Ratings:
39
Just create the system with one trigger_multiple, then copy-paste the trigger system. Voila, a door that opens with two separate triggers.

3. ### VegetableFaceL1: Registered

Messages:
8
Positive Ratings:
0
Unfortunately, that wouldn't work with what I have in mind.

It's like this; I have a large cave with platforms suspended from the ceiling, with lava at the bottom. There is a teleport in each team's spawn which takes people to this cave. So the func_door in this case is the lava, which I want to slowly rise when people are dueling in there. Problem is, I don't want the lava to rise before there is one red and one blu in there. So I want to set it up so that something checks so that each teleport has been triggered before it triggers the lava to move.

4. ### English MobsterL6: Sharp Member

Messages:
355
Positive Ratings:
297
Okay, so you can use logic_branch and logic_branch_listener for this.
Create 2 logic_branches: teleport_red_branch and teleport_blu_branch.
Keep the initial values for both of them at 0.
Create a logic_branch_listener and name it teleport_listener.
For logic_branch 01, point at teleport_red_branch. For logic_branch 02, point at teleport_blu_branch.

On the trigger_multiple (or whatever it is you have that causes your teleport to take place, I'm assuming it's trigger_multiple because you mentioned it) that causes your RED teleport, add this output:
My Output Named: OnStartTouchAll
Targets Entities Named: teleport_red_branch
Via this input: SetValue
With a parameter override of: 1
You can optionally check "Fire once only", if you'd like. It doesn't really matter.

Do the same for your BLU teleport, only replace any reference to RED with BLU.

My Output Named: OnAllTrue
Via this input: *Whatever makes your lava go up*

Now, once both teams have taken the teleport, both of your logic_branches will be set to "True" (1), and the game will know it's time to make the lava rise.
Hope this helped!

• Thanks x 1
5. ### VegetableFaceL1: Registered

Messages:
8
Positive Ratings:
0
Da, dis will work. Thank you so much! Very clear, very to the point and very helpful. Hell, this even helped me figure out another problem I was having

Thank'd, and also platonically Love'd.