New Logic Question - persistent variables?

I asked a question about implementing logic in this thread but it wasn’t a very good question and didn’t represent my problem at all.

I might of had a few beers before hand… sorry. But the advice is good so I’ll leave it be for searching and start a new thread.

This is what I need to represent:

// Hi, I put it in a code tag this time :P

if ($a == true && $b == false) $c = false;
if ($a == true && $b == true) $c = false;
if ($a == false && $b == true) $c = true;
if ($a == false && $b == false) $c = false;

Now, here is my issue. This is pretty simple, except for the fact that there is no persistence of variable data it seems.

Only $a or $b will be triggering the chain of events, so once that chain starts, it doesn’t seem possible to get the value of the other variable. If $a triggered the chain, then how do I know if $b is false?

Thanks for your help

It’d help greatly to know what you’re trying to accomplish. The method could change drastically depending on what $a and $b are in the map.

I will try to make something like this, but just want to be sure what you mean with it, like:
If A is true B is false, then C will be disabled/False right?

Right, I got it…

Green X changes the state of A to true/false (With some sprites to show it)
Blue X changes the state of B to true/false (With some sprites to show it)
Black X makes a test.
Red O will show if C is false
Green O will show if C is true

Download here:

Also, A and B can be anything you want. From a button, a doors open/close state or if the player is standing in a trigger or not.
Same with C. you can make any output you want from it via the logic_case.

Just change the output of the logic_relays (Not shown in the picture) to whatever you want to happen.

$a and $b and $c are doors.

false == close
true == open


thanks for the input. I will take a look at this tonight when I get home.