MV Can I force the player to Dash at a specific point?

I made a dodge the falling blocks mini game section for my game, but the player can only move if they're actively dashing and I'm not sure what exactly I can do to fix that. Is there any kind of script call I can use or something to force the player to dash during this section so it's completable? I know most people tend to just put auto-dash on, but I still want to make sure it won't be an issues for players that don't.
Hi there!
I'm not sure if I understand you correctly. But you can enable/disable the always dash feature with script calls:

ConfigManager.alwaysDash = true
ConfigManager.alwaysDash = false

This way, you don't rely on the player tpo manually set the auto dash on via options menu, you can set it to true at the start of the minigame. And set it to off at the end.
There isn't a script call that toggles dash on and off – dash is something where the game checks on each move if you're dashing.

You could use a plugin like this to allow forcing dash on/off with a switch:

JavaScript:
Game_Player.prototype.isDashing = function() {
    if($gameSwitches.value(1)) return true;
    if($gameSwitches.value(2)) return false;
    return this._dashing;
};

If you add the above code as a plugin, then you can toggle switch 1 on to force always dashing, or you can toggle switch 2 on to prevent dashing (similar to the map option). The plugin should go towards the top of your plugin list. You can replace 1 and 2 with whatever switches you want. You can also delete the 2 line entirely if you don't need that feature anywhere. Note that this will even override the setting on a map that has dashing disabled.

Hi there!
I'm not sure if I understand you correctly. But you can enable/disable the always dash feature with script calls:

ConfigManager.alwaysDash = true
ConfigManager.alwaysDash = false

This way, you don't rely on the player tpo manually set the auto dash on via options menu, you can set it to true at the start of the minigame. And set it to off at the end.
I wouldn't recommend this, as you're messing with the player's preferences against their will. If you do prefer this approach, you should use this script call to force dash on:

JavaScript:
$gameSwitches.setValue(46, ConfigManager.alwaysDash)
ConfigManager.alwaysDash = true;

And this script call to reverse it:

JavaScript:
ConfigManager.alwaysDash = $gameSwitches.value(46)

This way, the user's preference will be preserved. Replace 46 in both cases with the ID of an unused switch. That said, I do think the other way is better; even with this precaution, it's likely there are some edge cases where the user's preference won't be preserved.
There isn't a script call that toggles dash on and off – dash is something where the game checks on each move if you're dashing.

You could use a plugin like this to allow forcing dash on/off with a switch:

JavaScript:
Game_Player.prototype.isDashing = function() {
    if($gameSwitches.value(1)) return true;
    if($gameSwitches.value(2)) return false;
    return this._dashing;
};

If you add the above code as a plugin, then you can toggle switch 1 on to force always dashing, or you can toggle switch 2 on to prevent dashing (similar to the map option). The plugin should go towards the top of your plugin list. You can replace 1 and 2 with whatever switches you want. You can also delete the 2 line entirely if you don't need that feature anywhere. Note that this will even override the setting on a map that has dashing disabled.


I wouldn't recommend this, as you're messing with the player's preferences against their will. If you do prefer this approach, you should use this script call to force dash on:

JavaScript:
$gameSwitches.setValue(46, ConfigManager.alwaysDash)
ConfigManager.alwaysDash = true;

And this script call to reverse it:

JavaScript:
ConfigManager.alwaysDash = $gameSwitches.value(46)

This way, the user's preference will be preserved. Replace 46 in both cases with the ID of an unused switch. That said, I do think the other way is better; even with this precaution, it's likely there are some edge cases where the user's preference won't be preserved.
Thank you so much! This did exactly what I needed it to. For the script call to reverse it, do I still include the $gameSwitches.setValue(46, ConfigManager.alwaysDash) at the beginning?
Your question is a bit too vague, as I outlined two different methods in my post and you didn't specify which one you're using.

If you're using the plugin, then you don't need any of the ConfigManager stuff. If you're using the ConfigManager method (which I still don't recommend), then you should use both snippets exactly as I posted them. That means 2 lines when forcing dash on and 1 line when removing the override. If you added that as a 2nd line when removing the override, that would completely defeat the point.

Original thread: https://forums.rpgmakerweb.com/threads/can-i-force-the-player-to-dash-at-a-specific-point.180439/