Making a "run potion"?

I want to disable dash on all of my maps. Then create a potion that calls a common event to force dash for a specified amount of time. I can't find any way to accomplish this.. Thanks in advance!
  1. Disable Dash on all maps (it's under Map Properties - right click on the name of a map in the editor)
  2. Create an Item that runs a Common Event (trigger - None). Have that common event change the player's speed to one higher than it's supposed to be (you can most easily do this using the Move Route event command). Then, have that common event set a Variable to X (where X is the number of seconds you want to force dashing for) and also turn ON a Switch.
  3. Create a second Common Event (trigger - Parallel Process) that requires the Switch that you just set in order to run. The event should use the following event commands: Wait: 60 frames, Control Variables: reduce the number of seconds variable by 1, Conditional Branch: number of seconds variable is <= 0. Inside the Conditional Branch, set the player's speed back to normal (again, use Move Route to do so) and then turn the Switch that was required to run this event OFF.
You could also use the play time and a variable rather than counting down the seconds, to cater for a different fps.
You could also use the play time and a variable rather than counting down the seconds, to cater for a different fps.

Ah, yes, this would be an even better solution since it automatically compensates for changes that were made to the Graphics.frame_rate property (though it won't compensate for FPS lag, etc.).

@Shaz - just wondering if you know whether there's any way for the user to set Graphics.frame_rate, in standard RPG Maker behavior? Or is it something that can only be changed by the game designer via scripting? If it can be changed by the user, I've made a horrible error in all of my minigame eventing. 😩
I don't believe it can be changed by the user. In previous versions, you could simply do a single command to change the frame rate. But I remember someone saying it's not that easy in MV, that there isn't a number somewhere that represents the frame rate, and it's hidden more deeply in the code.

Just having a quick look through, 60 appears to be hardcoded in a number of different places, so if you wanted to change it, there'd be quite a few places you'd need to do it.
That's a big relief to know; thank you so much, Shaz! 🙂

@anonamix Were you able to create the Speed Potion effect?
@Wavelength I was able to create the potion allowing me to run faster. But I am not exactly sure how/where to add the variable/switch. And setting the variable to x. Thanks!
Here's what your Common Events will look like, approximately, using my approach:

((Common Event 1: Trigger - None))
Move Route: Player - Change Speed: 5
Control Variables: Set Variable #3 to "90"
Control Switches: Set Switch #7 to ON

((Common Event 2: Trigger - Parallel Process; Condition Switch - Switch #7))
Wait: 60 Frames
Control Variables: Subtract 1 from Variable #3
Conditional Branch: Condition 'Variable #3 is less than or equal to 0'
Move Route: Player - Change Speed: 4
Control Switches: Set Switch #7 to OFF
End Conditional Branch

((Item "Run Potion": includes a Feature in the Features Box that runs Common Event 1))

Shaz's approach is slightly better because it allows the Dash Time to be agnostic to frame rate (whereas if you wanted to cap your game to 30FPS, my solution would give the player twice the amount of intended Dash Time - e.g. 180 seconds instead of 90), but it requires a bit of extra math that might be confusing when trying to get a grasp of what the event loops should look like.

Original thread: https://forums.rpgmakerweb.com/threads/making-a-run-potion.78014/