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.

Hello! ^_^; I'm a bit new here, I need help badly ._.

I know there's probably scripts on all of these, but the last time I tried to use one of them I kind of messed up my RPG MAKER XP script. Not the best at scripting  :neutral:
So here are the things I really could use some help on.
I want to be able to have a party changer, so you can select who is in your current party. I saw that somewhere but really it looks too complex to figure out on my own. So... help me?
I'm doing a KH game (Kingdom Hearts) and I was trying to get it so when Sora is damaged a certain amount, he changes into a random drive form for a set amount of time. The main character is Axel, though, for those who know Kingdom Hearts, and Sora is obtained later on.
The only thing I can think of is to change the battler from Sora to say, Anti Form (which would be a different battler) But I don't know how to use the variables to make it so damage to Sora would trigger it, and how to make it so it wouldn't stay as the battler for too long, and if possible would transfer back by the end of the battle. (Don't want people to take advantage of it.)

Last but not least, I saw the 'skills leveled up the more you use them' script, which turned out to be the one where I had no idea what I was doing. So Fire used 10 times would become Fira, etc.


Can anyone help with any of these?

Also any simple scripts I could use would be much appreciated.  :lol:

But a step by step through these, if it's not too much trouble, would help me a lot.  :down:

Thanks!
 
Dargor has a party changer script that you can find by jumping to the submitted scrpits part of the site. It contains pretty good details of large parties and party changers for in and out of battle. That is also the same place you can find the skill upgrade/ as usedscript I am not sure who did it though. You can also request sprite sets that contain images of weakened charscters when damage has been reached. Let me know if you can or can't find them and I will try to help.
 
Frist is Interpreter Fix- place this above the main script.

#==============================================================================
# ** Interpreter (part 7)
#------------------------------------------------------------------------------
#  This interpreter runs event commands. This class is used within the
#  Game_System class and the Game_Event class.
#==============================================================================

class Interpreter
  #--------------------------------------------------------------------------
  # * Script (Fix an oddity: Game freezes when setting a boolean to false)
  #--------------------------------------------------------------------------
  def command_355
    # Set first line to script
    script = @list[@index].parameters[0] + "\n"
    # Loop
    loop do
      # If next event command is second line of script or after
      if @list[@index+1].code == 655
        # Add second line or after to script
        script += @list[@index+1].parameters[0] + "\n"
      # If event command is not second line or after
      else
        # Abort loop
        break
      end
      # Advance index
      @index += 1
    end
    # Evaluation
    result = eval(script)
    # If return value is false
    if result == false
      # End
      return true
    end
    # Continue
    return true
  end
end
 
Alright, thanks. But what I'm wondering is do I paste ALL of that, or is some of that telling me what to do?

#==============================================================================
# ** Interpreter (part 7)
#------------------------------------------------------------------------------
#  This interpreter runs event commands. This class is used within the
#  Game_System class and the Game_Event class.
#==============================================================================

Do I have all those words in there? Does the game recognize it? I thought it only recognized code, like the following


class Interpreter
  #--------------------------------------------------------------------------
  # * Script (Fix an oddity: Game freezes when setting a boolean to false)
  #--------------------------------------------------------------------------

See, why I didn't understand it before is I couldn't tell which I put in and which was telling me what it did.

Do I put it ALL in? Any spaces between everything?

And to clarify-

Tools, script editor, and where's the main script?


Above

#==============================================================================
# â–  Game_Temp
#------------------------------------------------------------------------------

That?

Or in game system, or what?

As you can see, I'm a total noob at scripting...


Oh! One more thing, on a side note, is there any way to increase the enemy's max HP?

Considering you can increase yours to like... millions, if I ever wanted the game to be that advanced, I'd want the enemies to have a lot too. As it is right now I can only do 999999.
Which is a lot, I admit, but yeah. And the enemy's defense and such is set at a limit, too.

I've figured out how to get player's stats past the starting limit, but not the monsters.
My friend told me the monsters were a lot more complicated for doing that.

Is there a simple way to break the HP/stat limit of monsters?

Thanks for all of the help, please bear with my limited knowledge on the subject ^^:
 
ok copy and paste every thing with # next to it, I have a script for enemy life 1 billion but that is for afterwords. Main is at the bottom of the scripting file. Right click Main then insert , then name it Interpreter Fix, Copy and Paste all of the writing with # to the 1 of the script.
 
Tes alright then make a space under Interpreter named Commands Manager- at the 1 enter

#==============================================================================
# ** Commands Manager
#------------------------------------------------------------------------------
#  Author: Dargor
#  Version 1.2
#  20/09/2007
#==============================================================================
# * Instructions
#------------------------------------------------------------------------------
# - To add a command to the command window use:
#              @command_window.add_command("command")
# - To remove a command to the command window use:
#              @command_window.remove_command("command")
# - To rearrange the commands in the command window use:
#              @command_window.set_commands(["cmd1","cmd2","cmd3"...])
# - You can also rearrange the default menu commands using:
#              $game_system.menu_commands = ["cmd1","cmd2","cmd3"...]
#------------------------------------------------------------------------------
# * Note
#------------------------------------------------------------------------------
# - This script rewrites the update_command and update_status methods
#  in Scene_Menu.
#==============================================================================

#==============================================================================
# ** 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 :default_commands    # default commands
  attr_accessor :menu_commands        # menu commands
  attr_accessor :commands_max        # commands max
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias dargor_menu_commands_initialize initialize
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    @default_commands = ["Item","Skill","Equip","Status","Save","End Game"]
    @menu_commands = ["Item","Skill","Equip","Status","Save","End Game"]
    @commands_max = 6
    dargor_menu_commands_initialize
  end
end

#==============================================================================
# ** Window_Command
#------------------------------------------------------------------------------
#  This window deals with general command choices.
#==============================================================================

class Window_Command < Window_Selectable
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :commands      # commands
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias dargor_index_update update
  alias dargor_disable_item disable_item
  alias dargor_draw_item draw_item
  #--------------------------------------------------------------------------
  # * Add Command (command)
  #--------------------------------------------------------------------------
  def add_command(command)
    return if @commands.include?(command)
    @commands.push(command)
    set_commands(@commands)
  end
  #--------------------------------------------------------------------------
  # * Remove Command (command)
  #--------------------------------------------------------------------------
  def remove_command(command)
    @commands.delete(command)
    set_commands(@commands)
  end
  #--------------------------------------------------------------------------
  # * Set Commands (commands)
  #--------------------------------------------------------------------------
  def set_commands(commands)
    return if commands == [] or commands == nil
    @commands = commands
    @item_max = @commands.size
    self.contents = Bitmap.new(width - 32, @item_max * 32)
    refresh
    self.height = 32 + (32 * $game_system.commands_max)
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #    index : item number
  #    color : text color
  #--------------------------------------------------------------------------
  def draw_item(index, color)
    return if index.nil?
    dargor_draw_item(index, color)
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    dargor_index_update
    update_index
  end
  #--------------------------------------------------------------------------
  # * Frame Update (index)
  #--------------------------------------------------------------------------
  def update_index
    if self.index >= @commands.size
      self.index = @commands.size-1
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Disable Item
  #    index : item number / item string
  #--------------------------------------------------------------------------
  def disable_item(index)
    if index.is_a?(String)
      new_index = @commands.index(index)
      draw_item(new_index, disabled_color)
    else
      draw_item(index, disabled_color)
    end
  end
  #--------------------------------------------------------------------------
  # * Enable Item
  #    index : item number
  #--------------------------------------------------------------------------
  def enable_item(index)
    draw_item(index, normal_color)
  end
end

#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  This class performs menu screen processing.
#==============================================================================

class Scene_Menu
  #--------------------------------------------------------------------------
  # * Alias listing
  #--------------------------------------------------------------------------
  alias add_remove_command_main main
  alias add_remove_command_update update
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Default menu commands
    @default_commands = $game_system.default_commands
    # Create an empty array of command
    @commands = []
    # Call the original main method
    add_remove_command_main
  end
  #--------------------------------------------------------------------------
  # * Set Commands Access
  #--------------------------------------------------------------------------
  def set_commands_access
    # Reinitialize menu commands
    unless @command_window.commands == @commands
      @command_window.set_commands($game_system.menu_commands)
    end
    # Se basic commands name
    s1 = @default_commands[0]
    s2 = @default_commands[1]
    s3 = @default_commands[2]
    s4 = @default_commands[3]
    s5 = @default_commands[4]
    # If number of party members is 0
    if $game_party.actors.size == 0
      # Disable items, skills, equipment, and status
      @command_window.disable_item(s1)
      @command_window.disable_item(s2)
      @command_window.disable_item(s3)
      @command_window.disable_item(s4)
    end
    # If save is forbidden
    if $game_system.save_disabled
      # Disable save
      @command_window.disable_item(s5)
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Set commands access
    set_commands_access
    # Set the array equal to the current commands
    @commands = @command_window.commands
    # Set commands access
    # Call the original update method
    add_remove_command_update
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when command window is active)
  #--------------------------------------------------------------------------
  def update_command
    # Assign @command_window.index to its strings
    command = @commands[@command_window.index]
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to map screen
      $scene = Scene_Map.new
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # If command other than save or end game, and party members = 0
      if $game_party.actors.size == 0 and @command_window.index < 4
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Branch by command window cursor position
      case command
      when @default_commands[0]
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to item screen
        $scene = Scene_Item.new
      when @default_commands[1]
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when @default_commands[2]
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when @default_commands[3]
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when @default_commands[4]
        # If saving is forbidden
        if $game_system.save_disabled
          # Play buzzer SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to save screen
        $scene = Scene_Save.new
      when @default_commands[5]
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to end game screen
        $scene = Scene_End.new
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when status window is active)
  #--------------------------------------------------------------------------
  def update_status
    # Assign @command_window.index to its strings
    command = @commands[@command_window.index]
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Make command window active
      @command_window.active = true
      @status_window.active = false
      @status_window.index = -1
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Branch by command window cursor position
      case command
      when @default_commands[1]
        # If this actor's action limit is 2 or more
        if $game_party.actors[@status_window.index].restriction >= 2
          # Play buzzer SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to skill screen
        $scene = Scene_Skill.new(@status_window.index)
      when @default_commands[2]
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to equipment screen
        $scene = Scene_Equip.new(@status_window.index)
      when @default_commands[3]
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to status screen
        $scene = Scene_Status.new(@status_window.index)
      end
      return
    end
  end
end
 
Yep but there is more now- under Commands manager make Party Changer with this in it-

#==============================================================================
# ** Party Changer
#------------------------------------------------------------------------------
#  Author: Dargor
#  Version 3.3
#  16/12/2007
#==============================================================================
#==============================================================================
# ** Game_Temp
#------------------------------------------------------------------------------
#  This class handles temporary data that is not included with save data.
#  Refer to "$game_temp" for the instance of this class.
#==============================================================================
class Game_Temp
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :selected_members         # selected members
  attr_accessor :party_members            # party members
  attr_accessor :members_gain_exp         # members can gain exp
  attr_accessor :members_exp_rate         # exp % gained
  attr_accessor :party_changer_in_battle  # party changer in battle
  attr_accessor :battle_party_args        # in-battle party changer arguments
  attr_accessor :menu_party_args          # in-menu party changer arguments
  attr_accessor :multiple_party_battle    # open party changer when all actors collapse
  attr_accessor :multiple_teams_args
  attr_accessor :multiple_teams
  attr_accessor :teams_destination
  attr_accessor :current_team
  attr_accessor :use_custom_graphic
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias party_changer_initialize initialize
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    @selected_members = []
    @party_members = []
    @members_gain_exp = true
    @members_exp_rate = 30
    @party_changer_in_battle = true
    @battle_party_args = [1, 4,[],[]]
    @menu_party_args = [1, 4,[],[]]
    @multiple_teams = false
    @multiple_teams_args = [
                            [1, 2,[2],[2]],
                            [1, 2,[5],[5]],
                            [1, 4,[3],[3]]
                            ]
    @teams_destination = [
                          [10,7,1,2],
                          [9,8,1,2],
                          [11,8,1,2]
                         ]
    @current_team = [0, []]
    @multiple_party_battle = true
    @use_custom_graphic = true
    party_changer_initialize
  end
end
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
#  This class is for all in-game windows.
#==============================================================================
class Window_Base
  #--------------------------------------------------------------------------
  # * Draw Graphic
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #--------------------------------------------------------------------------
  def draw_actor_graphic(actor, x, y, selected = false)
    bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
    cw = bitmap.width / 4
    ch = bitmap.height / 4
    src_rect = Rect.new(0, 0, cw, ch)
    opacity = selected ? 160 : 255
    self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect,opacity)
  end
end
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles the actor. It's used within the Game_Actors class
#  ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================
class Game_Actor
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :position       # position
  attr_accessor :locked         # locked in the reserve
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias party_changer_setup setup
  #--------------------------------------------------------------------------
  # * Setup (actor_id)
  #--------------------------------------------------------------------------
  def setup(actor_id)
    party_changer_setup(actor_id)
    actor = $data_actors[actor_id]
    @position = $data_classes[actor.class_id].position
    @locked = false
  end
end

#==============================================================================
# ** Window_Command
#------------------------------------------------------------------------------
#  This window deals with general command choices.
#==============================================================================
class Window_Command
  #--------------------------------------------------------------------------
  # * Enable Item
  #     index : item number
  #--------------------------------------------------------------------------
  def enable_item(index)
    draw_item(index, normal_color)
  end
end

#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
#  This class handles the party. It includes information on amount of gold
#  and items. Refer to "$game_party" for the instance of this class.
#==============================================================================
class Game_Party
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :members          # members
  attr_accessor :team_members
  attr_accessor :team_location
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias party_changer_initialize initialize
  alias party_changer_refresh refresh
  alias party_changer_add_actor add_actor
  alias party_changer_remove_actor remove_actor
  alias party_changer_setup_starting_members setup_starting_members
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    party_changer_initialize
    @members = []
    @team_members = []
    @team_gold = []
    @team_items = []
    @team_armors = []
    @team_weapons = []
    @team_location = []
  end
  def setup_teams(id, members, location)
    @team_members[id] = members
    if @team_location[id].nil?
      @team_location[id] = []
    end
    @team_location[id][0] = location[0]
    @team_location[id][1] = location[1]
    @team_location[id][2] = location[2]
    @team_location[id][3] = location[3]
  end
  def save_team_data
    team_id = $game_temp.current_team[0]
    @team_members[team_id] = $game_party.actors.dup
    if @team_location[team_id].nil?
      @team_location[team_id] = []
    end
    @team_location[team_id][0] = $game_player.x
    @team_location[team_id][1] = $game_player.y
    @team_location[team_id][2] = $game_map.map_id
    @team_location[team_id][3] = $game_player.direction
  end
  def switch(team_id)
    if $scene.is_a?(Scene_Map)
      $game_party.actors.clear
      for i in 0...@team_members[team_id].size
        $game_party.add_actor(@team_members[team_id].id)
      end
      $game_temp.player_new_x = @team_location[team_id][0]
      $game_temp.player_new_y = @team_location[team_id][1]
      $game_temp.player_new_map_id = @team_location[team_id][2]
      $game_temp.player_new_direction = @team_location[team_id][3]
    end
  end
  #--------------------------------------------------------------------------
  # * Initial Party Setup
  #--------------------------------------------------------------------------
  def setup_starting_members
    party_changer_setup_starting_members
    for i in $data_system.party_members
      actor = $game_actors
      if not @members.include?(actor)
        @members.push(actor)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Refresh Party Members
  #--------------------------------------------------------------------------
  def refresh
    # Actor objects split from $game_actors right after loading game data
    # Avoid this problem by resetting the actors each time data is loaded.
    party_changer_refresh
    new_members = []
    for i in 0...@members.size
      if $data_actors[@members.id] != nil
        new_members.push($game_actors[@members.id])
      end
    end
    @members = new_members
  end
  #--------------------------------------------------------------------------
  # * Add Actor
  #     actor_id : actor ID
  #--------------------------------------------------------------------------
  def add_actor(actor_id)
    party_changer_add_actor(actor_id)
    add_member(actor_id)
  end
  #--------------------------------------------------------------------------
  # * Remove Actor
  #     actor_id : actor ID
  #--------------------------------------------------------------------------
  def remove_actor(actor_id)
    party_changer_remove_actor(actor_id)
    remove_member(actor_id)
  end
  #--------------------------------------------------------------------------
  # * Add a Member
  #     actor_id : actor ID
  #--------------------------------------------------------------------------
  def add_member(actor_id)
    # Get actor
    actor = $game_actors[actor_id]
    # If this actor is not in the party
    if not @members.include?(actor)
      # Add member
      @members.push(actor)
      # Refresh player
      $game_player.refresh
    end
  #--------------------------------------------------------------------------
  # * Determine Every Members are Dead
  #--------------------------------------------------------------------------
  def members_all_dead?
    available_members = []
    for i in 0...@members.size
      next if @members.locked
      available_members << @members
    end
    # If number of party members is 0
    if $game_party.members.size == 0
      return false
    end
    # If an actor is in the party with 0 or more HP
    for member in available_members
      if member.hp > 0
        return false
      end
    end
    # All members dead
    return true
  end
  end
  #--------------------------------------------------------------------------
  # * Remove Member
  #     actor_id : actor ID
  #--------------------------------------------------------------------------
  def remove_member(actor_id)
    # Delete member
    @members.delete($game_actors[actor_id])
    # Refresh player
    $game_player.refresh
  end
end

#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
#  This class is for all in-game windows.
#==============================================================================
class Window_Base < Window
  #--------------------------------------------------------------------------
  # * Draw Actor Position
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #--------------------------------------------------------------------------
  def draw_actor_position(actor, x, y)
    position = actor.position
    case position
    when 0
      text = 'Front'
    when 1
      text = 'Middle'
    when 2
      text = 'Rear'
    end
    cx = contents.text_size(text).width
    self.contents.draw_text(x,y,cx,32,text)
  end
end

#==============================================================================
# ** Window_MemberStatus
#------------------------------------------------------------------------------
#  This window displays a member's status on the party screen.
#==============================================================================
class Window_MemberStatus < Window_Base
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :actor      # actor
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     actor : actor
  #--------------------------------------------------------------------------
  def initialize(actor)
    super(0, 64, 640, 160)
    self.contents = Bitmap.new(width - 32, height - 32)
    if $game_temp.in_battle
      self.back_opacity = 160
    end
    @actor = actor
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh(current = 1, max = 1)
    self.contents.clear
    return if @actor.nil?
    draw_actor_name(@actor, 0, 0)
    draw_actor_class(@actor, 144, 0)
    draw_actor_position(@actor, 300, 0)
    draw_actor_level(@actor, 0, 32)
    draw_actor_state(@actor, 90, 32)
    draw_actor_exp(@actor, 0, 64)
    draw_actor_hp(@actor, 236, 32)
    draw_actor_sp(@actor, 236, 64)
    draw_actor_parameter(@actor, 396, 0, 0)
    draw_actor_parameter(@actor, 396, 32, 1)
    draw_actor_parameter(@actor, 396, 64, 2)
    if $game_temp.selected_members.include?(@actor)
      self.contents.draw_text(0,96,640,32,"- #{@actor.name} is already in the party")
    elsif $game_actors[@actor.id].locked
      self.contents.draw_text(0,96,640,32,"- #{@actor.name} is not available") 
    else
      self.contents.draw_text(0,96,640,32,"- #{@actor.name} is available")
    end
    self.contents.draw_text(480,96,160,32,"Page #{current} of #{max}")
  end
end

#==============================================================================
# ** Window_PartyMembers
#------------------------------------------------------------------------------
#  This window displays the party members on the party screen.
#==============================================================================
class Window_PartyMembers < Window_Selectable
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :members              # members
  attr_accessor :selected_members     # selected members
  attr_accessor :forced_members       # forced members
  #--------------------------------------------------------------------------
  # * Oject Initialization
  #--------------------------------------------------------------------------
  def initialize(forced_members=[])
    @members = $game_party.members
    height = 78 + (@members.size/4) * 50
    super(0,224,640,height)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.active = true
    if $game_temp.in_battle
      self.back_opacity = 160
    end
    @index = 0
    @item_max = @members.size
    @column_max = 4
    @row_max = @members.size / 4
    @selected_members = []
    @forced_members = forced_members
    reset
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...@members.size
      x = (i % 4) * 160
      y = (i/4) * 50
      actor = @members
      selected = @selected_members
      # A1
      opacity = selected == true ? 128 : 255
      if $game_temp.use_custom_graphic
        bitmap = RPG::Cache.picture("Actor_#{actor.name}")
        src_rect = bitmap.rect
        dest_rect = Rect.new(x+2, y+2, 124, 46)
        self.contents.stretch_blt(dest_rect, bitmap, src_rect, opacity)
      else
        draw_actor_graphic($game_actors[actor.id], x+60, y+48, selected)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Reset
  #--------------------------------------------------------------------------
  def reset
    if $game_temp.multiple_teams
      team_id = $game_temp.current_team[0]
      members = $game_temp.current_team[1]
      forced_members = []
      for i in 0...$game_temp.multiple_teams_args.size
        forced_members += $game_temp.multiple_teams_args[2]
      end
      for i in 0...@members.size
        if members.include?(@members)
          @selected_members = false
        end
        if forced_members.include?(@members.id)
          @selected_members = true
        end
        if @members.locked
          @selected_members = false
        end
      end
    else
      for i in 0...@members.size
        @selected_members = false
        if @forced_members.include?(@members)
          @selected_members = true
        end
        if @members.locked
          @selected_members = true
        end
      end
    end
    refresh
  end
  #--------------------------------------------------------------------------
  # * Cursor Rectangle Update
  #--------------------------------------------------------------------------
  def update_cursor_rect
    self.oy = (@index/8) * 100
    x = (@index % 4) * 160
    y = ((@index/4)% 2) * 50
    self.cursor_rect.set(x, y, 128, 50)
  end
end

#==============================================================================
# ** Window_Party
#------------------------------------------------------------------------------
#  This window displays the current party on the party screen.
#==============================================================================
class Window_Party < Window_Selectable
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :item_max             # item max
  attr_accessor :members              # members
  attr_accessor :forced_members       # forces members
  attr_accessor :selected_members     # selected members
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(forced_members=[])
    super(0,352,320,128)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.active = false
    @index = 0
    @column_max = 2
    @row_max = 2
    @members = []
    @forced_members = forced_members
    @selected_members = []
    @item_max = @members.size
    reset_selection
    reset_members
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    height = 128 + ((@members.size-1)/4) * 100
    self.contents = Bitmap.new(width - 32, height - 32)
    self.height = 128
    for i in 0...@members.size
      x = (i % 2) * 160
      y = (i/2) * 50
      actor = @members
      next if actor.nil?
      # A2
      if $game_temp.use_custom_graphic
        opacity = @selected_members == true ? 128 : 255
        bitmap = RPG::Cache.picture("Actor_#{actor.name}")
        src_rect = bitmap.rect
        dest_rect = Rect.new(x+2, y+2, 124, 46)
        self.contents.stretch_blt(dest_rect, bitmap, src_rect, opacity)
      else
        opacity = @selected_members
        draw_actor_graphic($game_actors[actor.id], x+60, y+48,opacity)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Reset Selection
  #--------------------------------------------------------------------------
  def reset_selection
    for i in 0...@members.size
      @selected_members = false
    end
    refresh
  end
  #--------------------------------------------------------------------------
  # * Reset Members
  #--------------------------------------------------------------------------
  def reset_members
    @members = []
    @forced_members.each do |member|
      # NIL M
      #next if member.nil?
      @members << member
    end
    refresh
  end
  #--------------------------------------------------------------------------
  # * Cursor Rectangle Update
  #--------------------------------------------------------------------------
  def update_cursor_rect
    return unless self.active
    self.oy = (@index/4) * 100
    x = (@index % 2) * 160
    y = ((@index/2)% 2) * 50
    self.cursor_rect.set(x, y, 128, 50)
  end
end
#==============================================================================
# ** Window_PartyCommand
#------------------------------------------------------------------------------
#  This window is used to select whether to fight or escape on the battle
#  screen.
#==============================================================================
class Window_PartyCommand < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 640, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.back_opacity = 160
    if $game_temp.party_changer_in_battle
      @commands = ["Fight", "Escape", "Party"]
      @item_max = 3
      @column_max = 3
    else
      @commands = ["Fight", "Escape"]
      @item_max = 2
      @column_max = 2
    end
    # Draw Fight and Escape
    draw_item(0, normal_color)
    draw_item(1, $game_temp.battle_can_escape ? normal_color : disabled_color)
    # Draw Party if $game_temp.party_changer_in_battle is true
    draw_item(2, normal_color) if $game_temp.party_changer_in_battle
    self.active = false
    self.visible = false
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #     index : item number
  #     color : text character color
  #--------------------------------------------------------------------------
  def draw_item(index, color)
    self.contents.font.color = color
    if $game_temp.party_changer_in_battle
      rect = Rect.new(106 + index * 106 + 4, 0, 128 - 10, 32)
    else
      rect = Rect.new(160 + index * 160 + 4, 0, 128 - 10, 32)
    end
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @commands[index], 1)
  end
  #--------------------------------------------------------------------------
  # * Cursor Rectangle Update
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if $game_temp.party_changer_in_battle
      self.cursor_rect.set(106 + index * 106, 0, 128, 32)
    else
      self.cursor_rect.set(160 + index * 160, 0, 128, 32)
    end
  end
end
#==============================================================================
# ** Scene_Battle (part 2)
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================
class Scene_Battle
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias party_changer_update_phase2 update_phase2
  alias party_changer_start_phase5 start_phase5
  alias party_changer_update update
  #--------------------------------------------------------------------------
  # * Determine Battle Win/Loss Results
  #--------------------------------------------------------------------------
  def judge
    # If all dead determinant is true, or number of members in party is 0
    if $game_party.all_dead? or $game_party.actors.size == 0
      if $game_party.members_all_dead?
        # If possible to lose
        if $game_temp.battle_can_lose
          # Return to BGM before battle starts
          $game_system.bgm_play($game_temp.map_bgm)
          # Battle ends
          battle_end(2)
          # Return true
          return false
        end
        # Set game over flag
        $game_temp.gameover = false
        # Return true
        return true
      else
        if $game_temp.party_changer_in_battle
          start_party_changer
          return false
        else
          # Set game over flag
          $game_temp.gameover = true
          # Return true
          return true
        end
      end
    end
    # Return false if even 1 enemy exists
    for enemy in $game_troop.enemies
      if enemy.exist?
        return false
      end
    end
    # Start after battle phase (win)
    start_phase5
    # Return true
    return true
  end
  #--------------------------------------------------------------------------
  # * Frame Update (party command phase)
  #--------------------------------------------------------------------------
  def update_phase2
    party_changer_update_phase2
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Branch by party command window cursor position
      case @party_command_window.index
      when 2  # escape
        # If it's not possible to escape
        if $game_temp.party_changer_in_battle == false
          # Play buzzer SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Escape processing
        start_party_changer
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Start After Battle Phase
  #--------------------------------------------------------------------------
  def start_phase5
    party_changer_start_phase5
    exp = 0
    # Loop
    for enemy in $game_troop.enemies
      # If enemy is not hidden
      unless enemy.hidden
        # Add EXP obtained
        exp += enemy.exp
      end
    end
    # Obtaining EXP
    for i in 0...$game_party.members.size
      return if $game_temp.members_gain_exp == false
      member = $game_party.members
      next if $game_party.actors.include?(member)
      if member.cant_get_exp? == false
        member.exp += (exp/100) * $game_temp.members_exp_rate
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Start Party Changer Phase
  #--------------------------------------------------------------------------
  def start_party_changer
    # Get actor
    @actor = $game_party.members[0]
    @min_actors = $game_temp.battle_party_args[0]
    @max_actors = $game_temp.battle_party_args[1]
    @forced_members = []
    forced_members = $game_temp.battle_party_args[2]
    for i in 0...$game_temp.battle_party_args[2].size
      member = $game_temp.battle_party_args[2]
      if member.nil?
        @forced_members << member
      else
        @forced_members << $game_actors[member]
      end
    end
    @lock_members = $game_temp.battle_party_args[3]
    # Make windows
    @party_status_window = Window_MemberStatus.new(@actor)
    @members_window = Window_PartyMembers.new(@forced_members)
    page_id = ((@members_window.index/8)+1).round
    max_page = (@members_window.members.size.to_f/8.0)
    max_page = 1 if max_page == 0
    @party_status_window.refresh(page_id, max_page.ceil)
    # Defined the height to make the window scroll
    @members_window.height = 128
    @party_window = Window_Party.new(@forced_members)
    @party_command_window2 = Window_Command.new(320,['Reset','Confirm','Arrange'])
    @party_command_window2 .active = false
    @party_command_window2.x = 320
    @party_command_window2.y = 352
    # Hide @status_window contents
    @status_window.hide_battlers = true
    for i in @spriteset.actor_sprites
      i.visible = false
    end
    @members_window.active = true
    @party_command_window.active = false
    @party_command_window.visible = false
    # Shift phase
    @phase = 6
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Original method
    party_changer_update
    case @phase
    when 6
      update_party_changer
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (Party Changer)
  #--------------------------------------------------------------------------
  def update_party_changer
    @party_window.update
    @members_window.update
    @party_command_window2.update
    $game_temp.selected_members = @party_window.members.dup
    if @party_window.members.size == 0
      @party_command_window2.disable_item(1)
      @party_command_window2.disable_item(2)
    else
      @party_command_window2.enable_item(1)
      @party_command_window2.enable_item(2)
    end
    if @party_command_window2.active
      update_party_changer_command
    end
    if @party_window.active
      update_party
    end
    if @members_window.active
      update_members
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (if party changer's command window is active)
  #--------------------------------------------------------------------------
  def update_party_changer_command
    @party_window.cursor_rect.empty
    case @party_command_window2.index
    when 0
      @help_window.set_text('Reset party members')
    when 1
      @help_window.set_text('Confirm party selection')
    when 2
      @help_window.set_text('Arrange party members')
    end
    if Input.trigger?(Input::C)
      case @party_command_window2.index
      when 0
        @members_window.reset
        @party_window.reset_selection
        @party_window.reset_members
        @party_command_window2.active = false
        @members_window.active = true
        $game_temp.selected_members.clear
        @reset = true
        return
      when 1
        if @party_window.members.size < @min_actors
          # Play buzzer SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        $game_party.actors.clear
        @party_window.members.each do |actor|
          $game_party.add_actor(actor.id)
        end
        @members_window.active = false
        @party_command_window2.active = false
        @party_status_window.active = false
        @party_window.active = false
        @members_window.visible = false
        @party_command_window2.visible = false
        @party_status_window.visible = false
        @party_window.visible = false
        @party_command_window.visible = true
        @party_command_window.active = true
        for i in 0...$game_party.actors.size
          @spriteset.actor_sprites.visible = true
        end
        @help_window.visible = false
        @status_window.hide_battlers = false
        @status_window.refresh
        @phase = 2
        return
      when 2
        if @party_window.members.size == 0
          # Play buzzer SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        @party_command_window2.active = false
        @party_window.active = true
        @party_window.index = 0
        @reset = true
        return
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (if party window is active)
  #--------------------------------------------------------------------------
  def update_party
    @party_window.item_max = @party_window.members.size
    if @reset
      @reset = false
      return
    end
    if Input.trigger?(Input::B)
      @party_command_window2.active = true
      @party_window.active = false
      @party_window.index = -3
      @change1 = nil
      @change2 = nil
      @party_window.reset_selection
      return
    end
    @help_window.set_text('Change members position')
    if @party_status_window.actor != @party_window.members[@party_window.index]
      @party_status_window.actor = @party_window.members[@party_window.index]
      @party_status_window.refresh
    end
    if Input.trigger?(Input::C) and @change1 == nil
      @temp_change1 = @party_window.members[@party_window.index]
      if @lock_members.include?(@temp_change1.id)# and @party_window.index == 0
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      @change1 = @party_window.members[@party_window.index]
      @old_index = @party_window.index
      @party_window.selected_members[@party_window.index] = true
      @party_window.refresh
    elsif Input.trigger?(Input::C) and @change1 != nil
      @temp_change2 = @party_window.members[@party_window.index]
      if @lock_members.include?(@temp_change2.id)# and @party_window.index == 0
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      @change2 = @party_window.members[@party_window.index]
      @party_window.members[@party_window.index] = @change1
      @party_window.members[@old_index] = @change2
      @change1 = nil
      @change2 = nil
      @party_window.reset_selection
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (party members)
  #--------------------------------------------------------------------------
  def update_members
    @party_window.cursor_rect.empty
    if @reset
      @reset = false
      return
    end
    @help_window.set_text('Form your party')
    if @party_status_window.actor != @members_window.members[@members_window.index]
      @party_status_window.actor = @members_window.members[@members_window.index]
      page_id = ((@members_window.index/8)+1).round
      max_page = (@members_window.members.size.to_f/8.0)
      max_page = 1 if max_page == 0
      @party_status_window.refresh(page_id, max_page.ceil)
    end
    if @party_window.members.size == @max_actors
      @party_command_window2.active = true
      @members_window.active = false
      return
    end
    if Input.trigger?(Input::B)
      @party_command_window2.active = true
      @members_window.active = false
      return
    end
    if Input.trigger?(Input::C)
      return if @members_window.members[@members_window.index].locked
      if @party_window.members.size < @max_actors and
          not @party_window.members.include?(@members_window.members[@members_window.index])
        for i in 0...@max_actors
          actor = @members_window.members[@members_window.index]
          next if @party_window.members != nil
          next if @party_window.members.include?(actor)
          @members_window.selected_members[@members_window.index] = true
          @members_window.refresh
          @status_window.refresh
          @party_window.members = actor
          @party_window.refresh
        end
        return
      end
    end
  end
end
#==============================================================================
# ** Window_BattleStatus
#------------------------------------------------------------------------------
#  This window displays the status of all party members on the battle screen.
#==============================================================================
class Window_BattleStatus < Window_Base
  attr_accessor :hide_battlers
  alias hide_battlers_initialize initialize
  def initialize
    @hide_battlers = false
    hide_battlers_initialize
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    if @hide_battlers
      self.contents_opacity = 0
      return
    else
      self.contents_opacity = 255
    end
    # Slightly lower opacity level during main phase
    if $game_temp.battle_main_phase
      self.contents_opacity -= 4 if self.contents_opacity > 191
    else
      self.contents_opacity += 4 if self.contents_opacity < 255
    end
  end
end

#==============================================================================
# ** Spriteset_Battle
#------------------------------------------------------------------------------
#  This class brings together battle screen sprites. It's used within
#  the Scene_Battle class.
#==============================================================================
class Spriteset_Battle
  attr_accessor :actor_sprites
end

#==============================================================================
# ** Scene_Party
#------------------------------------------------------------------------------
#  This class performs party menu screen processing.
#==============================================================================
class Scene_Party
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     actor_index    : command cursor's initial position
  #     forced_members : members forced to be in the party
  #--------------------------------------------------------------------------
  def initialize(min_actors = 1, max_actors = 4, forced_members = [], lock_members = [], from_menu=false)
    @min_actors = []
    @max_actors = []
    @forced_members = []
    @lock_members = []
    @from_menu = from_menu
    if $game_temp.multiple_teams and not @from_menu
      for i in 0...$game_temp.multiple_teams_args.size
        @forced_members = []
        @min_actors = $game_temp.multiple_teams_args[0]
        @max_actors = $game_temp.multiple_teams_args[1]
        forced_members = $game_temp.multiple_teams_args[2]
        @lock_members = $game_temp.multiple_teams_args[3]
        forced_members.each do |member|
          if member.nil?
            @forced_members << member
          else
            $game_party.add_member(member)
            @forced_members << $game_actors[member]
          end
        end
      end
    else
      @min_actors[0] = min_actors
      @max_actors[0] = max_actors
      @forced_members[0] = []
      @lock_members[0] = lock_members
      forced_members.each do |member|
        if member.nil?
          @forced_members[0] << member
        else
          $game_party.add_member(member)
          @forced_members[0] << $game_actors[member]
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Get actor
    @actor = $game_party.members[0]
    # Make help window, status window, and skill window
    @help_window = Window_Help.new
    @status_window = Window_MemberStatus.new(@actor)
    @members_window = Window_PartyMembers.new(@forced_members[0])
    page_id = ((@members_window.index/8)+1).round
    max_page = (@members_window.members.size.to_f/8.0)
    max_page = 1 if max_page == 0
    @status_window.refresh(page_id, max_page.ceil)
   
    teams = []
    for i in 0...$game_temp.multiple_teams_args.size
      teams << "Team #{i+1}"
    end
   
    # Defined the height to make the window scroll
    @members_window.height = 128
   
    @team_windows = []
    @team_windows << Window_Party.new(@forced_members[0])
    if $game_temp.multiple_teams and not @from_menu
      for i in 1...$game_temp.multiple_teams_args.size
        @team_windows << Window_Party.new(@forced_members)
        @team_windows.visible = false
      end
    end
   
    commands = ['Reset','Confirm','Arrange']
    commands << 'Change Team' if $game_temp.multiple_teams and not @from_menu
    @command_window = Window_Command.new(320,commands)
    @command_window.x = 320
    @command_window.y = 352
    @command_window.height = 3 * 32 + 32
    @command_window.active = false
    @reset = false
   
    teams = [''] if teams.empty?
    @team_selection_window = Window_Command.new(160, teams)
    @team_selection_window.x = 480
    @team_selection_window.height = 64
    @team_selection_window.active = false
    @team_selection_window.visible = $game_temp.multiple_teams
   
    # 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
    @status_window.dispose
    @members_window.dispose
    @command_window.dispose
    @team_selection_window.dispose
    for window in @team_windows
      window.dispose
    end
  end
  def active_team_window
    return @team_windows[team_index]
  end
  def team_index
    return @team_selection_window.index
  end
  def confirmation_enabled?
    i = 0
    for team_window in @team_windows
      temp_members = team_window.members.dup
      temp_members.delete(nil)
      if temp_members.size < @min_actors
        return false
      end
      if temp_members[0].nil?
        return false
      end
      if temp_members.empty?
        return false
      else
        i += 1
        next
      end
      return true
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    @party_window = active_team_window
    @members_window.update
    @command_window.update
    @team_selection_window.update
    for i in 0...@team_windows.size
      @team_windows.update
      @team_windows.visible = false
      if i == team_index
        @team_windows.visible = true
      end
    end
    $game_temp.current_team = [team_index, active_team_window.members]
    $game_temp.selected_members = []
    for team_window in @team_windows
      $game_temp.selected_members += team_window.members.dup
    end
    if $game_temp.multiple_teams and not @from_menu
      if confirmation_enabled?
        @command_window.enable_item(1)
      else
        @command_window.disable_item(1)
      end
    else
      if @party_window.members.size == 0
        @command_window.disable_item(1)
        @command_window.disable_item(2)
      else
        @command_window.enable_item(1)
        @command_window.enable_item(2)
      end
    end
    if @team_selection_window.active
      update_teams
      return
    end
    if @command_window.active
      update_command
      return
    end
    if @party_window.active
      update_party
      return
    end
    if @members_window.active
      update_members
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (if command team is active)
  #--------------------------------------------------------------------------
  def update_teams
    @help_window.set_text('Choose a team.')
    if Input.trigger?(Input::C)
      @team_selection_window.active = false
      @members_window.active = true
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (if command window is active)
  #--------------------------------------------------------------------------
  def update_command
    @party_window.cursor_rect.empty
    case @command_window.index
    when 0
      @help_window.set_text('Reset party members')
    when 1
      @help_window.set_text('Confirm party selection')
    when 2
      @help_window.set_text('Arrange party members')
    when 3
      @help_window.set_text('Choose an other team.')
    end
    if Input.trigger?(Input::C)
      case @command_window.index
      when 0
        @members_window.reset
        @party_window.reset_selection
        @party_window.reset_members
        @command_window.active = false
        @members_window.active = true
        $game_temp.selected_members.clear
        @reset = true
        return
      when 1
        if @party_window.members.size < @min_actors[team_index]
  &amp
 
I include the 'spoiler' word in the beginning, right?

Stupid question, but wasn't sure whether or not it was saying the text was a spoiler or if that was in the script.

And so far I have what I sent you in a message, plus Party Changer below commands manager and above main.

If yes to both, I'm all set for the next step.
 

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