Status
Not open for further replies.

Marsigne

Veteran
Veteran
Joined
Sep 7, 2013
Messages
1,834
Reaction score
4,643
First Language
English
Primarily Uses
RMVXA
I've searched on 2 forums and cant find it. Even searched on google but get to get it off, or Yanfly script but I want to toggle dash so when you press it you dont have to hold it.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,189
Reaction score
14,662
First Language
English
Primarily Uses
RMMV
The 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.press:)A)to this:
Code:
return $game_switches[id]
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.
 
Last edited by a moderator:

Marsigne

Veteran
Veteran
Joined
Sep 7, 2013
Messages
1,834
Reaction score
4,643
First Language
English
Primarily Uses
RMVXA
The 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.press:)A)to this:
Code:
return $game_switches[id]
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.
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 snippet :)
 

Fomar0153

Arkz
Restaff
Joined
Mar 13, 2012
Messages
1,326
Reaction score
492
First Language
English
Primarily Uses
RMMZ
I use this snippet in my projects

Code:
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
You're welcome to use it.
 

Marsigne

Veteran
Veteran
Joined
Sep 7, 2013
Messages
1,834
Reaction score
4,643
First Language
English
Primarily Uses
RMVXA
I 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.
Thanks for the fast reply and snippet :D I will credit you in my project :D The problem is, when I place the script (below and above all script did both) it gives me an error:

Error1_zpsc27fc46d.png


It gives me that error regardless if it's below or above all projects, and when I replace your codes with the Game_Player (default) code, I get same error:

Error2_zps5c5996bf.png


Tried to do it in a fresh new project but same error comes up :/
 

Fomar0153

Arkz
Restaff
Joined
Mar 13, 2012
Messages
1,326
Reaction score
492
First Language
English
Primarily Uses
RMMZ
Sorry I rewrote the aliases to make sense and messed up.

Code:
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
 

Marsigne

Veteran
Veteran
Joined
Sep 7, 2013
Messages
1,834
Reaction score
4,643
First Language
English
Primarily Uses
RMVXA
Sorry 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
Thanks :D Topic can be locked :)
 

Archeia

Level 99 Demi-fiend
Staff member
Developer
Joined
Mar 1, 2012
Messages
15,307
Reaction score
15,771
First Language
Filipino
Primarily Uses
RMMZ
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

After gathering, sorting out & reconsidering hundreds of enemy battlers over the last two das, finally my favorite part begins: Inventing names and lore for them all :D
I'm running a sale for Learn RPG Maker MV on Itch.io, can I compete with NSFW games earning goals?
Another Friday and another Zoom call that could have been an email. Working from home is awesome.
Finished with the semester; finally have some time to play around with MV :kaopride:
Started work on the fishing Mini-Game

Forum statistics

Threads
111,364
Messages
1,060,515
Members
144,692
Latest member
sourspoon33
Top