Original Source
- Original title: Animations speeding up when simulating input instead of clicking
- Original author: chris-cote
- Original date: March 11, 2025
- Source thread: https://forums.rpgmakerweb.com/threads/animations-speeding-up-when-simulating-input-instead-of-clicking.176161/
- Source forum path: Game Development Engines > RPG Maker MZ Support
Summary
(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...
Archived First Post
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:
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.
And this is the final event, triggered by the above. It just waits and then triggers OK
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.
Downloads / Referenced Files
Log in, then follow the RPG Maker Developers Group to see these download links.
Log in to downloadCreator Claims / Removal
If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.
Replies (0)
No replies yet.
Topic Summary
Loading summary...