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.

[VX] Large Party

Large Party
by Dargor
Version 1.7


Introduction

My version of Large Party. You all know what it does! There's a little feature that let you scroll up/down the status window's contents in battle. Simply press L/R (PageUp/PageDown) when the party commands window is active. You can also add extra battle test members.

Enjoy!

Script

[rgss]#==============================================================================
# ** Large Party
#------------------------------------------------------------------------------
#  © Dargor, 2008-2009
#  28/0//09
#  Version 1.7
#------------------------------------------------------------------------------
#  VERSION HISTORY:
#   - 1.0 (08/03/08), Initial release
#   - 1.1 (15/03/08), Added party arrange support
#   - 1.2 (15/03/08), Battle Status bug fixed with Party Changer
#   - 1.3 (11/05/08), Bug fixed with the add_actor method
#   - 1.4 (13/06/08), Configuration Module added
#   - 1.5 (13/06/08), Support added for extra battle test members
#   - 1.6 (04/07/08), Improved compatibility with Multiple Parties
#   - 1.7 (28/01/09), Fixed a bug with "max_members"
#------------------------------------------------------------------------------
#  INSTRUCTIONS:
#     1)  To change the maximum # of actors allowed in the party, use:
#           - $game_party.max_members = x
#==============================================================================
 
#==============================================================================
# ** Large Party Customization Module
#==============================================================================
 
module Large_Party
  # Maximum number of party members at the begining of the game
  Initial_Max_Members = 4
  # Maximum number of party members possible to have
  # NOTE: Should be higher than Initial_Max_Members
  Max_Members = 8
  # Extra actors (ID) for Battle Test
  BTEST_Extra_Actors = []
end
 
#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
#  This class handles the party. It includes information on amount of gold
# and items. The instance of this class is referenced by $game_party.
#==============================================================================
 
class Game_Party < Game_Unit
  # Constants
  MAX_MEMBERS = Large_Party::Max_Members    
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :max_members                # Maximum number of party members
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias dargor_vx_large_party_initialize initialize
  alias dargor_vx_large_party_add_actor add_actor
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    dargor_vx_large_party_initialize
    @max_members = Large_Party::Initial_Max_Members # Maximum number of party members
  end
  #--------------------------------------------------------------------------
  # * Add an Actor
  #     actor_id : actor ID
  #--------------------------------------------------------------------------
  def add_actor(actor_id)
    if self.methods.include?('add_reserve_actor')
      add_reserve_actor(actor_id)
    end
    if $game_parties != nil
      $game_parties.add_actor(actor_id)
      $game_parties.add_reserve_actor(actor_id)
    end
    if @actors.size < @max_members
      dargor_vx_large_party_add_actor(actor_id)
    end
  end
  #--------------------------------------------------------------------------
  # * Battle Test Party Setup
  #--------------------------------------------------------------------------
  def setup_battle_test_members
    @actors = []
    for actor_id in Large_Party::BTEST_Extra_Actors
      battler = RPG::System::TestBattler.new
      battler.actor_id = actor_id
      $data_system.test_battlers << battler
    end
    for battler in $data_system.test_battlers
      actor = $game_actors[battler.actor_id]
      actor.change_level(battler.level, false)
      actor.change_equip_by_id(0, battler.weapon_id, true)
      actor.change_equip_by_id(1, battler.armor1_id, true)
      actor.change_equip_by_id(2, battler.armor2_id, true)
      actor.change_equip_by_id(3, battler.armor3_id, true)
      actor.change_equip_by_id(4, battler.armor4_id, true)
      actor.recover_all
      @actors.push(actor.id)
    end
    @items = {}
    for i in 1...$data_items.size
      if $data_items.battle_ok?
        @items = 99 unless $data_items.name.empty?
      end
    end
  end
end
 
#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
#  This window displays party member status on the menu screen.
#==============================================================================
 
class Window_MenuStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias dargor_large_party_initialize initialize
  alias dargor_large_party_update_cursor update_cursor
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(x, y)
    @selection_rect = false
    @selection_y = 0
    dargor_large_party_initialize(x, y)
    height = 416
    extra_height = (96 * ($game_party.members.size-4))
    if $game_party.members.size > 0
      height += extra_height
    end
    self.contents = Bitmap.new(width - 32, height - 32)
    self.height = 416
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    if @selection_rect
      color = Color.new(0,0,0,160)
      self.contents.fill_rect(2, @selection_y, contents.width-4, 92, color)
    end
    @item_max = $game_party.members.size
    for actor in $game_party.members
      draw_actor_face(actor, 2, actor.index * 96 + 2, 92)
      x = 104
      y = actor.index * 96 + WLH / 2
      draw_actor_name(actor, x, y)
      draw_actor_class(actor, x + 120, y)
      draw_actor_level(actor, x, y + WLH * 1)
      draw_actor_state(actor, x, y + WLH * 2)
      draw_actor_hp(actor, x + 120, y + WLH * 1)
      draw_actor_mp(actor, x + 120, y + WLH * 2)
    end
  end
  #--------------------------------------------------------------------------
  # * Set Selection Rect
  #--------------------------------------------------------------------------
  def set_selection_rect(index)
    @selection_rect = true
    @selection_y = index * 96 - WLH / 2 + 14
    refresh
  end
  #--------------------------------------------------------------------------
  # * Clear Selection Rect
  #--------------------------------------------------------------------------
  def clear_selection_rect
    @selection_rect = false
    refresh
  end
  #--------------------------------------------------------------------------
  # * Update cursor
  #--------------------------------------------------------------------------  
  def update_cursor
    #dargor_large_party_update_cursor
    if @index < 0
      self.cursor_rect.empty
      return
    end
    # Get top row
    row = @index  / @column_max
    if row < self.top_row
      self.top_row = row
    end
    # Reset Top Row if at bottom of list
    if row > self.top_row + (self.page_row_max - 1)
      self.top_row = row - (self.page_row_max - 1)
    end
    y = @index / @column_max * 96 - self.oy
    # Draw the cursor
    self.cursor_rect.set(0, y, contents.width, 96)
  end
  #--------------------------------------------------------------------------
  # * Get Top Row
  #--------------------------------------------------------------------------  
  def top_row
    return self.oy / 96
  end
  #--------------------------------------------------------------------------
  # * Set Top Row
  #     row : row shown on top
  #--------------------------------------------------------------------------  
  def top_row=(row)
    if row < 0
      row = 0
    end
    if row > row_max - 1
      row = row_max - 1
    end
    self.oy = row * 96
  end
  #--------------------------------------------------------------------------
  # * Get Number of Rows Displayable on 1 Page
  #--------------------------------------------------------------------------  
  def page_row_max
    return 4
  end
end
 
#==============================================================================
# ** Window_BattleStatus
#------------------------------------------------------------------------------
#  This window displays the status of all party members on the battle screen.
#==============================================================================
 
class Window_BattleStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias dargor_large_party_initialize initialize
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    dargor_large_party_initialize
    height = 128 + (24 * ($game_party.members.size-4))
    self.contents = Bitmap.new(width - 32, height - 32)
    self.height = 128
    refresh
  end
  #--------------------------------------------------------------------------
  # * Update cursor
  #--------------------------------------------------------------------------  
  def update_cursor
    if @index < 0
      self.cursor_rect.empty
      return
    end
    # Get top row
    row = @index  / @column_max
    if row < self.top_row
      self.top_row = row
    end
    # Reset Top Row if at bottom of list
    if row > self.top_row + (self.page_row_max - 1)
      self.top_row = row - (self.page_row_max - 1)
    end
    y = @index / @column_max * 24 - self.oy
    # Draw the cursor
    self.cursor_rect.set(0, y, contents.width, 24)
  end
  #--------------------------------------------------------------------------
  # * Get Top Row
  #--------------------------------------------------------------------------  
  def top_row
    return self.oy / 24
  end
  #--------------------------------------------------------------------------
  # * Set Top Row
  #     row : row shown on top
  #--------------------------------------------------------------------------  
  def top_row=(row)
    if row < 0
      row = 0
    end
    if row > row_max - 1
      row = row_max - 1
    end
    self.oy = row * 24
  end
  #--------------------------------------------------------------------------
  # * Get Number of Rows Displayable on 1 Page
  #--------------------------------------------------------------------------  
  def page_row_max
    return 4
  end
end
 
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================
 
class Scene_Battle
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias dargor_large_party_update_party_command_selection update_party_command_selection
  #--------------------------------------------------------------------------
  # * Update Party Command Selection
  #--------------------------------------------------------------------------
  def update_party_command_selection
    if Input.trigger?(Input::L)
      @status_window.oy = [@status_window.oy -= 24, 0].max
    end
    if Input.trigger?(Input::R)
      @status_window.oy = [@status_window.oy += 24, ($game_party.members.size-4) * 24].min
    end
    dargor_large_party_update_party_command_selection
  end
end
[/rgss]

Notes

I changed a bit the way to customize the party size. Instead of using the MAX_MEMBERS constant in Game_Party, you should use $game_party.max_members = value
Don't forget to give me credit!

-Dargor
 
Awesome!  You make some very good scripts.  I've just got a few questions.

1. Does it matter where it's placed in the Materials section?  I have a few scripts already there, and I want to make sure it doesn't clash with them.

2. Does the battle window scroll down automatically when it's the character's turn?

Thanks for all the help! :thumb:

~Guardian1239
 
Thanks!

1. It depends on which script you are using but I would place it  just bellow Materials and above every other scripts since it rewrites the Window_MenuStatus' Refresh method.

2.Yes it does!
 
Um.. I'm confused, this script doesn't seem to work at all for me. I've tried it with the game I'm working on (Using Scripts such as Tankentai SBS and some of your other scripts) and I've tried it in a new game alone. But when I use the event command "Change Party Member..." to add a member (when having 4 members in the party), the new member neither shows up in the menu or in battle. I've tried pressing each key on my keyboard, including page up and down, and nothing.

Is there something I'm doing wrong? Do I need to use a call script? I have your Custom Command script thrown in there with this as well, in both attempts, and still nothing.

Thanks in Advance.
~Inno
 
Correct me if I'm wrong, but I think Tankentai's CBS alters some methods of Game_Party. Try to put the script below the CBS.
If it does not work, I'll take a look at the CBS and fix the bug.
 
I have a problem with the script. I use the Tankentai Side View Battle System, and I can't have more than 5 people. I have in your large party script AND that script set to 6 people, but when I try to add a 6th, it won't work. 5 works perfectly, but 6 isn't working.
 
My script is not compatible with Tankentai CBS. However, I know there's an option in his CBS that let you choose the max members in battle.
 
It's because you can't setup more than 4 actors for the battle test. However, I can add a feature that would let you have more than 4 party members in battle test. It would require to change a variable in the script editor each time you test a battle though.
 
That'd be testing two scripts at once... and since I'd need to make a lot more of my game to test it normally in it... might as well.
 
wait, the error is in the large party script and not in the party changer!?!?!?
Now I understand. It's this line, right?
Code:
self.contents = Bitmap.new(width - 32, height - 32)
Hmm? Looks like this script is outdated... I thought I have updated it not long ago 0.o
Try downloading the demo of the Party changer. In there you'll find the new version of the large party script.
 

yion

Member

Dargor":bxr487yr said:
wait, the error is in the large party script and not in the party changer!?!?!?
Now I understand. It's this line, right?
Code:
self.contents = Bitmap.new(width - 32, height - 32)
Hmm? Looks like this script is outdated... I thought I have updated it not long ago 0.o
Try downloading the demo of the Party changer. In there you'll find the new version of the large party script.

WAAAAH!
ok...could you update the Scripts in the spoilers so my fellow won't have the outdated scripts
who dont download the Demo? Dx

EDIT:
For some wierd reason the Menu pops up after the Audio Menu and
even though i switched the Map Party changer to False you can
change your party...if you DO so the game gives Error in line 1117 or sthing

EDIT2:
Ok the Problem with the Open-Menu is definately the fault of the audio script...
its because its ment to be an Item, so if you initialize it, it will open the menu after.
But why didnt it Initialize the party - thingy? hmm...can you still help me?
 

yion

Member

Just in case you didnt noticed, i will bump my question with this reply:
You get an Error when you choose partymembers and there is no one in the Party.
its when you try to select "no one", dont remember the line but it was sthing with
"play se cancel / buzzer" one of the sounds lol.
 

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