How to make my puzzle work? (Rotating blocks)

So I've made a little puzzle that requires the player to rotate blocks to complete the picture - upon completion a passage will be open in the wall.
Here's how it looks (just the first row but I hope you get the idea).



Not using any plugins for this, only cutsom map and events with character graphics as blocks.

Now the problem I've encountered: I need an event to be played upon completion of the puzzle. I haven't found a way to make it work. The puzzle is complete when every event is facing down, so I tried using conditional branches + variables but it doesnt seem to do the thing I need.

Thank you in advance 😍
Can you just do a nested conditional branch in a parallel process like:

If [EV001] is facing [Down]
If [EV002] is facing [Down]
If [EV003] is facing [Down]
....
If [EV00n] is facing [Down]
--> switch ON, or your 'puzzle complete' event sequence, then erase event? I can't test this now but I think that should be possible.
Can you just do a nested conditional branch in a parallel process like:

If [EV001] is facing [Down]
If [EV002] is facing [Down]
If [EV003] is facing [Down]
....
If [EV00n] is facing [Down]
--> switch ON, or your 'puzzle complete' event sequence, then erase event? I can't test this now but I think that should be possible.
That's gonna be a helluvalot conditional branches :'D but I'll try it out now, thank you!

UPD: it works perfectly, big thank you 😍
there are 3 other ways to make it WAY shorter than nested.

methode 1:
use conditionalBranch+ to shorten it (you can make the checks in 1 line)

methode 2:
Variables (1 variable per block), than use scriptcall

(can be done without variables, but it works slightly different, but the same way)

for (i = 2; i < 12; i++) {
code here
}

I need to find the code that I have for the switches, but the entry check
can be either variable = ALL 4, if using 1, 2, 3, 4 per turn, or a way
to see if the images are facing [down], but that is something I need to
dig for, but with that scriptcall, it's way easier to control nested conditionals.
I can also think of a Workaround.

Everytime you Rotated a Block, that Block will execute one Time the following if statements.

Var2 set to direction of this event (this variable can be reused for every event, it just stores temporary data)
...I believe a Picture is easier:
gherguierhui45454.png
Hi there!

You can make that check a lot easier using javascript(script on conditional branch).
Replace the numbers inside the brackets with the ids of all events you are using into the puzzle. Separating each one with a comma.
[2, 3, 4, 7, 8, 13].every(id => $gameMap.event(id).direction() === 2))

every method for reference.
From my understanding, the easiest way is to create a event with a check for the variable you are using.

Let's say that you have 8 blocks. For each block facing down, you have +1 puzzleFaceDown variable.

In the door you want to open, the puzzleFaceDown must be 8 or more for it to be opened.
From my understanding, the easiest way is to create a event with a check for the variable you are using.

Let's say that you have 8 blocks. For each block facing down, you have +1 puzzleFaceDown variable.

In the door you want to open, the puzzleFaceDown must be 8 or more for it to be opened.
Well, I tried it before but here's a thing, it will add 1 EACH time the block is facing down. So, instead of actually solving the puzzle you could rotate one block 8 times and the door will still be opened. That's unfair, duh :'D

I didn't try other methodsin this thread yet, falken14's method seems to work so far, maybe I'll test other methods later just for future users to check out
here's a thing, it will add 1 EACH time the block is facing down. So, instead of actually solving the puzzle you could rotate one block 8 times and the door will still be opened.
That is taken care of in my example.
I could have even not used the variable for direction and directly ask the needed direction for this event.
Common Event. It goes through all of the events, and if they are all facing the right way, it sets itself to true. Run this common event every time a block is rotated.

The "win" event is triggered by the completion switch being True. It then autoruns your "You win" message, then turns its self-switch. Last page triggers on self switch and does nothing.

This requires using only a single switch.
Well, I tried it before but here's a thing, it will add 1 EACH time the block is facing down. So, instead of actually solving the puzzle you could rotate one block 8 times and the door will still be opened. That's unfair, duh :'D

I didn't try other methodsin this thread yet, falken14's method seems to work so far, maybe I'll test other methods later just for future users to check out

It depends on how you implement the "programming logic" in the said event.

You need to check "if it's facing down == Add +1" and "if not facing down == Sub -1" to said variable. For this, you can use Self Switches and such to do so.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-my-puzzle-work-rotating-blocks.144282/