Hello everybody, i have a problem with the base plugin "Button Picture" of RPGMaker MZ
i've setup some clickable pictures and it's works perfectly, but there is a problem "when" i click multiple times on the pictures, the common event that call the plugin is repeated as many times as clicks i've done and this create various graphic problems/glitch, i've tried to use "wait" command but don't change nothing, how i can do to fix it?
Thanks and sorry for my bad english.
I think what you could do is in the common event show the same picture on the same spot with a different picture id and then erase the clickable picture. Then if you need to return the picture to be clickable again, you set a new clickable picture on the spot.
Edit: Or just change the common event tied to the picture to an empty common event?
it depends on what the common event does.
for example one solution is to setup a flag on the first click that makes all further clicks do nothing until a timer runs out and resets the flag.
but there are other solutions depending on what the button is supposed to do.
in a nutshell, i'm doing a visual/date simulator game, now we have a world map with 7-8 structures that are clickables, now if i click on home structure, an house interior will show instead of worldmap (erase the old pictures and put the new ones,etc) but if clicks multiple times on the house, the transiction effect (teleport character) also repeats too :/
Disregard. Pressed enter too soon.
EDIT: I use that plugin a lot and it is very important for my Sudoku game. Depending on what you are trying to do and how often the picture needs to be clickable will depend on what might work best.
Generally, I tend to use Switches and Conditional Branches to determine if the picture can be clicked at any given time.
If you describe exactly what you are trying to achieve, the suggestions might be more helpful to your specific case.
Thanks for the answers guys, i've find a big problem about this plugin, it ignores every conditional branches on it, i've tried to put an additional IF but don't seems to change something. :/
I would guess what is happening is that it queues the common events, and then when starting the next ones all your switches/conditions are again set in a way that it runs the code.
But was there something wrong with my suggestions in the first reply of this thread? The easier one is just to assign an empty common event to the picture with the plugin command at the start of your picture common event and then assign it back at the end.
If I understood correctly what happened is that he tried to use a switch at the beginning to make the code run only if the switch is manipulated again at the end. But since it queues the common event, the code only starts again when the previous one has already gone to the end.
Anyway, ZombieKid's pic shows a version of what I suggested at the start. You break the picture bind by erasing and replacing the old pic (well, in Zombiekid's example he doesn't first use erase command, but just straight uses the show picture command to replace the pic with the same id). You don't have to do that with a parallel event though. You can do it in your picture common event.
If you have a picture Id 1 with common event attached, doesn't it work if the common event is just:
Show picture Id 1 (at the same coordinates) // this will erase the picture bind, so you can't click it
*YOUR STUFF*
Plugin command attach common event to picture 1 // now it can be clicked again