Enable a switch while running?

Fragarachu

Veteran
Veteran
Joined
Apr 19, 2018
Messages
59
Reaction score
2
First Language
Indonesia
Primarily Uses
RMVXA
In RPG Maker VX Ace, how do i activate switch when dashing/running?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,111
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
try this in a new script slot (change 5 to whatever switch you want to be turned on/off):

Code:
class Game_Player < Game_Character
  alias :dash_update :update
  def update
    $game_switches[5] = dash? && moving?
    dash_update
  end
end
this will turn on the switch if you're moving AND dashing. If you're not moving, it will return false, even if you're holding the button down.

If you want it to return true when you're holding down the button, even if you're not moving, just remove the && moving? at the end of that line.
 

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

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,048
Messages
1,018,543
Members
137,834
Latest member
EverNoir
Top