I simply would be able to invert the player's movement controls at a certain point, maybe based on a switch or map id.
Any solutions?
Any solutions?
I tried with common events, and it just doesn't work well. For example, if i press up the pg first moves up and then down, sometimes it stucks in a cycle or freeze the game becouse of collisions.
It's in autorun, I just did it and it worked for me, did you select "skip if can't move" in the move route?.
@>Conditional Branch: Button Down is Being Pressed
@>Set Move Route: Player (Skip)
: : $>Move Up
@>
: Else
@>Conditional Branch: Button Up is Being Pressed
@>Set Move Route: Player (Skip)
: : $>Move Down
@>
: Else
@>Conditional Branch: Button Left is Being Pressed
@>Set Move Route: Player (Skip)
: : $>Move Right
@>
: Else
@>Conditional Branch: Button Right is Being Pressed
@>Set Move Route: Player (Skip)
: : $>Move Left
@>
: Else
@>Set Move Route: Player (Skip)
: : $>Wait: 1 frames(s)
@>
: Branch End
@>
: Branch End
@>
: Branch End
@>
: Branch End
@>
module ZERO
# Set switch number to track the inverted movement status
INVERTED_SWITCH = 100
end
class Game_Player < Game_Character
alias zero_move_straight move_straight
def move_straight(d, turn_ok = true)
if $game_switches[ZERO::INVERTED_SWITCH]
case d
when 4
d = 6
when 6
d = 4
when 8
d = 2
when 2
d = 8
end
end
zero_move_straight(d, turn_ok)
end
end
It perfectly works! Thank you very much!
module ZERO
# Set switch number to track the inverted movement status
INVERTED_SWITCH = 100
end
class Game_Player < Game_Character
# Alias move_straight
alias zero_move_straight move_straight
def move_straight(d, turn_ok = true)
if $game_switches[ZERO::INVERTED_SWITCH] == true
case d
when 4
d = 6
when 6
d = 4
when 8
d = 2
when 2
d = 8
end
end
zero_move_straight(d, turn_ok)
end
# New function
# Support for 8 Dir Move by JVScripts
def case_diagonal
case Input.dir8
when 2, 4, 6, 8
move_straight(Input.dir4)
when 1
$game_switches[ZERO::INVERTED_SWITCH] ? move_diagonal(6, 8) : move_diagonal(4, 2)
when 3
$game_switches[ZERO::INVERTED_SWITCH] ? move_diagonal(4, 8) : move_diagonal(6, 2)
when 7
$game_switches[ZERO::INVERTED_SWITCH] ? move_diagonal(6, 2) : move_diagonal(4, 8)
when 9
$game_switches[ZERO::INVERTED_SWITCH] ? move_diagonal(4, 2) : move_diagonal(6, 8)
end
end
# Overwrite move_by_input
# Support for 8 Dir Move by JVScripts
# Only overwrite if 8 Dir Move script is loaded
if JvScripts.const_defined?(:Dirs8)
def move_by_input
return if !movable? || $game_map.interpreter.running?
if JvScripts::Dirs8::Switch > 0
if $game_switches[JvScripts::Dirs8::Switch] == true
case_diagonal
else
move_straight(Input.dir4) if Input.dir4 > 0
end
else
case_diagonal if Input.dir8 > 0
end
end
end
end
Thanks so much!
Original thread: https://forums.rpgmakerweb.com/threads/invert-controls.136047/