1. Lateral movement. Going up and down staring left or right, memorizing the final position, basically nullifying the character of rising or falling characteristic of the four directions.
Moggy never made anthing easy, did he?
😛 Well, you wanted side-to-side movement without chance of the Player or NPCs from facing up or down, right? This obviously for a side-scrolling fighting platformer like "Bad Dudes" or "Teenage Mutant Ninja Turtles"... oh, those were the days. So I crafted a little script for you to place below all the others. It rewrites a couple of his movement methods and 'forces' characters to remain in fixed direction.
To enable the lateral movement, use the following script call:
$game_system.xas_platformer_movement = true
To disable the feature and return normal movement, use:
$game_system.xas_platformer_movement = nil
Spoiler: XAS Basic Platformer Movement
Code:
#==============================================================================
# ** XAS Basic Platformer Movement
#------------------------------------------------------------------------------
# by DerVVulfman
# V 1.0 (10-07-2019) (MM-DD-YYYY_
# RPGMaker XP Version
#------------------------------------------------------------------------------
# FUNCTION: By turning on a switch built into Game_System, the character
# movtion of the player chantes to left/right movement.
#==============================================================================
#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
# This class handles data surrounding the system. Backround music, etc.
# is managed here as well. Refer to "$game_system" for the instance of
# this class.
#==============================================================================
class Game_System
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :xas_platformer_movement # Side-to-Side Platformer movement
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias xas_platformer_initialize initialize
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Perform the original call
xas_platformer_initialize
# Add the new switch
@xas_platformer_movement = false
end
end
#==============================================================================
# ** Game_Character
#------------------------------------------------------------------------------
# This class deals with characters. It's used as a superclass for the
# Game_Player and Game_Event classes.
#==============================================================================
class Game_Character
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias xas_platformer_diagonal_move_down move_down
alias xas_platformer_diagonal_move_up move_up
alias xas_platformer_diagonal_move_lower_left move_lower_left
alias xas_platformer_diagonal_move_lower_right move_lower_right
alias xas_platformer_diagonal_move_upper_left move_upper_left
alias xas_platformer_diagonal_move_upper_right move_upper_right
#--------------------------------------------------------------------------
# * Move Down
# turn_enabled : a flag permits direction change on that spot
#--------------------------------------------------------------------------
def move_down(turn_enabled = true)
# Force direction fix IF platformer movement
if $game_system.xas_platformer_movement == true
@direction_fix = true
end
# Perform the original call
xas_platformer_diagonal_move_down
# Free up direction fixing IF platformer movement
if $game_system.xas_platformer_movement == true
@direction_fix = false
end
end
#--------------------------------------------------------------------------
# * Move up
# turn_enabled : a flag permits direction change on that spot
#--------------------------------------------------------------------------
def move_up(turn_enabled = true)
# Force direction fix IF platformer movement
if $game_system.xas_platformer_movement == true
@direction_fix = true
end
# Perform the original call
xas_platformer_diagonal_move_up
# Free up direction fixing IF platformer movement
if $game_system.xas_platformer_movement == true
@direction_fix = false
end
end
#--------------------------------------------------------------------------
# * Move Lower Left
#--------------------------------------------------------------------------
def move_lower_left
# Force direction fix IF platformer movement
if $game_system.xas_platformer_movement == true
turn_left
@direction_fix = true
end
# Perform the original call
xas_platformer_diagonal_move_lower_left
# Free up direction fixing IF platformer movement
if $game_system.xas_platformer_movement == true
@direction_fix = false
end
end
#--------------------------------------------------------------------------
# * Move Lower Right
#--------------------------------------------------------------------------
def move_lower_right
# Force direction fix IF platformer movement
if $game_system.xas_platformer_movement == true
turn_right
@direction_fix = true
end
# Perform the original call
xas_platformer_diagonal_move_lower_right
# Free up direction fixing IF platformer movement
if $game_system.xas_platformer_movement == true
@direction_fix = false
end
end
#--------------------------------------------------------------------------
# * Move Upper Left
#--------------------------------------------------------------------------
def move_upper_left
# Force direction fix IF platformer movement
if $game_system.xas_platformer_movement == true
turn_left
@direction_fix = true
end
# Perform the original call
xas_platformer_diagonal_move_upper_left
# Free up direction fixing IF platformer movement
if $game_system.xas_platformer_movement == true
@direction_fix = false
end
end
#--------------------------------------------------------------------------
# * Move Upper Right
#--------------------------------------------------------------------------
def move_upper_right
# Force direction fix IF platformer movement
if $game_system.xas_platformer_movement == true
turn_right
@direction_fix = true
end
# Perform the original call
xas_platformer_diagonal_move_upper_right
# Free up direction fixing IF platformer movement
if $game_system.xas_platformer_movement == true
@direction_fix = false
end
end
end
#==============================================================================
# ** Game_Player
#------------------------------------------------------------------------------
# This class handles the player. Its functions include event starting
# determinants and map scrolling. Refer to "$game_player" for the one
# instance of this class.
#==============================================================================
class Game_Player < Game_Character
#--------------------------------------------------------------------------
# * Quarter Counfuse Move
#--------------------------------------------------------------------------
def quarter_confuse_move
pre_quarter = @quarter
case Input.dir8
when 1
if $game_system.xas_platformer_movement == true
move_up
move_right
else
move_right
move_up
@quarter = true
end
when 2
move_up
when 3
move_up
move_left
@quarter = true unless $game_system.xas_platformer_movement == true
when 4
move_right
when 6
move_left
when 7
move_down
move_right
@quarter = true unless $game_system.xas_platformer_movement == true
when 8
move_down
when 9
if $game_system.xas_platformer_movement == true
move_down
move_left
else
move_left
move_down
@quarter = true
end
end
@need_refresh_pose = true if pre_quarter != @quarter
end
#--------------------------------------------------------------------------
# * Quarter Normal Move
#--------------------------------------------------------------------------
def quarter_normal_move
pre_quarter = @quarter
if $game_temp.check_name_time > 0 and self.action == nil and not
moving? and @quarter
$game_temp.check_name_time -= 1
@quarter = false if $game_temp.check_name_time == 0
end
case Input.dir8
when 1
if $game_system.xas_platformer_movement == true
move_down
move_left
else
move_left
move_down
@quarter = true
end
when 2
move_down
when 3
move_down
move_right
@quarter = true unless $game_system.xas_platformer_movement == true
when 4
move_left
when 6
move_right
when 7
move_up
move_left
@quarter = true unless $game_system.xas_platformer_movement == true
when 8
move_up
when 9
if $game_system.xas_platformer_movement == true
move_up
move_right
else
move_right
move_up
@quarter = true
end
end
$game_temp.check_name_time = XAS::FIX_DIAGONAL_TIME_STAND if moving?
@need_refresh_pose = true if pre_quarter != @quarter
end
end
It doesn't craft an idle pose feature... but hey, this is a start, right?
😀