Please or Register to create posts and topics.

[Question] Logical Door 'OR' type

Hello.
I have a problem, I need two buttons to activate independently a bridge of light, everything is going well until I remove one of the cubes.

I know what I need is to simulate a logic gate type 'OR' and it uses a 'Logic_compare' but not working.

Can you help?

I leave the code for. VMF

Logical Door 'OR' Type (help me)

Image

My Hard Core TPI Maps

http://www.tarados.org Mapping and Hobby's.

Portal 2 Psicodelia Test One - A map designed to make you think.

Albert Einstein dijo una vez: En el mundo hay dos cosas infinitas... EL universo y la Estupidez Humana... y del primero no estoy seguro.

For situations thike this I usually go with a math_counter. To OR two buttons, you make the buttons add 1 when pressed and subtract 1 when unpressed. Then activate the bridge when the count is 1 or more, deactivate when it hits 0.

Edit: For a more detailed explanantion check this tutorial. It describes a setup for two buttons ANDing to open a door, but the basic concepts are the same.

@Mevious: the better solution would be using two logic_branch's and using a logic_branch_listener to activate the bridge when 'OnAllTrue' and Deactivate on 'OnMixed' and 'OnAllFalse'.

This will guaranteed work

?????????????????????????????TWP Releases | My Workshop
chickenmobile wrote:
@Mevious: the better solution would be using two logic_branch's and using a logic_branch_listener to activate the bridge when 'OnAllTrue' and Deactivate on 'OnMixed' and 'OnAllFalse'.

This will guaranteed work

While that method's good too, I disagree that it's any better. You can set up a math_counter with a minimum value of 0, a maximum value of 1, and an initial value of 0. Then set the outputs so that when the counter hits the maximum value the light bridge goes on and when it hits the minimum value the light bridge goes off. When both buttons are on, the counter will have a value of 2 and the light bridge will still be on.

The math_counter method wil "guaranteed work" as well, and it uses fewer entities.

Image
Now with 100% more inline comments!

Thank you very much.

After seeing the info I created for "Math_Counter" what I needed.

I also created a sample map for those who need it.

http://forums.thinking.withportals.com/downloads.php?view=detail&df_id=1106

Image

My Hard Core TPI Maps

http://www.tarados.org Mapping and Hobby's.

Portal 2 Psicodelia Test One - A map designed to make you think.

Albert Einstein dijo una vez: En el mundo hay dos cosas infinitas... EL universo y la Estupidez Humana... y del primero no estoy seguro.