Animations speeding up when simulating input instead of clicking

(See bottom for update - it gets weirder!)

When a player clicks a rock event in my game, it plays a mining animation using a movement route. If the player clicks the rock repeatedly, it will trigger this movement route again each time the event is activated with no problems.

Where I am getting into trouble is when I add anything to the event which checks to see if the player has either OK or touchInput pressed, and if so, either restarts the event with a script call, or waits a few frames after the event ends and triggers a virtual OK input (to trigger the rock again).

This all works just fine mechanically, as it will re-trigger the event if the input was held, but the confusing issue is that, when the virtual input triggers the rock event again, the animation plays much faster. Clicking the event repeatedly plays the animation at a normal speed, and holding the mouse click down or OK key down, which retriggers the event, speeds the animation up super fast. This means that clicking the rock repeatedly mines it at the intended animation speed (about 10 frames between the animation frames), and holding the OK button down to re-trigger it spams through the animation with nearly no wait between the frames, and breaks the rock significantly faster.

Here are my events:
Spoiler: EVENTS
This is the rock. it just plays an animation, then enables the switch that runs the "repeat check" parallel event
rock.PNG


This is the parallel event which the above triggers. This checks to see if the mouse or OK key are pressed, and if so, triggers an event which waits a few frames and then simulates another OK input.
retrigger.PNG


And this is the final event, triggered by the above. It just waits and then triggers OK
press OK.PNG

At first, I was using a simpler process (checking if the input is pressed, and if so, using the $gameMap.event(this.eventId()).start() script to just re-trigger the event, but after having these issues, I assumed maybe it was a problem with starting the event this way, so switched to the above so that I would literally be waiting and then triggering an OK press again, just like if the player were actually clicking the event repeatedly. Even despite this, the animation still plays at different speeds when actually clicking repeatedly vs holding the click and triggering the above events.

UPDATE:
I did a bunch more testing and realized that this is actually somehow being caused by the act of holding down the OK input or the left mouse input. I made a test project which just runs the above move route and restarts the event endlessly (no condition check, it just always restarts after it ends), and when running that event, clicking once will make the animation repeat at the normal speed, but holding the OK or left mouse input will instantly speed up the looping animations. It is very bizarre.

I've made a test project if anyone wants to see if they can figure it out: DOWNLOAD

In that project, if you click on the rock, you will start mining it on a loop. If you hold down the left mouse button or Z ("ok"), the animation will speed up while the key is held. As soon as you stop holding the key, the animation returns to its normal speed.

This is with no plugins active except a basic zoom plugin, and an extremely stripped down event. RPG Maker seems to be doing something very weird while the OK or left mouse are held, and I have no clue what.
Why does it have to be so complex? If you want to interact with the rock again you can remove the wait check box of the route. Or split the route into two parts if you want the player to wait some time.
Why does it have to be so complex? If you want to interact with the rock again you can remove the wait check box of the route. Or split the route into two parts if you want the player to wait some time.

I don't really understand what you mean. Wait for move route is enabled so that it fully plays the animation before moving on to the next process. Changing this doesn't really have any effect on how it all plays out, since it is waiting anyways, so it may as well be enabled.

There are no issues in terms of interacting with the rock again. The problem is that when a repeat interaction is triggered based on a condition, the animation plays at a much faster speed.
Oh, I don't know if I understand you correctly.
So to make it simple, you want the player to play a mining animation when you click or press OK on the event.
During the animation, the user may click/press OK again, so the animation will restart after it completes?
Oh, I don't know if I understand you correctly.
So to make it simple, you want the player to play a mining animation when you click or press OK on the event.
During the animation, the user may click/press OK again, so the animation will restart after it completes?

Close - the idea is that the event will check at the end of its process (or an external event will check) to see if the OK button or left mouse are currently pressed down. If so, it will re-trigger the event (either using a start script, or repeating an OK input).

This has the effect of allowing the player to just hold down the OK button or left mouse to repeatedly swing their pickaxe at the rock, rather than repeatedly clicking (similar to Stardew Valley, Minecraft etc.).

The problem is that, when the event was being triggered this way, it would run through the event's animation again very fast, as if it were skipping all of the wait commands.

I did a bunch more testing and realized that this is actually somehow being caused by the act of holding down the OK input or the left mouse input. I made a test project which just runs the above move route and restarts the event endlessly (no condition check, it just always restarts after it ends), and when running that event, clicking once will make the animation repeat at the normal speed, but holding the OK or left mouse input will instantly speed up the looping animations. It is very bizarre.

I've made a test project if anyone wants to see if they can figure it out: DOWNLOAD

In that project, if you click on the rock, you will start mining it on a loop. If you hold down the left mouse button or Z ("ok"), the animation will speed up while the key is held. As soon as you stop holding the key, the animation returns to its normal speed.

This is with no plugins active except a basic zoom plugin, and an extremely stripped down event. RPG Maker seems to be doing something very weird while the OK or left mouse are held, and I have no clue what.
I recall I replied you in another topic about a parallel event page.
Maybe you can have a check their to active a self switch when OK is pressed down, but deactive the swtich if not.
So in that mining event page make a loop, if the self switch is not on, break loop.
This is a part of the corescript for MZ:

JavaScript:
Scene_Map.prototype.isFastForward = function() {
    return (
        $gameMap.isEventRunning() &&
        !SceneManager.isSceneChanging() &&
        (Input.isLongPressed("ok") || TouchInput.isLongPressed())
    );
};

You could tie that function to a switch so that you can allow the player to fast forward during other scenes and disable to switch to stop the fast forward during the mining.

Edit: so something like this - tie it to game switch 1. When you turn switch 1 ON, you can fast forward. When you turn it OFF, it will prevent fast forwarding with the ok button or left mouse press:

JavaScript:
Scene_Map.prototype.isFastForward = function() {
    return (
        $gameSwitches.value(1) && 
        $gameMap.isEventRunning() && !SceneManager.isSceneChanging() &&
        (Input.isLongPressed("ok") || TouchInput.isLongPressed())
    );
};
holding the OK or left mouse input will instantly speed up the looping animations. It is very bizarre.
This is a part of the corescript for MZ:

JavaScript:
Scene_Map.prototype.isFastForward = function() {
    return (
        $gameMap.isEventRunning() &&
        !SceneManager.isSceneChanging() &&
        (Input.isLongPressed("ok") || TouchInput.isLongPressed())
    );
};

You could tie that function to a switch so that you can allow the player to fast forward during other scenes and disable to switch to stop the fast forward during the mining.

Edit: so something like this - tie it to game switch 1. When you turn switch 1 ON, you can fast forward. When you turn it OFF, it will prevent fast forwarding with the ok button or left mouse press:

JavaScript:
Scene_Map.prototype.isFastForward = function() {
    return (
        $gameSwitches.value(1) &&
        $gameMap.isEventRunning() && !SceneManager.isSceneChanging() &&
        (Input.isLongPressed("ok") || TouchInput.isLongPressed())
    );
};

Thank you so much! That fixed it.

I had no idea that this was even a thing, haha.

Original thread: https://forums.rpgmakerweb.com/threads/animations-speeding-up-when-simulating-input-instead-of-clicking.176161/