MZ Change a pictures ID / or swap a pic with its neighbour

So im trying to create a puzzle where the player has to swap wires to their correct colour switch position to give power once theyre in the right position. i have my images in place and their coordinates, and i have common events and variables working so i can swap between and highlight the wires so you know which one youre on, but for the life of me i can't get the images to swap places, because if i swap one with another it stays as "pic 1" and then wont move again. (a pic of my puzzle bellow, the wires at the bottom are all individual pics )
Is there a plugin that would help me just swap an image with its neighbour, and monitor its position? or can anyone think how to event this?

Spoiler: pics
Screenshot (219).png
how about some screenshots of the event commands instead? then we can help you find out where you made the mistake.

Because the IDs are set by you when using the show picture command, and they should never be changed as long as you use that picture because the ID number identifies the picture internally.
And as such it has several functions and should not be changed - you can only delete a picture and then use the same ID again for a new picture after erasing the previous one.
how about some screenshots of the event commands instead? then we can help you find out where you made the mistake.

Because the IDs are set by you when using the show picture command, and they should never be changed as long as you use that picture because the ID number identifies the picture internally.
And as such it has several functions and should not be changed - you can only delete a picture and then use the same ID again for a new picture after erasing the previous one.
Spoiler: map event
Screenshot (222).png
Spoiler: cursor CE
Screenshot (223).png
Spoiler: Highlight CE (part of it)
Screenshot (224).png
Spoiler: the start of the pic move
Screenshot (225).png
so thats the cursor and highlighting which work fine, but i cant work out how to press ok to swap a pic with is neighbour, and then be able to move it again, as it always reads pic 2 as cursor 1 (if that makes sense)
This is actually harder to achieve then imagined with events, not impossible but you need alot of ifs and variable...
I would start to find a way to safe their positions, maybe for every picture a variable and its position, like picture 1 = variable 1 wich changes to 2 if picture 1 moves one to the left and so on...
Now you have to find a way to switch them and how to switch, only pressing ok on picture 1 so to swap it with 2 is easy but then you need to swap picture 3 but with wich one, should 3 swap with 2 or 3 with 4... hope you know what i mean...
Thats at least what i can come up with on the spot, its late and my brain is at 0 capacity. ^^
But if i find some time tomorow, i will gladly look into it... for the time i would recomend to maybe trimm it down to 3 pictures / cables, when you got the gist behind it then its easier to add a few more.
You got still the same problem to overcome, if pressing the cable in the middle to swap with wich one to swap, maybe put in a choice, swap with left or right..? could work... ^^
Thanks, yeah I spent several hours on it yesterday till it got kate and my brain fried and couldn't figure out. I have a feeling it'll either be extremely long to event, or impossible without possibly a plugin by someone a lot smarter than me. I'll give those ideas ago this afternoon though
Plugins are no gods or miracle workers. Unless the programmer designs a new screen specifically for this, not using show picture at all, it would probably be "easier" to do this by eventing.

Please note that "easier" does not mean "easy" in this case - after all it is "easier" to build a children's bike than to build a racing competition car.
OK, that is an exaggeration of a type but I wanted to get the point across that your idea is no "easy" to handle at all, and using a plugin would only mean asking someone else to make all that work, it does not mean that it would be a better solution.

Your main problem in handling that by eventing is that you make no difference between the pictures and the solution.
your first step should be to make the riddle itself with numbers - x positions that need specific numbers for a code to fit.
THEN you can assign each number a color and each lock a position on the screen, and determine how to display the numbers with differently colored pictures.

and when checking for moving pictures, you do not change the pictures directly but have the input change the numbers, and redraw the picture with the new numbers (causing the different pictures to be on different positions.

after that it will be a lot of finetuning, but that is how your base puzzle needs to work.
Your main problem in handling that by eventing is that you make no difference between the pictures and the solution.
your first step should be to make the riddle itself with numbers - x positions that need specific numbers for a code to fit.
THEN you can assign each number a color and each lock a position on the screen, and determine how to display the numbers with differently colored pictures.

and when checking for moving pictures, you do not change the pictures directly but have the input change the numbers, and redraw the picture with the new numbers (causing the different pictures to be on different positions.

after that it will be a lot of finetuning, but that is how your base puzzle needs to work.
Oohhhhh, yeah! I get what you're saying.the pictures themselves can be erased and re drawn in the correct spot, but its the numbers themselves that i need to be able to add / subtract to get in the correct order to trigger the "youve done it" I have the cursor counting from 1 - 5, so just got to work on getting them in correct order. maybe i need an invisible one like a sliding tile puzzle. That possibly makes no sense, but it sort of does in my head!
Hello, I looked through your events and it seems to me you're going to need another CE after button OK is triggered to select which way you want to move the currently selected wire.
I imagine something like this could work by checking each picture's X-Cord to determine which picture is in which position, storing it into a variable, then using said variable in a move picture script call.
So I managed to create what you intended, see if you can follow along.
But first, make sure your variables are according to your project, and second, you'll most definitely have to make a few more variables and switches.
Here we go...

1: Your Map Event is fine.

2: For your Cursor CE, I added in some SEs and events to reset the tints otherwise eventually all the pictures would get highlighted as the player scrolls along.
(maybe you had this fixed in your Highlight CE but I can't see the whole thing, sorry)
Spoiler: Cursor CE
Cursor_CE.png

3: For your Highlight CE, instead of tinting each picture by the current ep1 cursor var, I set X-Cords.
Then call a common event to check which picture ID is selected by it's currently displayed X-Cord. via script call.
After that, tint said picture via another script call.
Spoiler: Highlight CE
Highlight_CE.png


4: Next, your start move pics event, I needed to setup a transition into the event where the players selects which way they want to move the wire.
Spoiler: Transition into <- or -> selection
Transition_CE.png

5: A CE to select left or right using similar method as Highlight CE to determine which picture ID is in which selected X-Cord.
Use labels to skip when button right or left pressed/reset if not applicable.
Then move the 2 selected pictures via script call.
Finally a check to see if each picture is in their correct positions, if not, resets switches and goes back to step 2.
Spoiler: Swap images1
Image_Swap1.png
Spoiler: Swap images 2
Image_Swap2.png
Spoiler: Swap Images 3
Image_Swap3.png
Spoiler: B - Pic ID
B_ID.png

It works good for me when I tested it.
You are an absolute hero! i'll give this a blast tonight, but just reading through it eveything seems to slot into place and make perfect sense!
You are an absolute hero! i'll give this a blast tonight, but just reading through it eveything seems to slot into place and make perfect sense!
Thank you, but truly, I'm no hero. More like a people pleaser that finally learned some personal boundaries...
Anyway, looking through the code again, I think it would be a good idea if you made an Escape button trigger (in the Ok button trigger event) to take the player back to the map if they don't want to finish the puzzle.
After all, they are given a choice whether or not they want to engage in the puzzle in the first place, why not give them the option to quit as well.
I hope my advice works for you, good luck!

Original thread: https://forums.rpgmakerweb.com/threads/change-a-pictures-id-or-swap-a-pic-with-its-neighbour.145298/