Puzzles can't tell when they're solved

I have multiple puzzles that run using a bunch of evented pieces that need to be moved/rotated/etc. to the proper position, then set a variable to their position, which tells a parallel event whether the puzzle is solved through a long series of if statements. They should be working perfectly, so I must be missing something important.

For a specific example, I'll show the event pages of a sliding tile puzzle I made. This is the prototype map:

1744517703922.png


This is the first of the tiles, which each use their own set of variables:

1744517239065.png

(the rest of the page is just 6 more Ends)

The movement works perfectly, so it's just the parallel event that doesn't work. It checks the variables denoting the position of each tile in a long list of ifs, then shows a placeholder textbox just so I can see that it worked. It doesn't do anything yet like it's supposed to. I also told it to play a bell SE each time the parallel runs so I know it works, but if you recreate this, don't use the bell sound because it sounds like torture 😅

1744517634480.png


I use a very similar setup elsewhere in my game, and it doesn't work there either. Am I missing something obvious? I'm not experienced with parallel events or the engine in general. Thanks!
Hey,

Am I missing something obvious?
I believe you might.
Right now it seems you are only updating your variables before you move the event, so I would assume they always end up one step behind.

Good luck with your puzzle either way, it's looking good.
In fact, you don't need to do all the IFs one inside the other, it would be enough to just check the position of each event with the same variables one at a time and add a new variable totaling a minimum result of hits.

In this example it would be if there were only three objects to be moved:
Code:
◆Control Variables:#0017 Hits = 0
◆Control Variables:#0015 Obj_X = Map X of EV002
◆Control Variables:#0016 Obj_Y = Map Y of EV002
◆If:Obj_X = 2
  ◆If:Obj_Y = 2
    ◆Control Variables:#0017 Hits += 1
    ◆
  :End
  ◆
:End
◆Control Variables:#0015 Obj_X = Map X of EV003
◆Control Variables:#0016 Obj_Y = Map Y of EV003
◆If:Obj_X = 3
  ◆If:Obj_Y = 2
    ◆Control Variables:#0017 Hits += 1
    ◆
  :End
  ◆
:End
◆Control Variables:#0015 Obj_X = Map X of EV004
◆Control Variables:#0016 Obj_Y = Map Y of EV004
◆If:Obj_X = 3
  ◆If:Obj_Y = 2
    ◆Control Variables:#0017 Hits += 1
    ◆
  :End
  ◆
:End
◆If:Hits = 2
  ◆Text:None, Window, Bottom
  :    :Correct!
  ◆
:End

And the events that can be moved do not manipulate variables, they will only be moved by the action of the player in contact:
Code:
◆Set Movement Route:This Event (Wait)
:                  :◇Move away from Player
Right now it seems you are only updating your variables before you move the event, so I would assume they always end up one step behind.
I don't know how I didn't realize that! It's fixed now, but doesn't seem to be the issue.
Code:
◆Set Movement Route:This Event (Wait)
:                  :◇Move away from Player
That would have been a lot easier and faster than what I did, lol
Right now the movement is working fine though, so I won't change it unless it creates problems.
I'll add in the other code now and update later. Thanks!
It's still not working and I'm really confused. I know it's probably something really easy, but I'm new to rpg maker and don't have much experience at all yet, so I really appreciate everyone on the forum's help with my projects 😍
Anyway here's what I have of the parallel event:

1744643324213.png

1744643381783.png

1744643414142.png


The tiles themselves are the same except for an added pair of variable controls at the end.
I considered that maybe I was just misunderstanding how the xy plane was structured (maybe the origin wasn't top left or smth) but it seems like the xy positions are all correct.
A parallel event just keeps looping over and over, so I've heard it's best to chuck a "wait 2" in there somewhere to slow it down a bit.

When you're playtesting, you can bring up the console window (F8 or F12 or something) and use it to see what your variable 33 is at any point (type in $gameVariables.value(33) ) to try and track down if it's changing properly as tiles go into place.
A parallel event just keeps looping over and over, so I've heard it's best to chuck a "wait 2" in there somewhere to slow it down a bit.
I even tried up to 60 frames, but it didn't change anything, so it must not be that.
When you're playtesting, you can bring up the console window (F8 or F12 or something) and use it to see what your variable 33 is at any point (type in $gameVariables.value(33) ) to try and track down if it's changing properly as tiles go into place.
I set the buffer to 60 frames just to allow myself a little extra time to check the variable in the console (before it's set to zero again) and it returned zero every time, so it must not be changing the variable based on correct tiles at all.
you could simplify it if you use an array.

like you have 9 rocks, so make a 1 variable [0,0,0,0,0,0,0,0,0]
than change event var[0] = x if its correct.

you can do this for each one and alter the number on position.

another way is to use regions which is used in [this tutorial].
Backing up what Showsni said, if the result does not work, the first step I too would take would be to see whether the problem is the parallel event or one of the variables. I don't see anything inherently wrong in your screenshot, but there is always the possibility you used the wrong variable in one place for instance.

You can check if all variables have the value you expect them to through either the console (as recommended) or through the switch/variable debug menu (by pressing I believe? F9 during playtest).

Alternatively a common strategy is to print the variable values out at a convenient point in your event (By using \v[17] in a Message Text command for instance).
Edit: Or, if you are already using the console, print a message to the console using a script command:
let value = $gameVariables.value(17); console.log("Variable 17 value at this position: " + value);


If all 16 variables have the right value, but the parallel event still does not trigger, you could try to use messages or animations to check whether the event runs as expected, and if so at which point it breaks down.
Right now the movement is working fine though, so I won't change it unless it creates problems.
Your system has no use if the other event works correctly, if you want to update the coordinates for the event itself that is moved, just do this:

EV0001:
Code:
◆Set Movement Route:This Event (Wait)
:                  :◇Move away from Player
◆Control Variables:#0015 tile1 x = Map X of This Event
◆Control Variables:#0016 tile1 y = Map Y of This Event

EV002:
Code:
◆Set Movement Route:This Event (Wait)
:                  :◇Move away from Player
◆Control Variables:#0017 tile2 x = Map X of This Event
◆Control Variables:#0018 tile2 y = Map Y of This Event

EV003:
Code:
◆Set Movement Route:This Event (Wait)
:                  :◇Move away from Player
◆Control Variables:#0019 tile3 x = Map X of This Event
◆Control Variables:#0020 tile3 y = Map Y of This Event
You can check if all variables have the value you expect them to through either the console (as recommended) or through the switch/variable debug menu (by pressing I believe? F9 during playtest).
It's embarrassing that it took me so long to realize, but I must have input all of the variables wrong somehow. I made doubly sure all of the xy positions were right, but I think maybe I was assuming the top left origin point was (1,1) instead of (0,0) or something.
But through trying to fix the parallel event, I solved a bunch of other problems I hadn't noticed before, so that's good haha
Still thanks to everyone for your help! I promise your efforts were not wasted just because I was stupid and didn't realize I was counting tiles wrong ^^'

I'm still having this issue with another puzzle (but since the tiles don't move, it must be a different cause) so I'll try working that out and if I can't figure it out I'll post in this thread again.
Better open another topic if it's another type of puzzle, please consider redoing it the way I showed you, I made the whole system before demonstrating it, so much so that I copied the events directly from the editor
you could use 1 variable for X and Y per rock too, this saves also a lot of variables.
use whatever works best for you and conditionalBranch++ can shorten your nesting.
even if you use an array like.
Better open another topic if it's another type of puzzle, please consider redoing it the way I showed you, I made the whole system before demonstrating it, so much so that I copied the events directly from the editor
I swear I mean no disrespect when I don't use people's suggestions, it's just that I'm working on this for the GGG game jam and am trying to get the coding over with as soon as possible so figuring out a new system could take too long for the amount of time I have left ^^' I do greatly appreciate your help though, and I've fixed all the problems with my puzzles just today because of it!
As for the second puzzle, I did end up fixing it and it works perfectly now (turned out to be an animation issue, even though the problem presented exactly the same as the last one haha), so now I have hope of actually finishing my game in time for the deadline instead of messing around with eventing for the rest of the week. Can you tell I'm terribly inexperienced? 😊
Since English is not my first language I assume I may have sounded rude, but it is common in forums for people to be direct in their answers, if you solved it that is what matters, good luck in the Game Jam

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/puzzles-cant-tell-when-theyre-solved.176921/