Large Party
by Dargor
Version 1.7
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
- #==============================================================================
- # ** 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[i].battle_ok?
- @items[i] = 99 unless $data_items[i].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
Expand to see the code.
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