Repeating room Puzzle help?

I am making a dungeon consisting of a series of Identical maps with an exit in each cardinal position. The goal of the dungeon
is to follow the right path of N, S, E, W. directions (such as North 3 maps, south 2 maps east 1 map.) and if you break the pattern you have to start all over again. I was using a variable, and having a series of nested conditional branches detecting what step you were on by checking the value stored in the variable, and increasing the variable by 1 if you went the right way, and setting it to 0 if you went the wrong way. yet when tested it even If I continued to follow the path the variable never went above 1 even if I followed the path exactly. The dungeon has multiple variables because there are different paths to follow to reach different End locations.
I am attaching a screenshot of the event I used
Could someone tell me what am doing wrong please?
Screenshot (13).png
1) have the calculation in the transfer events, not at a random place.
2) each transfer only counts up if it is used at the correct time, and sets to else all other times
3) count the number of maps successfully travelled, and compare that number on each transfer.
4) this will result in each exit testing for a limited number of cases, and each test goes this way:

conditional branch: maps travelled == 3
-- control variable maps travelled +=1
-- transfer player to new map/back to the correct point
-- exit event processing
if no match, the last command would be
control variable maps travelled = 0 plus transfer

do not use else-branches in that structure at all, you won't need them with that sequence.
1) have the calculation in the transfer events, not at a random place.
2) each transfer only counts up if it is used at the correct time, and sets to else all other times
3) count the number of maps successfully travelled, and compare that number on each transfer.
4) this will result in each exit testing for a limited number of cases, and each test goes this way:

conditional branch: maps travelled == 3
-- control variable maps travelled +=1
-- transfer player to new map/back to the correct point
-- exit event processing
if no match, the last command would be
control variable maps travelled = 0 plus transfer

do not use else-branches in that structure at all, you won't need them with that sequence.

Thanks, this helps. What do you mean by not using else branches? Do I just test for each value separately? And if so, how do I make it so that it only sets the value to 0 if none of the proper values are detected?
yes, and disable the else-branch completely.
the transfer/exit event processing will abort the event, that way the last command with the set to zero can only happen if none of the conditional branches is executed
I made the changes and the labyrinth still didn't function. I followed one of the paths perfectly and I didn't end up in the right location. the variables didn't progress past 1.
Screenshot (14).png
that is not what I was writing about.
I asked you to place them into the transfer events leading to the next maps, and only where the correct exit is.
Which means that no single event ever will check for every number.

for example if the correct path would be N, N, W, E, N then the north exit would check for room =1, =2 and =5 but not for 3 and 4 because those would be on the west and east transfer events.
I did that, Since there are multiple maps and each exit is 3 tiles wide I created the transfer event in a common event so that I only had to edit the common event instead of editing each event individually.
Because editing and replacing 3 events for each map across twelve maps is Time consuming where using a common event allows me to edit the one event and for that update to be applied to every transfer event simultaneously. I have four common events one for each cardinal direction.
then why are you checking every number from zero up in that common event?
and please give a screenshot of one of those exit events to see how they're done.

additional things to check:
where did you start the sequence? somewhere you have to set the variable to zero for the first check to start, and if you did that wrong (setting it to zero again and again and again) then it will look as if this event is wrong.

and how do you check if the variable doesn't go up? it might be a display problem instead of wrong numbers

you might also make a test with a shorter route and a show text in the common event for displaying the current value of the variable

Original thread: https://forums.rpgmakerweb.com/threads/repeating-room-puzzle-help.122564/