How to Disable and Renable Dashing?

I'm sure there is a way to disable dashing (holding shift) in the database, and renable it in an event, but I can't find it anywhere. You guys are geniuses, I'm sure you know how to find it.
Enable/disable dashing is an option of the map properties and not changable by default. It needs a script to change that option dynamically (I know a script for this already exists).


I've moved this thread to Ace Script Request. Please be sure to post your threads in the correct forum next time. Thank you.



I don't have the link to that script ready, please search for it on the master script list
Allocate a switch to disable dashing (the example below will assume it's switch 5).


Go to Game_Player, and insert this before line 141:

Code:
return false if $game_switches[5]

so the whole method will look like this:

Code:
def dash?
  return false if @move_route_forcing
  return false if $game_map.disable_dash?
  return false if vehicle
  return false if $game_switches[5]
  return Input.press?(:A)
end

of course, replace 5 with whatever switch number you want to use (no leading zeros)


When the switch is off (which is the default when a new game is started), the player will be able to dash.  To disable dashing, turn the switch on.
Thanks Shaz, that's really helpful!
Pointing Out the Obvious.png


I do believe one can use a script call to control that in events. I am going to try to get this to work.
It's a property of $game_map's @map variable, which is not avialable for modification at runtime.  If you want to change the map property via a script call, you will need to change the script to make @map and @map.disable_dashing available for changing.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-disable-and-renable-dashing.61436/