return $game_switches[id]
That is more controllable but it will be constantly running (so it might lag if on map with lots of events?) so can you please give me that script snippetThe easiest way (minimal scripting) would be to set up a common event with a parallel process trigger (and turn on the switch right at the start of the game) that continually checks whether the button has been pressed, and when it's pressed, toggle a switch (not the same one that's used in the condition).
Then go to the Game_Player script and modify line 141 (the last line of the dash? method). Change it from this:
return Input.pressA)to this:
where id is the number of the switch you've toggled (don't add leading 0's).If you don't want to use a parallel process common event, let me know and I'll give you a better script snippet that will handle it all on its own (no switches or eventing needed). I would personally do it this way (all via script), but then I prefer to do small script mods to having parallel process events running continually, in most cases.Code:return $game_switches[id]
class Game_Player < Game_Character #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- alias dash_initialize initialize def initialize dash_initialize @dash = false end #-------------------------------------------------------------------------- # * Determine if Dashing #-------------------------------------------------------------------------- def dash? return false if @move_route_forcing return false if $game_map.disable_dash? return false if vehicle return @dash end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- alias dash_update def update dash_update @dash = !@dash if Input.trigger?(:A) endend
Thanks for the fast reply and snippetI use this snippet in my projects
class Game_Player < Game_Character #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- alias dash_initialize initialize def initialize dash_initialize @dash = false end #-------------------------------------------------------------------------- # * Determine if Dashing #-------------------------------------------------------------------------- def dash? return false if @move_route_forcing return false if $game_map.disable_dash? return false if vehicle return @dash end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- alias dash_update def update dash_update @dash = !@dash if Input.trigger?A) endendYou're welcome to use it.
class Game_Player < Game_Character #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- alias dash_initialize initialize def initialize dash_initialize @dash = false end #-------------------------------------------------------------------------- # * Determine if Dashing #-------------------------------------------------------------------------- def dash? return false if @move_route_forcing return false if $game_map.disable_dash? return false if vehicle return @dash end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- alias dash_update update def update dash_update @dash = !@dash if Input.trigger?(:A) endend
ThanksSorry I rewrote the aliases to make sense and messed up.
class Game_Player < Game_Character #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- alias dash_initialize initialize def initialize dash_initialize @dash = false end #-------------------------------------------------------------------------- # * Determine if Dashing #-------------------------------------------------------------------------- def dash? return false if @move_route_forcing return false if $game_map.disable_dash? return false if vehicle return @dash end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- alias dash_update update def update dash_update @dash = !@dash if Input.trigger?A) endend