Toggle Dash feature?

Status
Not open for further replies.

Marsigne

Veteran
Veteran
Joined
Sep 7, 2013
Messages
1,834
Reaction score
4,642
First Language
No
Primarily Uses
N/A
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

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
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,642
First Language
No
Primarily Uses
N/A
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,327
Reaction score
473
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,642
First Language
No
Primarily Uses
N/A
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:



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:



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

Fomar0153

Arkz
Restaff
Joined
Mar 13, 2012
Messages
1,327
Reaction score
473
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,642
First Language
No
Primarily Uses
N/A
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
Developer
Joined
Mar 1, 2012
Messages
15,141
Reaction score
15,473
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.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,863
Messages
1,017,053
Members
137,571
Latest member
grr
Top