[VX] Multiple Parties

Multiple Parties
by Dargor
Version 1.1


Introduction

This script let you have as many parties as you want. Parties have their own inventory, gold, steps, members, etc. It can be used to make special dungeons that requires more parties like in Final Fantasy 6. Also, this script is independent from the Custom Commands and Party Changer scripts. However, this script will gain features when used with the latest version of my Party Changer (version 3.1).

Features
  • You can have as many parties as you want
  • Parties have their own inventory, gold, steps, members, etc.
  • You can cycle through all available parties
  • Compatible with my Party Changer version 3.1

Script

Script Show
  1. #==============================================================================
  2. # ** Multiple Parties
  3. #------------------------------------------------------------------------------
  4. #    © Dargor, 2008
  5. #   05/07/08
  6. #   Version 1.1
  7. #------------------------------------------------------------------------------
  8. #   VERSION HISTORY:
  9. #    - 1.0 (04/07/08), Initial release
  10. #    - 1.1 (05/07/08), Added compatibility with Advanced Title Screen
  11. #------------------------------------------------------------------------------
  12. #   INTRODUCTION:
  13. #       This script let you have as many parties as you want.
  14. #       Parties have their own iventory, gold, steps, members, etc.
  15. #       It can be used to make special dungeons that requires more parties
  16. #       like in Final Fantasy 6.
  17. #
  18. #       You can cycle through parties bu using the Next_Party_Key and
  19. #       Prior_Party_Key variables located in the Multiple_Parties
  20. #       configuration module.
  21. #
  22. #       A new class, Game_Parties, now handles the party objects.
  23. #       By default, the main party is located at index 0 of $game_parties.
  24. #       It is not possible to delete or modify the main party through this
  25. #       class.
  26. #------------------------------------------------------------------------------
  27. #   INSTRUCTIONS:
  28. #       1) Place this script ABOVE Main and BELLOW Materials
  29. #
  30. #       2) To start a multiple party phase, use the following line of code:
  31. #               - $game_system.multiple_parties = true
  32. #
  33. #       3) To create new parties, use the following line of code:
  34. #               - $game_parties.create_parties(MAX, DELETE?)
  35. #               where MAX is the maximum number of parties to create
  36. #               and DELETE? is the true/false flag of wether the script
  37. #               delete the last parties or not.
  38. #
  39. #       4) To clear extra parties, use the following line of code:
  40. #               - $game_parties.clear_parties
  41. #
  42. #       5) To call the multiple party changer screen, use the
  43. #            following line of code:
  44. #               - $scene = Scene_Parties.new
  45. #
  46. #       6) To change the location of a party, use the following line
  47. #            of code:
  48. #               - $game_parties[PARTY_ID].set_new_position(MAP_ID, X, Y, DIR)
  49. #               where PARTY_ID is the id/index of the party
  50. #               MAP_ID is the id of the map in which the party is
  51. #               X is the x location on the map
  52. #               Y is the y location on the map
  53. #               DIR is the direction of the party
  54. #                   (2: Down, 4: Left, 6: Right, 8: Up)
  55. #------------------------------------------------------------------------------
  56. #   NOTES:
  57. #       - This script does not requires the Custom Commands script and
  58. #          is not dependent over my Party Changer script.
  59. #    
  60. #       - When used with the my Party Changer script version 3.1 or higher,
  61. #          You can use it to form your parties.
  62. #==============================================================================
  63.  
  64. # Vocabulary
  65. Vocab::FormParties = 'Form %s group%s.'
  66. Vocab::PartiesConfirm = 'Confirm'
  67. Vocab::PartiesReset = 'Reset'
  68. Vocab::Parties = 'Party %s'
  69.  
  70. #==============================================================================
  71. # ** Large Party Configuration Module
  72. #==============================================================================
  73.  
  74. module Multiple_Parties
  75.   Next_Party_Key = Input::F5
  76.   Prior_Party_Key = Input::F6
  77. end
  78.  
  79. #==============================================================================
  80. # ** Game_Parties
  81. #------------------------------------------------------------------------------
  82. #   This class handles the party array. The instance of this class is
  83. # referenced by $game_parties.
  84. #==============================================================================
  85.  
  86. class Game_Parties
  87.   #--------------------------------------------------------------------------
  88.   # * Public Instance Variables
  89.   #--------------------------------------------------------------------------
  90.   attr_reader :data
  91.   attr_accessor :temp_actors
  92.   #--------------------------------------------------------------------------
  93.   # * Object Initialization
  94.   #--------------------------------------------------------------------------
  95.   def initialize
  96.      @data = [$game_party]
  97.      @actors = []
  98.      @reserve_actors = []
  99.      @temp_actors = []
  100.   end
  101.   #--------------------------------------------------------------------------
  102.   # * Get Party
  103.   #--------------------------------------------------------------------------
  104.   def [](party_id)
  105.      @data[party_id] = Game_Party.new if @data[party_id].nil?
  106.      return @data[party_id]
  107.   end
  108.   #--------------------------------------------------------------------------
  109.   # * Set Party
  110.   #--------------------------------------------------------------------------
  111.   def []=(party_id, party)
  112.      return if party_id == 0
  113.      @data[party_id] = party
  114.   end
  115.   #--------------------------------------------------------------------------
  116.   # * Set Party
  117.   #--------------------------------------------------------------------------
  118.   def size
  119.      return @data.size
  120.   end
  121.   #--------------------------------------------------------------------------
  122.   # * Delete
  123.   #--------------------------------------------------------------------------
  124.   def delete(party_id)
  125.      return if party_id == 0
  126.      @data.delete(@data[party_id])
  127.      @data.compact!
  128.   end
  129.   #--------------------------------------------------------------------------
  130.   # * Create Parties
  131.   #--------------------------------------------------------------------------
  132.   def create_parties(max, delete=true)
  133.      for i in 1..max
  134.         if delete
  135.            @data[i] = Game_Party.new
  136.         end
  137.      end
  138.   end
  139.   #--------------------------------------------------------------------------
  140.   # * Clear Parties
  141.   #--------------------------------------------------------------------------
  142.   def clear_parties
  143.      for party in @data
  144.         next if @data.index(party) == 0
  145.         @data.delete(party)
  146.      end
  147.   end
  148.   #--------------------------------------------------------------------------
  149.   # * Next Party
  150.   #--------------------------------------------------------------------------
  151.   def next_party
  152.      return if @data.size <= 1
  153.      $game_party.set_position
  154.      new_index = $game_party.index
  155.      # Find the next party
  156.      loop do
  157.         new_index = (new_index - 1) % @data.size
  158.         break if @data[new_index] != nil
  159.      end
  160.      new_party = @data[new_index]
  161.      # Update party location & Graphics
  162.      map_id = new_party.map_id
  163.      map_x = new_party.map_x
  164.      map_y = new_party.map_y
  165.      direction = new_party.direction
  166.      $game_party = new_party
  167.      $game_player.reserve_transfer(map_id, map_x, map_y, direction)
  168.   end
  169.   #--------------------------------------------------------------------------
  170.   # * Prior Party
  171.   #--------------------------------------------------------------------------
  172.   def prior_party
  173.      return if @data.size <= 1
  174.      $game_party.set_position
  175.      new_index = $game_party.index
  176.      # Find the previous party
  177.      loop do
  178.         new_index = (new_index + 1)
  179.         new_index %= @data.size
  180.         break if @data[new_index] != nil
  181.      end
  182.      new_party = @data[new_index]
  183.      # Update party location & Graphics
  184.      map_id = new_party.map_id
  185.      map_x = new_party.map_x
  186.      map_y = new_party.map_y
  187.      direction = new_party.direction
  188.      $game_party = new_party
  189.      $game_player.reserve_transfer(map_id, map_x, map_y, direction)
  190.   end
  191.   #--------------------------------------------------------------------------
  192.   # * Add Actor
  193.   #--------------------------------------------------------------------------
  194.   def add_actor(actor_id)
  195.      add_reserve_actor(actor_id)
  196.      return if @actors.include?(actor_id)
  197.      @actors << actor_id
  198.      @actors.sort
  199.   end
  200.   #--------------------------------------------------------------------------
  201.   # * Remove Actor
  202.   #--------------------------------------------------------------------------
  203.   def remove_actor(actor_id)
  204.      @actors.delete(actor_id)
  205.      @actors.sort
  206.   end
  207.   #--------------------------------------------------------------------------
  208.   # * Get Members
  209.   #--------------------------------------------------------------------------
  210.   def members
  211.      result = []
  212.      for actor_id in @actors
  213.         result << $game_actors[actor_id]
  214.      end
  215.      return result.uniq
  216.   end
  217.   #--------------------------------------------------------------------------
  218.   # * Add Reserve Actor
  219.   #--------------------------------------------------------------------------
  220.   def add_reserve_actor(actor_id)
  221.      return if @reserve_actors.include?(actor_id)
  222.      @reserve_actors << actor_id
  223.      @reserve_actors.sort
  224.   end
  225.   #--------------------------------------------------------------------------
  226.   # * Remove Reserve Actor
  227.   #--------------------------------------------------------------------------
  228.   def remove_reserve_actor(actor_id)
  229.      @reserve_actors.delete(actor_id)
  230.      @reserve_actors.sort
  231.   end
  232.   #--------------------------------------------------------------------------
  233.   # * Get Reserve Members
  234.   #--------------------------------------------------------------------------
  235.   def reserve_members
  236.      result = []
  237.      for actor_id in @reserve_actors
  238.         result << $game_actors[actor_id]
  239.      end
  240.      return result.uniq
  241.   end
  242.   #--------------------------------------------------------------------------
  243.   # * Get All Members
  244.   #--------------------------------------------------------------------------
  245.   def all_members
  246.      all_actors = (@actors + @reserve_actors).sort
  247.      result = []
  248.      for i in all_actors
  249.         result << $game_actors[i]
  250.      end
  251.      return result.uniq
  252.   end
  253.   #--------------------------------------------------------------------------
  254.   # * Clear Temporary Actors Array
  255.   #--------------------------------------------------------------------------
  256.   def clear_temp_actors
  257.      @temp_actors = []
  258.   end
  259. end
  260.  
  261. #==============================================================================
  262. # ** Game_System
  263. #------------------------------------------------------------------------------
  264. #   This class handles system-related data. Also manages vehicles and BGM, etc.
  265. # The instance of this class is referenced by $game_system.
  266. #==============================================================================
  267.  
  268. class Game_System
  269.   #--------------------------------------------------------------------------
  270.   # * Public Instance Variables
  271.   #--------------------------------------------------------------------------
  272.   attr_accessor :multiple_parties
  273.   #--------------------------------------------------------------------------
  274.   # * Alias Listing
  275.   #--------------------------------------------------------------------------
  276.   alias dargor_vx_multiple_parties_system_initialize initialize
  277.   #--------------------------------------------------------------------------
  278.   # * Object Initialization
  279.   #--------------------------------------------------------------------------
  280.   def initialize
  281.      dargor_vx_multiple_parties_system_initialize
  282.      @multiple_parties = false
  283.   end
  284. end
  285.  
  286. #==============================================================================
  287. # ** Game_Player
  288. #------------------------------------------------------------------------------
  289. #   This class handles maps. It includes event starting determinants and map
  290. # scrolling functions. The instance of this class is referenced by $game_map.
  291. #==============================================================================
  292.  
  293. class Game_Player < Game_Character
  294.   #--------------------------------------------------------------------------
  295.   # * Public Instance Variables
  296.   #--------------------------------------------------------------------------
  297.   attr_accessor :direction
  298. end
  299.  
  300. #==============================================================================
  301. # ** Game_Party
  302. #------------------------------------------------------------------------------
  303. #   This class handles the party. It includes information on amount of gold
  304. # and items. The instance of this class is referenced by $game_party.
  305. #==============================================================================
  306.  
  307. class Game_Party
  308.   #--------------------------------------------------------------------------
  309.   # * Public Instance Variables
  310.   #--------------------------------------------------------------------------
  311.   attr_reader :map_id
  312.   attr_reader :map_x
  313.   attr_reader :map_y
  314.   attr_reader :direction
  315.   #--------------------------------------------------------------------------
  316.   # * Alias Listing
  317.   #--------------------------------------------------------------------------
  318.   alias dargor_vx_multiple_parties_party_initialize initialize
  319.   #--------------------------------------------------------------------------
  320.   # * Object Initialization
  321.   #--------------------------------------------------------------------------
  322.   def initialize
  323.      @map_id = 23
  324.      @map_x = 1
  325.      @map_y = 1
  326.      @direction = 2
  327.      dargor_vx_multiple_parties_party_initialize
  328.   end
  329.   #--------------------------------------------------------------------------
  330.   # * Index
  331.   #--------------------------------------------------------------------------
  332.   def index
  333.      return $game_parties.data.index(self)
  334.   end
  335.   #--------------------------------------------------------------------------
  336.   # * Set Position
  337.   #--------------------------------------------------------------------------
  338.   def set_position
  339.      @map_id = $game_map.map_id
  340.      @map_x = $game_player.x
  341.      @map_y = $game_player.y
  342.      @direction = $game_player.direction
  343.   end
  344.   #--------------------------------------------------------------------------
  345.   # * Set New Position
  346.   #--------------------------------------------------------------------------
  347.   def set_new_position(map_id, x, y, direction)
  348.      @map_id = map_id
  349.      @map_x = x
  350.      @map_y = y
  351.      @direction = direction
  352.   end
  353. end
  354.  
  355. #==============================================================================
  356. # ** Spriteset_Map
  357. #------------------------------------------------------------------------------
  358. #   This class brings together map screen sprites, tilemaps, etc. It's used
  359. # within the Scene_Map class.
  360. #==============================================================================
  361.  
  362. class Spriteset_Map
  363.   #--------------------------------------------------------------------------
  364.   # * Alias Listing
  365.   #--------------------------------------------------------------------------
  366.   alias dargor_vx_multiple_parties_spriteset_map_create_characters create_characters
  367.   #--------------------------------------------------------------------------
  368.   # * Create Character Sprite
  369.   #--------------------------------------------------------------------------
  370.   def create_characters
  371.      dargor_vx_multiple_parties_spriteset_map_create_characters
  372.      for party in $game_parties.data
  373.         next if $game_party == party
  374.         if party.map_id == $game_map.map_id
  375.            member = party.members[0]
  376.            unless member.nil?
  377.               character = Game_Character.new
  378.               character.moveto(party.map_x, party.map_y)
  379.               character.set_direction(party.direction)
  380.               character.set_graphic(member.character_name, member.character_index)
  381.               @character_sprites.push(Sprite_Character.new(@viewport1, character))
  382.            end
  383.         end
  384.      end
  385.   end
  386. end
  387.  
  388. #==============================================================================
  389. # ** Game_Character
  390. #------------------------------------------------------------------------------
  391. #   This class deals with characters. It's used as a superclass of the
  392. # Game_Player and Game_Event classes.
  393. #==============================================================================
  394.  
  395. class Game_Character
  396.   #--------------------------------------------------------------------------
  397.   # * Alias Listing
  398.   #--------------------------------------------------------------------------
  399.   alias dargor_multiple_parties_character_collide_with_characters? collide_with_characters?
  400.   #--------------------------------------------------------------------------
  401.   # * Determine Character Collision
  402.   #       x : x-coordinate
  403.   #       y : y-coordinate
  404.   #      Detects normal character collision, including the player and vehicles.
  405.   #--------------------------------------------------------------------------
  406.   def collide_with_characters?(x, y)
  407.      for party in $game_parties.data                        # Matches event position
  408.         if party.map_id == $game_map.map_id
  409.            if party.map_x == x && party.map_y == y && party != $game_party
  410.               return true
  411.            end
  412.         end
  413.      end
  414.      dargor_multiple_parties_character_collide_with_characters?(x, y)
  415.   end
  416. end
  417.  
  418. #==============================================================================
  419. # ** Window_SaveFile
  420. #------------------------------------------------------------------------------
  421. #   This window displays save files on the save and load screens.
  422. #==============================================================================
  423.  
  424. class Window_Party < Window_Base
  425.   #--------------------------------------------------------------------------
  426.   # * Public Instance Variables
  427.   #--------------------------------------------------------------------------
  428.   attr_reader   :selected                        # selected
  429.   #--------------------------------------------------------------------------
  430.   # * Object Initialization
  431.   #       party_index : party index
  432.   #--------------------------------------------------------------------------
  433.   def initialize(party_index)
  434.      super(0, 112 + party_index % 4 * 76, 544, 76)
  435.      @party_index = party_index
  436.      @party = $game_parties[party_index]
  437.      refresh
  438.      @selected = false
  439.   end
  440.   #--------------------------------------------------------------------------
  441.   # * Refresh
  442.   #--------------------------------------------------------------------------
  443.   def refresh
  444.      self.contents.clear
  445.      self.contents.font.color = normal_color
  446.      name = sprintf(Vocab::Parties, @party_index + 1)
  447.      self.contents.draw_text(4, 0, 200, WLH, name)
  448.      @name_width = contents.text_size(name).width
  449.      draw_party_characters(152, 38)
  450.   end
  451.   #--------------------------------------------------------------------------
  452.   # * Draw Party Characters
  453.   #       x : Draw spot X coordinate
  454.   #       y : Draw spot Y coordinate
  455.   #--------------------------------------------------------------------------
  456.   def draw_party_characters(x, y)
  457.      for i in [email hidden]
  458.         member = @party.members[i]
  459.         name = member.character_name
  460.         index = member.character_index
  461.         draw_character(name, index, x + i * 48, y)
  462.      end
  463.   end
  464.   #--------------------------------------------------------------------------
  465.   # * Set Selected
  466.   #       selected : new selected (true = selected, false = unselected)
  467.   #--------------------------------------------------------------------------
  468.   def selected=(selected)
  469.      @selected = selected
  470.      update_cursor
  471.   end
  472.   #--------------------------------------------------------------------------
  473.   # * Update cursor
  474.   #--------------------------------------------------------------------------
  475.   def update_cursor
  476.      if @selected
  477.         self.cursor_rect.set(0, 0, @name_width + 8, WLH)
  478.      else
  479.         self.cursor_rect.empty
  480.      end
  481.   end
  482. end
  483.  
  484. #==============================================================================
  485. # ** Scene_Map
  486. #------------------------------------------------------------------------------
  487. #   This class performs the map screen processing.
  488. #==============================================================================
  489.  
  490. class Scene_Map < Scene_Base
  491.   #--------------------------------------------------------------------------
  492.   # * Alias Listing
  493.   #--------------------------------------------------------------------------
  494.   alias dargor_vx_parties_scene_map_update update
  495.   alias dargor_vx_parties_scene_map_fadeout fadeout
  496.   #--------------------------------------------------------------------------
  497.   # * Frame Update
  498.   #--------------------------------------------------------------------------
  499.   def update
  500.      if Input.trigger?(Multiple_Parties::Next_Party_Key)
  501.         $game_parties.next_party
  502.      elsif Input.trigger?(Multiple_Parties::Prior_Party_Key)
  503.         $game_parties.prior_party
  504.      end
  505.      dargor_vx_parties_scene_map_update
  506.   end
  507.   #--------------------------------------------------------------------------
  508.   # * Fade Out Screen
  509.   #       duration : time
  510.   #--------------------------------------------------------------------------
  511.   def fadeout(duration)
  512.      dargor_vx_parties_scene_map_fadeout(duration)
  513.      $game_player.refresh
  514.   end
  515. end
  516.  
  517. #==============================================================================
  518. # ** Scene_Map
  519. #------------------------------------------------------------------------------
  520. #   This class performs the multiple party changer screen processing.
  521. #==============================================================================
  522.  
  523. class Scene_Parties < Scene_Base
  524.   #--------------------------------------------------------------------------
  525.   # * Start Processing
  526.   #--------------------------------------------------------------------------
  527.   def start
  528.      super
  529.      @index = 0
  530.      @last_party_index = 0
  531.      @item_max = $game_parties.size
  532.      create_menu_background
  533.      create_help_window
  534.      create_command_window
  535.      create_party_windows
  536.   end
  537.   #--------------------------------------------------------------------------
  538.   # * Create Help Window
  539.   #--------------------------------------------------------------------------
  540.   def create_help_window
  541.      @help_window = Window_Help.new
  542.      multiple = $game_parties.size == 1 ? '' : 's'
  543.      text = sprintf(Vocab::FormParties, $game_parties.size, multiple)
  544.      @help_window.set_text(text)
  545.   end
  546.   #--------------------------------------------------------------------------
  547.   # * Create Command Window
  548.   #--------------------------------------------------------------------------
  549.   def create_command_window
  550.      s1 = Vocab::PartiesConfirm
  551.      s2 = Vocab::PartiesReset
  552.      @command_window = Window_Command.new(544, [s1, s2], 2)
  553.      @command_window.y = 56
  554.      @command_window.active = false
  555.   end
  556.   #--------------------------------------------------------------------------
  557.   # * Start Processing
  558.   #--------------------------------------------------------------------------
  559.   def create_party_windows
  560.      @party_windows = []
  561.      for i in 0...$game_parties.size
  562.         @party_windows << Window_Party.new(i)
  563.      end
  564.      @party_windows[0].selected = true
  565.   end
  566.   #--------------------------------------------------------------------------
  567.   # * Terminate Processing
  568.   #--------------------------------------------------------------------------
  569.   def terminate
  570.      super
  571.      dispose_menu_background
  572.      for window in @party_windows
  573.         window.dispose
  574.      end
  575.      @help_window.dispose
  576.      @command_window.dispose
  577.   end
  578.   #--------------------------------------------------------------------------
  579.   # * Frame Update
  580.   #--------------------------------------------------------------------------
  581.   def update
  582.      super
  583.      @command_window.update
  584.      if @command_window.active
  585.         update_command_selection
  586.      else
  587.         update_party_selection
  588.         for window in @party_windows
  589.            window.update
  590.         end
  591.      end
  592.   end
  593.   #--------------------------------------------------------------------------
  594.   # * Frame Update
  595.   #--------------------------------------------------------------------------
  596.   def confirmation_enabled?
  597.      result = true
  598.      for party in $game_parties.data
  599.         result &&= party.members.size >= 1
  600.      end
  601.      return result
  602.   end
  603.   #--------------------------------------------------------------------------
  604.   # * Frame Update
  605.   #--------------------------------------------------------------------------
  606.   def update_command_selection
  607.      if Input.trigger?(Input::B)
  608.         Sound.play_cancel
  609.         @command_window.active = false
  610.         return
  611.      end
  612.      if Input.trigger?(Input::C)
  613.         case @command_window.index
  614.         when 0
  615.            if confirmation_enabled?
  616.               Sound.play_decision
  617.               $game_party = $game_parties[0]
  618.               #$game_player.refresh
  619.               $scene = Scene_Map.new
  620.            else
  621.               Sound.play_buzzer
  622.               return
  623.            end
  624.         when 1
  625.            Sound.play_decision
  626.            $game_parties.clear_temp_actors
  627.            for party in $game_parties.data
  628.               party.actors.clear
  629.            end
  630.            for window in @party_windows
  631.               window.refresh
  632.            end
  633.         end
  634.      end
  635.   end
  636.   #--------------------------------------------------------------------------
  637.   # * Update Save File Selection
  638.   #--------------------------------------------------------------------------
  639.   def update_party_selection
  640.      if Input.trigger?(Input::C)
  641.         Sound.play_decision
  642.         $game_party = $game_parties[@index]
  643.         $scene = Scene_PartyChanger.new(false, true)
  644.         return
  645.      elsif Input.trigger?(Input::B)
  646.         Sound.play_cancel
  647.         @last_party_index = @index
  648.         @command_window.active = true
  649.         return
  650.      else
  651.         last_index = @index
  652.         if Input.repeat?(Input::DOWN)
  653.            cursor_down(Input.trigger?(Input::DOWN))
  654.         end
  655.         if Input.repeat?(Input::UP)
  656.            cursor_up(Input.trigger?(Input::UP))
  657.         end
  658.         if @index != last_index
  659.            Sound.play_cursor
  660.            @party_windows[last_index].selected = false
  661.            @party_windows[@index].selected = true
  662.         end
  663.      end
  664.   end
  665.   #--------------------------------------------------------------------------
  666.   # * Move cursor down
  667.   #       wrap : Wraparound allowed
  668.   #--------------------------------------------------------------------------
  669.   def cursor_down(wrap)
  670.      if @index < @item_max - 1 or wrap
  671.         @index = (@index + 1) % @item_max
  672.      end
  673.   end
  674.   #--------------------------------------------------------------------------
  675.   # * Move cursor up
  676.   #       wrap : Wraparound allowed
  677.   #--------------------------------------------------------------------------
  678.   def cursor_up(wrap)
  679.      if @index > 0 or wrap
  680.         @index = (@index - 1 + @item_max) % @item_max
  681.      end
  682.   end
  683. end
  684.  
  685. #==============================================================================
  686. # ** Scene_Title
  687. #------------------------------------------------------------------------------
  688. #   This class performs the title screen processing.
  689. #==============================================================================
  690.  
  691. class Scene_Title < Scene_Base
  692.   #--------------------------------------------------------------------------
  693.   # * Alias Listing
  694.   #--------------------------------------------------------------------------
  695.   alias dargor_vx_multiple_parties_title_start start
  696.   alias dargor_vx_multiple_parties_title_command_new_game command_new_game
  697.   #--------------------------------------------------------------------------
  698.   # * Start processing
  699.   #--------------------------------------------------------------------------
  700.   def start
  701.      $game_party = Game_Party.new
  702.      $game_parties = Game_Parties.new
  703.      dargor_vx_multiple_parties_title_start
  704.   end
  705.   #--------------------------------------------------------------------------
  706.   # * Command: New Game
  707.   #--------------------------------------------------------------------------
  708.   def command_new_game
  709.      $game_parties = Game_Parties.new
  710.      dargor_vx_multiple_parties_title_command_new_game
  711.   end
  712. end
Expand to see the code.


Demo

http://www.mediafire.com/?5njd1k6myxw

Hope you like it!
-Dargor
This script kicks ass XD. Nicely done!  :thumb:
Awesome script! Just one question, though-can you make it so that there is a certain party member you can't switch out of the party?
An annoying bug, if you leave no party members for the third party and you enter configuration for the third party, you don't have any party members to chose and it makes you chose at least one.
@Dadevster
You mean after you make your parties or before?

@King Red Of Pancakes 
I'll fix that.
Is there a way to give the other parties a portion of gold/items from the original party? Say, i make a second party, can I give them half of the parties gold and items? Will you get that stuff back when the parties merge?
The current version doesn't include any merging methods (and I wonder why I didn't add that in the first version) but it will be features in the next release.
If you want to give gold and items to another party, you'll have to use the following lines of code.
To add gold:
$game_parties[id].gain_gold(amount)
Expand to see the code.

To add items/weapons/armors:
item = $data_items[id]
or
item = $data_weapons[id]
or
item = $data_armors[id]

$game_parties[id].gain_item(item, amount)
Expand to see the code.

The rest can be done with events.

Take care!
-Dargor
Alright, that does solve some problems. Also, I know I said this in the wrong topic, but has the save problem ben figured out yet?
Yes, I just forgot to save and restore the Game_Parties object.
little favor please (or big, idk)
is there any way you can add a command so when you want to switch parties you can switch to another area and story at once?
in a sense like
going back and forth through time,
change from little people to older people and then you'll be in another area?
or can i already do that?
im kinda new to this stuff... =[
thx in advance
You can to that by combining this script and events. But, I'm not sure I entirely get what you mean :/
I tried using it, but this script but it doesn't work for some reason...

<<<<<<(Trying to learn script)

EDIT:
(and failing)
tcozzmakerex wrote:
little favor please (or big, idk)
is there any way you can add a command so when you want to switch parties you can switch to another area and story at once?
in a sense like
going back and forth through time,
change from little people to older people and then you'll be in another area?
or can i already do that?
im kinda new to this stuff... =[
thx in advance


Here he means that party 1 is on one map, party 2 is on another map.

Party 1 consisters of the actors: Little john, Little Lilly and Little Sam. Party two consists of the actors: Grown up John, Grown up Lilly and Grown up Sam.

To put it simply, can you set it so that when you change parties, the parties locations are saved so that when you switch back to them, you teleport to that parties location?

[Note the "back and forth through time" thing is simply done with cut scenes and events on those maps (you just make seperate maps for the grown up and younger story line events on the same map or you'll have to double event sizes and pages)]

Hope this helps, the script shows promis :)
Well, this is exactly what this script does :/
Haha, I'll admit that I havent tested it. I was just trying to translate what he meant into terms that are understandable :)
Hey, whenever I save the game, shut it down and then try to continu from where I saved I get this error:

Script:"Multiple Parties line 371:Nomethoderror occured

undefined method "data" for nil:NilClass
Are you using the version from the demo or the one in the first post?
The demo
Sorry for the double post but there is no Game_Parties class that's probably the problem can you fix that if it's not too much trouble.
OK, I figured it out you gotta copy from the script on the thread but now when I start it up I get this error

Script Multiple Parties line 427: NoMethodError occured

undefined method attr_reader for Window_PartyClass
vivi21 wrote:
OK, I figured it out you gotta copy from the script on the thread but now when I start it up I get this error

Script Multiple Parties line 427: NoMethodError occured

undefined method attr_reader for Window_PartyClass

hey guys i got the same problem but i fixed it heres what you gotta do change
attr_reader :selected to attr_reader :selectedA and you can save and load without any problems!
also if you get another problem starting a new game delete the A
i dont know anything about scripting so im pretty happy for finding this one out lol! every thing should be fine now

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=50784