Introduction Creates a scene to rearrange your party. There are a variety of things to do in this system. You can remove and add characters from being available in the Reserves (non-party members), lock characters so you can't add or remove them, and make characters "Unavailable", which does about the same thing as Locking. The reasoning behind having two things like this is for representation purposes. A character who isn't in your party, but is temporarily unavailable COULD show up as being "Locked" (lock icon) but I didn't feel it looked as good as being "Unavailable" (greyed out.) But a character who IS in your party, but can't be removed, obviously wouldn't make sense as being Unavailable.
You can also see the statistics of the character, as well as the face graphic, in a small window to the right of the Party/Reserves.
What's the difference?
GSorby's edit of the script
Prexus' default script
Script
Party Switcher/Changer
CODE
#=============================================================================== # ● [VX] ◦ Party Manager/Switcher ◦ #------------------------------------------------------------------------------- # ◦ By Prexus # ◦ Edit by GSorby [george_sorby@hotmail.co.uk] # ◦ RPG Revolution # ◦ Released on: 27/12/2009 # ◦ Version: 1.1 #------------------------------------------------------------------------------- # This is a Party Manager/Switcher which allows the player to switch current # party member with ones that are on standby. You can also make a Party Member # unavailible or locked. There is also a function so that you can show and hide # party members in the manager. #=============================================================================== # To open the party manager, use the code below: # # $scene = Scene_Party.new #------------------------------------------------------------------------------- # To make an actor visible in the Party Window, use the code below: # # $data_actors[ID].found = true #------------------------------------------------------------------------------- # To make an actor unavailable (Grayed out)/unmoveable, use the code below: # # $data_actors[ID].unavailable = true #------------------------------------------------------------------------------- # To lock the leader, use the code below: # # $game_party.members[0].actor.required = true #------------------------------------------------------------------------------- # To unlock the leader, use the code below: # # $game_party.members[0].actor.required = false #------------------------------------------------------------------------------- # To remove an actor from your reserves, use the code below: # # $data_actors[ID].found = false #=============================================================================== # Credits to Prexus for the main script. # Credits to GSorby for the edit of the script. # *Don't edit anything past this point unless you know what you're doing.* #===============================================================================
module RPG class Actor def setup @found = false @unavailable = false @required = false end attr_accessor :found attr_accessor :unavailable attr_accessor :required end end
class Game_Actors attr_reader :data alias prex_party_g_actors_initialize initialize def initialize prex_party_g_actors_initialize $data_actors.each do |actor| actor.setup if actor @data[actor.id] = Game_Actor.new(actor.id) if actor end end end
class Scene_File < Scene_Base alias prex_party_s_file_write_save_data write_save_data alias prex_party_s_file_read_save_data read_save_data def write_save_data(file) prex_party_s_file_write_save_data(file) Marshal.dump($data_actors, file) end def read_save_data(file) prex_party_s_file_read_save_data(file) $data_actors = Marshal.load(file) end end
class Scene_Title < Scene_Base alias prex_party_s_title_command_new_game command_new_game def command_new_game prex_party_s_title_command_new_game $game_party.members.each {|s| s.actor.found = true if s} end end
class Window_Base < Window def draw_item_name(item, x, y, enabled = true, width = 172) if item != nil draw_icon(item.icon_index, x, y, enabled) self.contents.font.color = normal_color self.contents.font.color.alpha = enabled ? 255 : 128 self.contents.draw_text(x + 24, y, width, WLH, item.name) end end end
class Scene_Party < Scene_Base def start super create_menu_background create_windows end def create_windows @member_window = Window_CurrentMember.new @party_window = Window_CurrentParty.new @party_window.active = true @selectable_window = Window_SelectMember.new end def update_windows @member_window.update @party_window.update @selectable_window.update if @party_window.active @member_window.set_member(@party_window.member) elsif @selectable_window.active @member_window.set_member(@selectable_window.member) end end def terminate super @member_window.dispose @party_window.dispose @selectable_window.dispose end def update super update_windows update_input end def update_input if Input.trigger?(Input::A) if @member_window.mode == 1 @member_window.set_mode(0) elsif @member_window.mode == 0 @member_window.set_mode(1) end end if @party_window.active if Input.trigger?(Input::B) Sound.play_cancel $scene = Scene_Menu.new elsif Input.trigger?(Input::C) member = @party_window.member if member != nil if member.actor.unavailable or member.actor.required Sound.play_buzzer return end end Sound.play_decision @party_window.active = false @selectable_window.active = true @selectable_window.index = 0 end elsif @selectable_window.active if Input.trigger?(Input::B) Sound.play_cancel @selectable_window.index = -1 @selectable_window.active = false @party_window.active = true elsif Input.trigger?(Input::C) member = @selectable_window.member if member != nil if member.actor.unavailable Sound.play_buzzer return end end Sound.play_decision $game_party.remove_actor(@party_window.member.id) if @party_window.member != nil $game_party.add_actor(@selectable_window.member.id) if @selectable_window.member != nil @selectable_window.refresh @party_window.refresh @selectable_window.index = -1 @selectable_window.active = false @party_window.active = true end end end end
class Window_CurrentMember < Window_Base attr_reader :mode def initialize(member = nil, mode = 0) super(284, 47, 242, 306) create_contents @member = member @mode = 0 refresh end def member return @member end def set_member(member) old_member = @member @member = member refresh if old_member != @member end def set_mode(mode) @mode = mode if [0, 1].include?(mode) refresh end def refresh self.contents.clear return unless @member x, y = 0, 0 self.draw_actor_face(@member, x, y, 96) self.draw_actor_name(@member, x + 102, y) self.draw_actor_class(@member, x + 102, y + WLH) self.draw_actor_level(@member, x + 102, y + WLH*2) case @mode when 0 self.draw_icon(0, self.contents.width - 24, y + WLH*2) self.draw_actor_hp(@member, x, y + WLH*5, 160) self.draw_actor_mp(@member, x, y + WLH*6, 160) self.draw_actor_parameter(@member, x, y + WLH*7, 0) self.draw_actor_parameter(@member, x, y + WLH*8, 1) self.draw_actor_parameter(@member, x, y + WLH*9, 2) self.draw_actor_parameter(@member, x, y + WLH*10, 3) when 1 self.draw_icon(143, self.contents.width - 24, y + WLH*2) self.contents.draw_text(x, y + WLH*2, self.contents.width - 12, WLH, 'Stat', 2) for i in 0...@member.equips.size item = @member.equips[i] self.draw_item_name(item, x, y + WLH*(3+i), true, self.contents.width - 24) end end end end
class Window_CurrentParty < Window_Selectable def initialize super(18, 60, 256, 64) @item_max = 4 @column_max = @item_max create_contents self.index = 0 refresh end def member return $game_party.members[self.index] end def refresh for i in 0...@item_max rect = item_rect(i) self.contents.clear_rect(rect) end for i in 0...$game_party.members.size rect = item_rect(i) bitmap = Cache.character($game_party.members[i].character_name) sign = $game_party.members[i].character_name[/^[\!\$]./] if sign != nil and sign.include?('$') cw = bitmap.width / 3 ch = bitmap.height / 4 else cw = bitmap.width / 12 ch = bitmap.height / 8 end n = $game_party.members[i].character_index src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch) if $game_party.members[i].actor.unavailable self.contents.blt(rect.x, rect.y, bitmap, src_rect, 128) else self.contents.blt(rect.x, rect.y, bitmap, src_rect, 255) end if $game_party.members[i].actor.required lock_bitmap = Cache.system("Locked") self.contents.blt(rect.x + rect.width - lock_bitmap.width, rect.y + rect.height - lock_bitmap.height, lock_bitmap, lock_bitmap.rect) end end end def item_rect(index) rect = Rect.new(0, 0, 0, 0) rect.width = (contents.width + @spacing) / @column_max - @spacing rect.height = 32 rect.x = index % @column_max * (rect.width + @spacing) rect.y = index / @column_max * 32 return rect end end
class Window_SelectMember < Window_Selectable def initialize super(18, 144, 256, 192) calculate_actors @item_max = @actors.size + 1 @column_max = 4 self.index = -1 self.active = false refresh end def calculate_actors @actors = [] for a in $game_actors.data @actors << a if a != nil and a.actor.found and !$game_party.members.include?(a) end end def member return @actors[self.index] end def refresh self.contents.clear calculate_actors @item_max = @actors.size + 1 for i in 0...@actors.size rect = item_rect(i) bitmap = Cache.character(@actors[i].character_name) sign = @actors[i].character_name[/^[\!\$]./] if sign != nil and sign.include?('$') cw = bitmap.width / 3 ch = bitmap.height / 4 else cw = bitmap.width / 12 ch = bitmap.height / 8 end n = @actors[i].character_index src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch) if @actors[i].actor.unavailable self.contents.blt(rect.x, rect.y, bitmap, src_rect, 128) else self.contents.blt(rect.x, rect.y, bitmap, src_rect, 255) end if @actors[i].actor.required lock_bitmap = Cache.system("Locked") self.contents.blt(rect.x + rect.width - lock_bitmap.width, rect.y + rect.height - lock_bitmap.height, lock_bitmap, lock_bitmap.rect) end end end def item_rect(index) rect = Rect.new(0, 0, 0, 0) rect.width = (contents.width + @spacing) / @column_max - @spacing rect.height = 32 rect.x = index % @column_max * (rect.width + @spacing) rect.y = index / @column_max * 32 return rect end end
Compatibility Only works on VX.
Screenshot
Screenshots
GSorby's edit of the script: Prexus' default script:
DEMO Latest Norton 360 Scanned = OK.
Installation
Below Scenes and above main, in the material section. Copy the "Locked.png" file from the Graphics\System\ directory into your own project, or create your own. Locked.png
The initial starting party is automatically made available in your Reserves/Party. However, when adding a party member using the regular Event command, it doesn't automatically add the character to your Reserves. The reason being for temporary characters and such.
Terms and Conditions Credit Prexus for the script and credit GSorby for the edits.
Credits Prexus: For his amazing Party Switcher script.
You haven't exactly told us what you edited. And did you even ask Prexus if you could post it here? You say it's exclusive, but I'm pretty sure it's on rpgmakervx.net as well.
A saying that I DID NOT STEAL FROM KUNG FU PANDA! Today is a Gift. That's why they call it the Present. You never know what's inside, Because the Present is always changing. ~Made it up with my cuz 7 Years Ago, without the help of anybody else~
Group: Member
Posts: 28
Type: Developer
RM Skill: Advanced
QUOTE (Xzygon @ Jan 1 2010, 11:22 PM)
You haven't exactly told us what you edited. And did you even ask Prexus if you could post it here? You say it's exclusive, but I'm pretty sure it's on rpgmakervx.net as well.
Yes I got warned the first time for stealing. So I asked Prexus and he said back to me: Go for it, I don't care. And sorry about the exclusive thing. I'll change that now.
So if all you do is change the size of a few windows, add a few gauges, throw in one or two term changes, that's enough to say you made the script? And yes, I realize you mentioned Prexus, but honestly, do better than that... This leaves a very bad aftertaste in my mouth...
A saying that I DID NOT STEAL FROM KUNG FU PANDA! Today is a Gift. That's why they call it the Present. You never know what's inside, Because the Present is always changing. ~Made it up with my cuz 7 Years Ago, without the help of anybody else~
Group: Member
Posts: 28
Type: Developer
RM Skill: Advanced
QUOTE (Shanghai @ Jan 2 2010, 08:14 AM)
So if all you do is change the size of a few windows, add a few gauges, throw in one or two term changes, that's enough to say you made the script? And yes, I realize you mentioned Prexus, but honestly, do better than that... This leaves a very bad aftertaste in my mouth...
For a start, where did I say that I made the script. If you look hard enough right the beginning, it says Prexus (for the actual script) and GSorby (for the edits and additions).
Group: Member
Posts: 60
Type: Developer
RM Skill: Skilled
Now now children no need to be snotty.
The OP has as far as we know permissions and has made what appears to be a positive change even if it is only visual that he/she has made (probably for personal use aswell) and has decided to share the results with others, so calm the hell down lol.
Group: Member
Posts: 28
Type: Developer
RM Skill: Advanced
QUOTE (draken29 @ Jan 3 2010, 04:53 PM)
Thanks
I'm only asking but can you post which part of the script that made the initial party automatically in the reserve ?
Thanks once more
OK, youve lost me. What do you mean? When you use the command 'Add Party Member', you can just remove the actor you want to swap and then add the replacement, then add the actor you removed again and he/she should be in the reserves. If this is not what you mean, try to be more specific. Thanks. GSorby
Group: Member
Posts: 28
Type: Developer
RM Skill: Advanced
QUOTE (draken29 @ Jan 3 2010, 05:05 PM)
ooh sorry about that i mean when you say
QUOTE
"The initial starting party is automatically made available in your Reserves/Party. "
in your first post
Which line in the script that made this ?
And I try to use $data_actors[ID].found = false but the character doesn't disappear from the party windows
so please help me i'm not that good at scripting
Be aware that a party member has to be on STANDBY to use $data_actors[ID].found = false. Otherwise it messes up. So a member should disappear when he/she is on standby.
Group: Member
Posts: 6
Type: Developer
RM Skill: Beginner
can u put it on the menu? >.> i dont relly want to command the people who play it to see if they want to change a character and then they dont and then later they want to but they cant bring it up
@Controller That's pretty easy to do. Just make a common event calling the script, and use puppeto4's Comment Event Menu Script and call the common event from there. puppeto4's script can be found here.
A saying that I DID NOT STEAL FROM KUNG FU PANDA! Today is a Gift. That's why they call it the Present. You never know what's inside, Because the Present is always changing. ~Made it up with my cuz 7 Years Ago, without the help of anybody else~
Group: Member
Posts: 28
Type: Developer
RM Skill: Advanced
QUOTE (ItchMyController @ Jan 6 2010, 01:24 AM)
can u put it on the menu? >.> i dont relly want to command the people who play it to see if they want to change a character and then they dont and then later they want to but they cant bring it up
OR (as it says in the demo), you can get yanfly's menu scene redux. You can call any .new commands from there and the menu doesnt close when you want to open it like puppetos. The script can be found here.. Plus its cool for a lot of other things
This post has been edited by gsorby: Jan 6 2010, 02:20 AM