Save-Point
KharStepOrder XP - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Material Development (https://www.save-point.org/forum-8.html)
+--- Forum: Scripts Database (https://www.save-point.org/forum-39.html)
+---- Forum: RPGMaker XP (RGSS) Engine (https://www.save-point.org/forum-116.html)
+---- Thread: KharStepOrder XP (/thread-9077.html)



KharStepOrder XP - kyonides - 09-03-2024

KharStepOrder
XP

by Kyonides

Introduction

This scriptlet allows you to change which character's leg goes first while walking around.
Happy with a sweat Really, that's it!


WARNING
 
Game_Character#update has been overwritten.
The pattern section was not kept apart from the rest of the code.


To change the Game_Character's default option, look for the @@step_order class variable and set it to :left or :right

Change the Current Pattern Order for All Walking Characters in Game:

Code:
Game_Character.step_order = :left OR :right

Script

Code:
# * KharStepOrder XP * #
#   Scripter : Kyonides Arkanthes
#   2024-09-03

# WARNING: Game_Character#update has been overwritten.
#          The pattern section was not kept apart from the rest of the code.

# * Game_Character's Default Option * #
# @@step_order = :left OR :right

# * Script Call * #
# - Change the Current Pattern Order for All Walking Characters:
# Game_Character.step_order = :left OR :right

class Game_Character
  @@step_order = :right
  def self.step_order=(order)
    @@step_order = order
  end

  def self.set_step_order
    (@@step_order == :right ? 1 : -1)
  end

  def update
    if jumping?
      update_jump
    elsif moving?
      update_move
    else
      update_stop
    end
    @leg_order = Game_Character.set_step_order
    if @anime_count > 18 - @move_speed * 2
      if not @step_anime and @stop_count > 0
        @pattern = @original_pattern
      else
        # Edited pattern
        @pattern = (@pattern + @leg_order) % 4
      end
      @anime_count = 0
    end
    if @wait_count > 0
      @wait_count -= 1
      return
    end
    if @move_route_forcing
      move_type_custom
      return
    end
    if @starting or lock?
      return
    end
    if @stop_count > (40 - @move_frequency * 2) * (6 - @move_frequency)
      case @move_type
      when 1  # Random
        move_type_random
      when 2  # Approach
        move_type_toward_player
      when 3  # Custom
        move_type_custom
      end
    end
  end
end

Terms & Conditions

Free for use in ANY game. Gamer
Due credit is mandatory because I say so. Tongue sticking out