Conditional branch for two variables.

A simple question, I looked for it but I couldn't find an answer.

Is it possible to make a conditional branch check "two" variables to then trigger an event?

I'm not talking about using one conditional branch inside another conditional branch, it doesn't give me the result that I want, it needs to be only one conditional branch.

If there's no default option for it I hope they put something like this in the future.

Thanks!
A simple question, I looked for it but I couldn't find an answer.

Is it possible to make a conditional branch check "two" variables to then trigger an event?

I'm not talking about using one conditional branch inside another conditional branch, it doesn't give me the result that I want, it needs to be only one conditional branch.

If there's no default option for it I hope they put something like this in the future.

Thanks!
Typically, you need to nest one conditional branch inside of another if you want to work with 2 variables like you describe. 

Can you be more specific as to what you're trying to do?

Based solely off of what you wrote, I'd say that you could do separate conditional branches that each turn a switch on when each variable is a certain value. Then, you can use those two switches as conditions to trigger an event. Without knowing the specifics though, this could be inefficient or even totally wrong.
You can use the conditional branch's script function to check this, actually. Just type:

Code:
$game_variables[id] == value && $game_variables[id] == value
I did what you said as well, used two switches with the variable to active another event, but still doesn't work.

And more than it, it works, only once and after it stop working.

Let me show what I'm doing:

It's like a mini puzzle where you throw a box and the box goes in the direction X until it can't move anymore.

Using this system I set some variables:

1: I set a Target X and a Target Y, 

2: I set Box position X and Box position Y.

3: When for example Box position X is equal to Target position X, change the variable Test +1. 

4: Same thing for both "Y" positions but this time for "Y" the variable changed is Test2 +1

The I made a room where I can make this box goes to the target Y or X positions as many time as I want.

Then when the box leaves the Y or X position it gonna Sub -1 from test or test2.

It was supposed to work as many times as I want, but the weird thing is that it works only once, it works once to when I get into the Y or X target position as the same as it works only once when it's not inside of the Y or X target positions anymore.

It means in the second time when the box hits X or Y target position the variable won't ADD or SUB 1 the second time it happens.

It's an advanced thing and I probably would need to make a video to explain it better.

~Cleber
When you throw a box, do you mean it should move by itself until it reach that point ? Or does it move by one case only ?


If it's by itself, use a parallel process do deal with it. If not, you should define a variable for the X displacement and one for the Y displacement.


If box x is smaller than target x, the variable for dx = +1. If box x is greater than target x, the variable for dx = -1. Same thing for Y.


Then, in the parallel process, make the box move right if dx = 1, left if dx = -1, up if dy = -1 and down if dy = 1
You can use the conditional branch's script function to check this, actually. Just type:

$game_variables[id] = value && $game_variables[id] = value
Actually it's == because it is a comparison, not an asignment.
(< > <= >= != for the other types of comparing)
No, it's not the same what I'm making.

Do you remember Goof and Max on the pirate island for SNES?

It exactly the same thing what i'm trying to do, but anyway, I gonna make a quick video showing what I'm trying to do.
Is it possible to make a conditional branch check "two" variables to then trigger an event?


I'm not talking about using one conditional branch inside another conditional branch, it doesn't give me the result that I want,
If two nested conditional branches do not give you the same, then you made a mistake in the nesting - using an AND operator for two checks is technically identical to using the checks in two nested conditional branches.


Please give us a screenshot where the nested conditional branches didn't work as you wanted, and we should be able to point you to the mistake made.


Edit: ninja'd by other answers.


It looks like you made the wrong logic sequence with page ordering, that often prevents repeating - please show screenshots of all event pages.
@AkiraKotatsuhime: You're totally right, that was a typo on my part (it's what I get for posting so early in the morning, haha).
I found the error, and I'm pretty angry with myself, I forgot to turn OFF the control self switch A and B when I'm not in their conditions anymore.

Because this the program was doing +1 and -1 in both conditions, and as you can imagine, it doesn't work.

But anyway, it was the first time I tried to do something more advanced with RPG maker I hope you can forgive me.. =(

Anyway, thank you very much to everyone who helped me here.

~Cleber
Backing again, I found another problem, or most likely a bug (I just don't know if its a bug I made or a bug in the RPG Maker).

But is better you see what gonna happen:
But is better you see what gonna happen:
I disagree - I usually refuse to watch lenghty videos to even see errors that are usually obvious with a single event page screenshot and two sentences of what should be happening.
You might not believe that, but it has been proven fact by every video I bothered to watch in the beginning. And making a screenshot is a lot faster for you compared to making a video as well.


Oh, and please remember our forum rules: new problem = new topic.


This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/conditional-branch-for-two-variables.45276/