beat'up game Movement

Discussion in 'RGSS Script Requests' started by thiagobastoscf, Oct 7, 2019.

  1. thiagobastoscf

    thiagobastoscf Warper Member

    Messages:
    2
    Likes Received:
    0
    First Language:
    Portuguese
    [SCRIPT REQUEST] RPG MAKER VX Ace or RPG Maker XP

    I was wondering if anyone could help me with a script motion modification.
    I am creating a beat'up game from an XAS DEMO, it would need some script modifications such as:

    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.

    2. Charset of four to eight spacing frames in the hero's gait movement.

    3. Standby Movement The standing Hero has the impression that he is breathing or making another movement when not moving.

    [​IMG]
    .
    [​IMG]
     
    #1
  2. mlogan

    mlogan Global Moderators Global Mod

    Messages:
    13,848
    Likes Received:
    7,666
    Location:
    Texas
    First Language:
    English
    Primarily Uses:
    RMMV
    @thiagobastoscf Please clarify whether you want this for Ace or XP, they are not interchangeable.
     
    #2
  3. thiagobastoscf

    thiagobastoscf Warper Member

    Messages:
    2
    Likes Received:
    0
    First Language:
    Portuguese
    .

    I would like to RPG Maker XP
     
    #3
  4. DerVVulfman

    DerVVulfman Resident Werewolf Veteran

    Messages:
    309
    Likes Received:
    150
    First Language:
    English
    Primarily Uses:
    RMXP
    Moggy never made anthing easy, did he? :p 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

    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? :D
     
    #4

Share This Page