Slide Puzzle - Can't get it to work

Hello there,

so I've tried for some hours to make a slide puzzle much like they exist for the clue scrolls in old school runescape.

What I've tried:

I used a 5x5 area full of events. Their priority was "same as characters". The area was surrounded by walls. In the lower right corner there was no event. Outside of the area there are 4 arrows which the player can activate. An arrow would tell the events on the 5x5 area to move to the right and to skip the movement if it's not possible. So in theory the empty spot would get filled by the one event that can move there and the rest does nothing. This worked in about 50% of the cases. The problem is that whenever the movement input for the events was so that it first processes the event that is supposed to move and THEN processes an event that is not supposed to move, but is now able to move because the event that is supposed to move left it's spot so it can follow. The result was that the whole row moved. I tried ot think of a different solution but it didn't work. I hope my explanation of the problem makes sense.

The game does not have to check if what the player did is correct. The idea is that if the player manages to put together the image correctly, the image will show an important hint for a different puzzle. I can imagine that there are ways to make this puzzle work that are extremely complex. I wouldn't even mind that as long as it works.

Does anybody have an idea how to make it work?
Can you post a screen shot of your event? I'd like to take a look at what you've done.
Rd2Qy53

Rd2Qy53.png


This would be for the left arrow. All 24 events in the 5x5 square try to move left and skip if they can't. The one and only event that can actually move left does move left, but if it is processed before the events on the right side to it, they follow because the spots free up sequentially. So the whole row moves.

To give more of an idea what it looks like:
eCMzRZz.png
As far as I can tell by reading your description, you might need to stop event processing.
Suppose event1 moves to the left. You already put a command for it to move. But doing so the spot next to it becomes blank. So event2 moves too. Entire row moves. I think you should figure out a way to break event processing after each movement command, so that no new events move after the one that's supposed to. I'm no expert but I guess that should work :/
As far as I can tell by reading your description, you might need to stop event processing.
Suppose event1 moves to the left. You already put a command for it to move. But doing so the spot next to it becomes blank. So event2 moves too. Entire row moves. I think you should figure out a way to break event processing after each movement command, so that no new events move after the one that's supposed to. I'm no expert but I guess that should work :/

I tried to do this by having a switch activate after the movement (that lead to a blank page which turned the switch off a frame later) but it didn't work unfortunately. That got everything stuck and I dont know how to stop event processing /only/ if the movement was successful.
Have you tried using exit event processing?

Edit: I don't think that will work. :/ it's recommended that one uses exit event processing inside conditional branches. Since checking for any change in the event's location will be a tough job, I suppose that wont work...
It may end up a bit clunky, but some conditional branches could likely solve this. If Event 1 moves, then nothing, else event 2 moves, if event 2 moves then nothing, else event 3 moves.

If you cannot get it resolved, I can try it out when I get home in a few hours and see if I can find you a not so messy solution.
I did a sliding puzzle tutorial a while ago, but with pictures instead of events. There are probably cleaner ways to do it, and you will need to adapt the commands to move events, but it might help you with the structure if you want to try the conditional branches method like @RetroExcellent suggested.

Link to How to make a sliding puzzle
@megumi014 Thank you a lot for the tutorial! It was a crapton of work, but now our 4x4 slide puzzle is working!

NawnuN4.png


We altered the eventing a bit though because we found "loop" to make the game super lag and not to be necessary. Just running a parallel process. I'm also still pretty sure that there is a way to make it work that is a lot less complicated, I just don't know how. I'm thinking that because I was so damn close by just using event for each tile... I'm still happy though we got it working.

Original thread: https://forums.rpgmakerweb.com/threads/slide-puzzle-cant-get-it-to-work.103139/