Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Changing Character Battle Positions

You know how a character's positions (Front, Middle, Rear) affect their accuracy and avoidability in battle?  Well, is there a way to change it so that you can change character positions via the main menu?
 
In your project, click file and choose "compress game data" choose an output folder, and the engine will make a file for you. Then just upload that to something like mediafire.com
 
I'll have to download this when I get home, and I'll see what I can do for you
EDIT: Ugh....it was really blatantly obvious what was wrong. The fact that you did practically nothing of what I told you doesn't exactly motivate me to help you >_>
My script was still the old "VX" version. You hadn't changed Game_Party like I told you, when I asked you to search for Scene_Menu, you never did...that would have solved the problem almost instantly
You have 2 scripts rewriting the same class, and only the last one actually comes into effect, simply because that's how it works. Putting the limit break script in front of the command manager is one way to do it, but that's just plain ugly, because, though it's a handy script, the command manager is not executed that well. It only updates some time after opening the menu meaning that you get an ugly frame where the menu is different.
I'm gonna fix this for you, but in the future, it would really pay off if you actually payed attention when someone's trying to help you...
EDIT2: Well, I've got everything working as it should, for so far as I can see, there's only one problem. The commands don't actually all fit in the menu. I could edit the time display window to look like
Time: 00:00:00
instead of
Play time
    00:00:00
and it would fit. Do you have any objections to that?
 
Well, rather than sending you the entire project back, here is the file with your scripts in it. Just put this in your data folder and overwrite the old one. (Make a back-up before hand in case you've got anything new in the one you have now that you want to retrieve)
It should all work. Note, I've left some of the scripts a little bit messy with big comments in them, mostly so that I didn't actualy have to delete any of the functionality from them in case you want to revert back to the originals

Here it is
Scripts
 
eh? You replaced the scripts file in your data folder with my uploaded file?
Because it sounds to me like you didn't....Otherwise the scripts would be working correctly...
Here's Instructions from step one in case you didn't get what I meant:
Download my file -> Go to my computer -> go to wherever your project is -> Copy my file into the "Data" directory of your project's game and be sure to call it "Scripts" (without quotation marks)
If you want to not have it overwrite the previous file, rename the previous file to something like Scripts.BAK and THEN copy my file in.
Every project I've tried this in it's run just fine
 
Okay!  It's working perfectly now!  I made the mistake of having RPG Maker open when I was copying over the new script into the old one.  Thanks a lot for all your help!  :thumb:
 
No worries lol.
A handy hint for future projects:
Since you are probably one of those people who likes customizing everything to the max with copious amounts of scripts, be weary what scripts you get and what they do.
Most good scripts will have information on likely compatibility issues, so heed that when you are getting new scripts that have the same issues, they're not likely to work together. Also, try to learn at least what exactly a script does. You don't have to know the details of it, but chances are, if you recognise parts in 2 different scripts that look very similar, there's gonna be trouble.
Finally, a very important note with scripts is that the order in which you place them is extremely important. If 2 scripts overwrite the same method, the last script's new method will be the only one executed. This problem is often prevented by using "aliases" but this is not always practical, nor always possible.

Anyway, have fun with it lol.
 
Argh, didn't want to bother you with this trivial thing but you know my script best.  This script:


Code:
# RTAB Configuration System
# Support bulletin board http: //www2.ezbbs.net/21/minto-aaa/
#
# Updated for use with:
# Real time active battle (RTAB) Ver 1.12
# Distribution original support URL
# http://members.jcom.home.ne.jp/cogwheel/

=begin

REVISED:
This script brings up an options menu geared to handle the speed, action and
camera functions of Cogwheel's RTAB CBS.  

Originally designed and encorporated in a working main menu, you will note on 
line 368 of this script that the designer intended the menu to return to menu 
option #6 ( $scene = Scene_Menu.new(6) ).  

As $scene = Scene_Menu.new(5) would have returned to the menu, highlighting the
"End Game" option, the designer's menu obviously had more than the default num-
ber of options.

Obviously for anyone designing their own menu, this system is already set up
to be encorporated into your own menu.  But for those who want a system where
an event (such as a savepoint-like object) brings up the RTAB configuration
menu, you merely need to alter line #368 as such:  

                          $scene = Scene_Map.new

-------------------------------------------------------------------------------

To call this script, use:  

                      $scene = Scene_Customize.new

=end

#==============================================================================
# ** 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   :battle_speed           # 戦闘速度
  attr_accessor   :battle_active          # アクティブ
  attr_accessor   :battle_camera          # カメラ稼動 
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  alias initialize_MINT_RTAB_Customize initialize
  def initialize
    # Call original initialization process
    initialize_MINT_RTAB_Customize
    @battle_speed = 150                 # Default:  RTAB speed
    @battle_active = 0                  # Default:  Wait during Item/Skill Select
    @battle_camera = false              # Default:  Camera turned off
  end
end

#==============================================================================
# ** Window_Customize
#==============================================================================
class Window_Customize < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(160, 92, 320, 288)    
    @column_max = 1
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    @element = []
    #Acquiring the skill which you have acquired
    get_data
    get_element
    # If the number of items is not 0, drawing item
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Acquire the menu option items
  #--------------------------------------------------------------------------
  def get_data
    data = [
    "Battle speed",
    "Active",
    "Camera work"]
    @data = data
  end
  #--------------------------------------------------------------------------
  # * Acquire the menu option settings
  #--------------------------------------------------------------------------
  def get_element
    case $game_system.battle_active
    when 1
      active = "Wait"
    when 2
      active = "Semi active"
    else
      active = "Full active"
    end
    if $game_system.battle_camera
      camera = "ON"
    else
      camera = "OFF"
    end    
    data = [$game_system.battle_speed.to_s, active, camera]
    @element = data
  end    
  #--------------------------------------------------------------------------
  # * Draw Item
  #     index : item number
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    deta = @element[index]
    x = 0
    y = index * 32     
    self.contents.draw_text(x + 4, y, 140, 32, item, 0)
    self.contents.draw_text(x + 144, y, 140, 32, deta, 2)
  end
  #--------------------------------------------------------------------------
  # * Set Help Text
  #--------------------------------------------------------------------------
  def help_text(index)
    case index
    when 0
      text = "Modifies the combat speed. Lower numbers increases combat speed."
    when 1
      text = "Modifies the flow of time in battle"
    else
      text = "Sets whether the camera follows the moving battler."
    end
  end
  #--------------------------------------------------------------------------
  # * Update Help Text
  #--------------------------------------------------------------------------
  def update_help    
    text = help_text(self.index)
    @help_window.set_text(text)
  end
end


#==============================================================================
# ** Window_Command2
#------------------------------------------------------------------------------
#  This window deals with new command choices.
#==============================================================================
class Window_Command2 < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object initilization
  #--------------------------------------------------------------------------
  def initialize(width, commands)
    # Calculating the height of the window from the quantity of command
    super(0, 0, width, commands.size * 32 + 32)
    @item_max = commands.size
    @commands = commands
    self.contents = Bitmap.new(width - 32, @item_max * 32)
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i, normal_color)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #     index : item number
  #     color : text color
  #--------------------------------------------------------------------------
  def draw_item(index, color)
    self.contents.font.color = color
    self.contents.font.size = 20 
    rect = Rect.new(4, 32 * index, self.contents.width - 8, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @commands[index])
  end
  #--------------------------------------------------------------------------
  # * Disable Item
  #     index : item number
  #--------------------------------------------------------------------------
  def disable_item(index)
    draw_item(index, disabled_color)
  end
  #--------------------------------------------------------------------------
  # * Set Help Text
  #--------------------------------------------------------------------------
  def help_text(index)
    case index
    when 0
      text = "Pauses when choosing a Skill, an Item or an Enemy. (Beginners)"
    when 1
      text = "Pauses when the Skill or Item windows are active. (Recommended)"      
    else
      text = "Action never pauses.  (Expert-mode)"
    end
  end
  #--------------------------------------------------------------------------
  # * Update Help Text
  #--------------------------------------------------------------------------
  def update_help    
    text = help_text(self.index)
    @help_window.set_text(text)
  end
end

#==============================================================================
# ** Window_Help2
#------------------------------------------------------------------------------
#  This window shows explanations for new options.
#==============================================================================
class Window_Help2 < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 420, 640, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.pause = false
  end
  #--------------------------------------------------------------------------
  # * Set Text
  #  text  : text string displayed in window
  #  align : alignment (0..flush left, 1..center, 2..flush right)
  #--------------------------------------------------------------------------
  def set_text(text, align = 1)   
    # If at least one part of text and alignment differ from last time
    if text != @text or align != @align
      # Redraw text
      self.contents.clear
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 0, self.width - 40, 32, text, align)
      @text = text
      @align = align
      @actor = nil
    end
    self.visible = true
  end
end

#==============================================================================
# ** Scene_Customize
#------------------------------------------------------------------------------
#  This class performs RTAB Player Options decisions
#==============================================================================

class Scene_Customize  
  #--------------------------------------------------------------------------
  # * Main processing
  #--------------------------------------------------------------------------
  def main
    # Make help window, main window
    @help_window = Window_Help2.new      
    @main_window = Window_Customize.new
    @main_window.refresh
    @dummy_window = Window_Base.new(480,92,100,64)
    @dummy_window.visible = false
    @number_window = Window_InputNumber.new(3)
    @number_window.x = 480
    @number_window.y = 92
    @number_window.visible = false
    @number_window.active = false
    command = ["Wait", "Semi-Active", "Fully-Active"]
    camera_command = ["On", "Off"]
    @command_window = Window_Command2.new(120, command)
    @command_window.x = 480
    @command_window.y = 136
    @command_window.visible = false
    @command_window.active = false    
    @camera_window = Window_Command.new(120, camera_command)
    @camera_window.x = 480
    @camera_window.y = 172
    @camera_window.visible = false
    @camera_window.active = false
    # Associate help window
    @main_window.help_window = @help_window
    @command_window.help_window = @help_window
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @help_window.dispose
    @main_window.dispose
    @number_window.dispose
    @dummy_window.dispose
    @command_window.dispose
    @camera_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # If main window is active: call update_main
    if @main_window.active
      @main_window.update
      update_main
      return
    end
    if @number_window.active
      @number_window.update
      update_number
      return
    end
    if @command_window.active
      @command_window.update
      update_command
      return
    end
    if @camera_window.active
      @camera_window.update
      update_camera
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Main Update (when main window is active)
  #--------------------------------------------------------------------------  
  def update_main
    # If B Button is pressed
    if Input.trigger?(Input::B)
      # Play Cancel SE
      $game_system.se_play($data_system.cancel_se)
      
      # Return to Menu (THIS is where you return from an options menu)
      #$scene = Scene_Menu.new(6)
      $scene = Scene_Map.new
      
      return
    end
    # If C Button was pressed
    if Input.trigger?(Input::C)
      # Branch by main command decision
      @index = @main_window.index
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      case @index
      when 0
        @number_window.active = true
        @number_window.visible = true
        @dummy_window.visible = true
        @main_window.active = false
      when 1
        @command_window.active = true
        @command_window.visible = true
        @main_window.active = false
      when 2
        @camera_window.active = true
        @camera_window.visible = true
        @main_window.active = false  
      when 3
        @camera_window.active = true
        @camera_window.visible = true
        @main_window.active = false 
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Number Update (when number window is active)
  #--------------------------------------------------------------------------
  def update_number
    # If B Button was pressed
    if Input.trigger?(Input::B)
      # Play Cancel SE
      $game_system.se_play($data_system.cancel_se)
      @number_window.active = false
      @number_window.visible = false
      @dummy_window.visible = false
      @main_window.active = true
      return
    end
    # If C Button was Pressed
    if Input.trigger?(Input::C)
      # Obtain Current RTAB Battle Speed
      $game_system.battle_speed = @number_window.number
      $game_system.battle_speed = 1 if @number_window.number == 0
      # Play Decision SE
      $game_system.se_play($data_system.decision_se)
      @number_window.active = false
      @number_window.visible = false
      @dummy_window.visible = false
      @main_window.active = true
      @main_window.refresh
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Command Update (when command window is active)
  #--------------------------------------------------------------------------
  def update_command
    # If B Button was pressed
    if Input.trigger?(Input::B)
      # Play Cancel SE
      $game_system.se_play($data_system.cancel_se)
      @command_window.active = false
      @command_window.visible = false
      @main_window.active = true
      return
    end
    # If C Button was pressed
    if Input.trigger?(Input::C)
      # Branch by "Active" window cursor position
      case @command_window.index
      when 0
        $game_system.battle_active = 1
      when 1
        $game_system.battle_active = 2
      when 2
        $game_system.battle_active = 3
      end      
      # Play Decision SE
      $game_system.se_play($data_system.decision_se)
      @command_window.active = false
      @command_window.visible = false
      @main_window.active = true
      @main_window.refresh
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Camera Update (when camera window is active)
  #--------------------------------------------------------------------------
  def update_camera
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play Cancel SE
      $game_system.se_play($data_system.cancel_se)
      @camera_window.active = false
      @camera_window.visible = false
      @main_window.active = true
      return
    end
    # If C Button was pressed
    if Input.trigger?(Input::C)
      # Branch by camera window cursor position
      case @camera_window.index
      when 0
        $game_system.battle_camera = true
      when 1
        $game_system.battle_camera = false
      end      
      # Play Decision SE
      $game_system.se_play($data_system.decision_se)
      @camera_window.active = false
      @camera_window.visible = false
      @main_window.active = true
      @main_window.refresh
      return
    end
  end
end

#==============================================================================
# Real time active battle (RTAB) Ver 1.12
#==============================================================================
# ** Scene_Battle
#==============================================================================

class Scene_Battle  
  #--------------------------------------------------------------------------
  # * ATB fundamental setup
  #--------------------------------------------------------------------------
  def atb_setup
    # ATB initialization
    #
    # speed   : Battle speed decision. The lower the value, the faster the system
    #
    # @active : Degree of active setting
    #           3 : Always active state
    #           2 : ATB pauses when selecting skill/item
    #           1 : Same as 2, but pauses during target selection
    #           0 : Same as 1, but pauses during command window selection.
    #
    # @action : Others while acting is the fact that by their causes conduct permitted?
    #           3 : If by his is not incapacitation, limited to you permit
    #           2 : If by his has not received the damage, you permit
    #           1 : In addition to the state of 2, if the target has not acted, you permit
    #           0 : Conduct is not permitted. Until it finishes to act in order, it waits
    #
    # @anime_wait : When it makes true, during battle animation damage indicating wait catches
    # @damage_wait : Damage indicatory waiting (as for unit frame)
    #
    # @after_wait : At the time of ally enemy total loss,  until moves to next processing, waiting
    #               [a, b]  a) At the time of party total loss,  b) At time of enemy total loss (unit frame)
    #
    # @enemy_speed : Thought speed of enemy. If 1 immediately conduct.
    #                In every frame, conduct is caused with the probability of 1/@enemy_speed
    #
    # @force : With forced action forced condition at time of skill use
    #          2: As for skill everything not to reside permanently, by all means immediately execution
    #          1: As for independent skill to reside permanently, only cooperation skill immediately execution
    #          0: All the skill permanent residence just are done
    #
    # ($scene.force = Usually by making x, from the script of the event modification possibility)
    #
    # CAMERA DRIVE SYSTEM:  This system moves the Camera POV to the currently moving battler
    # @drive       : Camera drive system ON/OFF.  When true, drive ON, when false drive OFF
    # @scroll_time : Time it takes to scroll/move the camera POV during battle
    #
    # @zoom_rate = [i, j] : Zoom Rate (Changes the size of the enemy based on perspective)
    #                       i) When arranging in the picture first section, enlargement ratio
    #                       j) When arranging in the picture lowest section, enlargement ratio
    #                       1  When liking to make time, 1.0 be sure to set with decimal

    speed = $game_system.battle_speed     # IN FRAMES / FOR ATB SYSTEM
    @active = $game_system.battle_active  # Active Setting (Range of 0 - 3)
    @action = 3                           # Action Setting (Range of 0 - 3)
    @anime_wait = true                    #
    @damage_wait = 10                     #
    @after_wait = [80, 0]                 #
    @enemy_speed = 40                     #
    @force = 0                            #
    @drive = $game_system.battle_camera   # Turns camera system on/off
    @scroll_time = 15                     # Speed of camera system
    @zoom_rate = [1.0, 1.0]               # Change size of battler based on perspective
    @help_time = 40
    @escape == false
    @camera = nil
    @max = 0
    @turn_cnt = 0
    @help_wait = 0
    @action_battlers = []
    @synthe = []
    @spell_p = {}
    @spell_e = {}
    @command_a = false
    @command = []
    @party = false

    for battler in $game_party.actors + $game_troop.enemies
      spell_reset(battler)
      battler.at = battler.agi * rand(speed / 2)
      battler.damage_pop = {}
      battler.damage = {}
      battler.damage_sp = {}
      battler.critical = {}
      battler.recover_hp = {}
      battler.recover_sp = {}
      battler.state_p = {}
      battler.state_m = {}
      battler.animation = []
      if battler.is_a?(Game_Actor)
        @max += battler.agi
      end
    end

    @max *= speed
    @max /= $game_party.actors.size

    for battler in $game_party.actors + $game_troop.enemies
      battler.atp = 100 * battler.at / @max
    end
  end
end

was made for the main menu to make configurations to the ATB system.  However, it kinda is confusing since it doesn't exactly make a command on the main menu (at least from what I saw).  I'm not sure where to put it so that it'll work.  Last help?  For sure.
 
The thing is that you can't just easily "add" a command to the main menu. I suggest having this thing being called from an event (maybe create a common event that calls "$scene = Scene_Customize.new" ?) when you press a certain key.
Since your menu is already....huge...I reckon i would look kinda weird adding yet another option.
If you don't mind calling it from an event, I also suggest finding all lines in the script that say "$scene = Scene_Menu.new(some number)" and replacing them with "$scene = Scene_map.new
 
What if the menu system commands could be scrolled through.  Like it's the average size it was before but if you press down after the last one more pops up.  It was implemented when I had just the Party Changing script by default I believe.
 
How about we take out the "Party Changing" script and the "Large Party" script be taken out?  I don't think I'll need those and so that gives us the space to put in the RTAB Configuration.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top