How to prevent continuous clicking a button that calls a comment event?

Hi, everyone:

In my current project, I have set up an action point (AP) system and a time slice (TS) system.
The day is separated into Morning, afternoon, evening, and night.
Upon clicking the blue arrow, the player would be taken to the next time slice (TS).

Here is the problem, I noticed that when I click on the button continuously, say 5 times, and action would be performed 5 times.

Is there any way I could add a pause somewhere to prevent players from clicking on the button continuously by mistake?

In the current project, the player would be transferred to the ending cutscene map. However, if the player clicked on the button several times before the transfer, the script would still taken effect upon arriving on the final map, which could cause problems.

Here are the screenshots of my setup.

Thank you.
you can use an conditional branch inside the common event to prevent it from working on every click.
as the condition you can then use whatever you want to prevent multiple effects, for example a check for time (only one click per second) or a check for story flow (no multiple checks in cutscenes) or whatever.

the condition can be made as simple or as complex as you want, but of course a more complex condition is more work.
you can use an conditional branch inside the common event to prevent it from working on every click.
as the condition you can then use whatever you want to prevent multiple effects, for example a check for time (only one click per second) or a check for story flow (no multiple checks in cutscenes) or whatever.

the condition can be made as simple or as complex as you want, but of course a more complex condition is more work.
How do you check for time?
several ways depending on whether you have a time system in your game or not.
the simplest way is to have a different common event permanently running that counts up a variable and then use a second variable to store the last time the click was triggered and compare the difference.

check for one of the tutorials to event a time system for more details
While I understand the concept, I am having a hard time putting it into code.
Thanks anyways. 🙂
Is there any way I could add a pause somewhere to prevent players from clicking on the button continuously by mistake?
Just curious, is this actually a concern? I don't know about you, but I have played many computer games over the past 30 years that involve clicking things with a mouse...I might have accidentally double-clicked something a couple of times, total.

I wouldn't consider this worth any extra effort to try to prevent 😉

Just like all of those menus that ask "Are you sure you want to trash this item?" "Are you sure you want to quit?" Yes, I did not randomly click an element of the UI.
Just curious, is this actually a concern? I don't know about you, but I have played many computer games over the past 30 years that involve clicking things with a mouse...I might have accidentally double-clicked something a couple of times, total.

I wouldn't consider this worth any extra effort to try to prevent 😉

Just like all of those menus that ask "Are you sure you want to trash this item?" "Are you sure you want to quit?" Yes, I did not randomly click an element of the UI.

Thanks for your response.
Yeah, I'm still pretty new to RM, so that was my work-around.

The issue is that by clicking on the arrow, the time will jump to the next time slice.

So if I click the button 5 times in a row like a madman, the comment event will run FIVE TIMES, and since the script will also change the screen tint, the end result is not pretty. Haha.

My final work-around involves creating a choice window asking players whether they want to advance the time or not. During this window, players cannot continue to click on the arrow. Thank goodness!

It's not an elegant solution, but it's one solution nonetheless. 🙂
My final work-around involves creating a choice window asking players whether they want to advance the time or not. During this window, players cannot continue to click on the arrow.
...that was not the point I was trying to make with my post...
🤣 :LZYugh:

I point out a thing I hate in UI design, and he proceeds to add it in. I don't think this is my fault.
Yeah, I hate it when the system asks for confirmation too frequently.
On the other hand, I've rarely used the "advance time" function when I play similar games, so I think this warrants a confirmation, as by advancing the game, the player loses an opportunity to act, which can be quite impactful in a game with a deadline.

Appreciate your opinion. 😎

...that was not the point I was trying to make with my post...
🤣 :LZYugh:

I point out a thing I hate in UI design, and he proceeds to add it in. I don't think this is my fault.
This would mean that if I click cps test the button five times, the script will run five times, changing the screen tint and making things even worse. I am having a difficult time implementing the concept in code.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-prevent-continuous-clicking-a-button-that-calls-a-comment-event.140615/