Bonjour. Voilà j'ai un problème de compatibilité entre le script qui permet de changer de leader et le PHS.
Nature du problème Aucun problème du côté du PHS, j'ai aucun plantage. Le soucis vient de celui qui permet de changer de perso en cours de jeu, quand je fais apparaître la fenêtre et que je valide je garde l'acteur 1 enfin celui qui est de base le leader, en retirant le script du PHS ça marche nikel mais c'est pas génial, car sans PHS mon jeu ne sers à rien (à quoi bon avoir 10 persos si on peut pas faire l'équipe voulut).
#=============================================================================== # # Yanfly Engine Zealous - Party Selection System # Last Date Updated: 2010.01.21 # Level: Normal, Hard, Lunatic # # By default, RPG Maker VX lacks a menu that allows for party switching. If a # player reaches four members, any newer members added would be simply ignored # unless the player has enough members and re-run the event again. With this # script, players will finally be able to adjust the party the way they want. # #=============================================================================== # Updates # ----------------------------------------------------------------------------- # o 2010.01.21 - Scrolling efficiency update. # o 2010.01.03 - Victory Aftermath Compatibility. # o 2010.01.02 - Variable Control Bugfix. # - Moved playtime up in the save window. # o 2010.01.01 - Shop display fixed to show only battle members. # o 2009.12.31 - Reserve party members now have their states updated. # o 2009.12.27 - All Dead-Party Bugfix. # - Efficiency update. # o 2009.12.24 - Script finished. # o 2009.12.22 - Started Script. #=============================================================================== # Instructions # ----------------------------------------------------------------------------- # To install this script, open up your script editor and copy/paste this script # to an open slot below ▼ Materials but above ▼ Main. Remember to save. # # ----------------------------------------------------------------------------- # Module Edit Requirements # ----------------------------------------------------------------------------- # Search for ENABLE_SWITCH and BATTLE_SWITCH. Bind these two constants to the # proper switch ID's you wish to associate them with. # # ----------------------------------------------------------------------------- # Script Commands - These are used with the Event Editor's Script command. # ----------------------------------------------------------------------------- # $game_party.fix_actor(n) # Makes it so that the actor cannot be taken out of the party. Requires the # actor to be in the party already. # # $game_party.unfix_actor(n) # Allows the actor to be taken out of the party again. Requires the actor to # be in the party already. # # $game_party.set_battlers(n1, n2, n3, n4) # Allows you to set a party the way you want it to. Actors must have joined # or else no changes will be made to that slot. # #=============================================================================== # Compatibility # ----------------------------------------------------------------------------- # - Works With: YEZ Battle Engine Zealous, YEZ Main Menu Zealous # ----------------------------------------------------------------------------- # Note: This script may not work with former Yanfly Engine ReDux scripts. # Use Yanfly Engine Zealous scripts to work with this if available. # Thanks to KGC Software for a lot of reference work. #===============================================================================
$imported = {} if $imported == nil $imported["PartySelectionSystem"] = true
module YEZ module PARTY
#=========================================================================== # Basic Settings # ------------------------------------------------------------------------- # This here allows you to adjust the basic settings that govern the overall # party changing scene. Change them as you see fitting. #===========================================================================
# These two items adjust how the party command appears in your main menu. TITLE = "PHS" ICON = 5918
# This switch needs to be on before the party change option will appear in # the main menu. Bind it properly to use it. ENABLE_SWITCH = 42 BATTLE_SWITCH = 43 BATTLE_DEFAULT = false # Set to true to have it on by default.
# This is mostly used for eventing and determining which members are in the # party by storing their ID's inside of these following variables. Adjusted # whenever the player refreshes (quite often). VAR_PARTY_MEM1 = 41 VAR_PARTY_MEM2 = 42 VAR_PARTY_MEM3 = 43 VAR_PARTY_MEM4 = 44
# This variable is used for setting a focused character to be visible when # traveling on the field for story purposes. Whatever this variable equals, # that character will be displayed instead of whoever is the party leader. VAR_FOCUSED = 45
# This is the maximum number of members that can be in your active party # at once. Going over this number will result in a bitmap error that can't # be corrected by scripts alone. MAXIMUM_MEMBERS = 99
# Setting this to true will cause status effects to update and take effect # for actors in the battle reserve. RESERVE_STATES_EFFECT = true
# Determines what percentage of the EXP won is given to non-participating # party members. 0.50 means 50%. BATTLE_RESERVE_EXP = 0.50
# This will show the level up messages for characters in the reserve if # they did indeed level. RESERVE_LEVEL_UP = true
#=========================================================================== # Party Switching Settings # ------------------------------------------------------------------------- # The following settings adjust what appears within the party switching # scene from the various ways to sort actors to the vocabulary used. #===========================================================================
# The following adjusts the assort menu. The default list consists as such. # :story, :name, :class, :level, :hp, :mp, :atk, :def, :spi, :res, # :dex, :agi, :hit, :eva, :cri, :dur, :luk, :odds ASSORT_COMMANDS =[ :name, :story, :class, :level, :hp, :mp, :atk, :def, :spi, :res, :dex, :agi, :hit, :eva, :cri, :dur, :luk, :odds ] # Do not remove this.
# This little array here allows you to set certain actors as higher # priority for story sorting than other actors. Unlisted actors will have # their positions unchanged other than being lower on the list than the # story priority characters. STORY_SORTING = [1..4, 6]
# The following hash adjusts the vocabulary used for all of the party # switching scene. Adjust the vocabulary as you see fit. VOCAB ={ :clear => "Retirer", :empty => "Vide", :nodata => "Aucune donnée", :c_battler => "Changer", :b_battler => "Terminé", :a_battler => "Retirer", :x_battler => "Retourner", :c_actors => "Sélection", :b_actors => "Annuler", :a_actors => "Ranger", :x_actors => "Retourner", :sort_by => "Acteurs...", :story => "Par Histoire", :name => "Par nom", :class => "Par Classe", :level => "Par niveau", :stat => "Par %s", } # Do not remove this.
# The following determines how the game displays the keys inside of the # help window. %s will be the instruction following. KEYS ={ :a => "A:%s", :b => "B:%s", :c => "C:%s", :x => "X:%s", } # Do not remove this.
# This here is a list of the stats shown in the status window. Certain stats # will not appear unless certain scripts are installed. The order you place # these stats will be the order they appear in the window. # :atk, :def, :spi, :res, :dex, :agi, :hit, :eva, :cri, :dur, :luk, :odds SHOWN_STATS = [:atk, :def, :spi, :res, :dex, :agi, :hit, :eva, :cri, :dur, :luk, :odds]
# These are the misc visual adjustments you can make the scene. FACE_OPACITY = 255 # Face opacity for battler window. SPRITE_OFFSET = 12 # Sprite offset for party list. ACTIVE_COLOUR = 6 # Highlighted Name Colour CLEAR_ICON = 98 # This is used for clearing an actor. UP_ICON = 0 # These are the icons used when stats are higher DN_ICON = 0 # or lower than their base amounts. LOCKED_ICON = 80 # Icon used for locked actors.
#=========================================================================== # Menu Status Window # ------------------------------------------------------------------------- # When viewing the main menu, the status window will now host the extra # party members that aren't participating in battle. #===========================================================================
# This adjusts the back colour opacity for non-battle members inside of # the main menu's party window. BACK_OPACITY = 64
# This adjusts the way EXP bars are displayed inside the main menu status # window. Adjust it as you see fit. EXP_TEXT = "EXP" # Text used for EXP PERCENT_EXP = "%1.2f%%" # Text format used for EXP percentage EXP_GAUGE_1 = 28 # Colour 1 for the EXP Gauge EXP_GAUGE_2 = 29 # Colour 2 for the EXP Gauge
end # PARTY end # YEZ
#=============================================================================== # Editting anything past this point may potentially result in causing computer # damage, incontinence, explosion of user's head, coma, death, and/or halitosis. # Therefore, edit at your own risk. #===============================================================================
module YEZ::PARTY module_function #-------------------------------------------------------------------------- # convert_integer_array #-------------------------------------------------------------------------- def convert_integer_array(array) result = [] array.each { |i| case i when Range; result |= i.to_a when Integer; result |= [i] end } return result end #-------------------------------------------------------------------------- # story_sorting_list #-------------------------------------------------------------------------- STORY_SORTING_LIST = convert_integer_array(STORY_SORTING) end # YEZ::PARTY
module Vocab def self.hit; return "HIT"; end def self.eva; return "EVA"; end def self.cri; return "CRI"; end def self.odds;return "AGR"; end end # Vocab
#-------------------------------------------------------------------------- # alias method: members #-------------------------------------------------------------------------- alias members_pss members unless $@ def members if $game_temp.in_battle or $scene.is_a?(Scene_Shop) return battle_members else result = [] for member in battle_members result.push(member) end for member in all_members result.push(member) unless result.include?(member) end return result end end
#-------------------------------------------------------------------------- # new method: all_members #-------------------------------------------------------------------------- def all_members; return members_pss.uniq; end
#-------------------------------------------------------------------------- # new method: reserve_members #-------------------------------------------------------------------------- def reserve_members; return (members_pss - battle_members).uniq; end
#-------------------------------------------------------------------------- # new method: battle_members #-------------------------------------------------------------------------- def battle_members if @battlers == nil @battlers = [0, 0, 0, 0] for i in 0..([@actors.size, BATTLE_MAX].min - 1) @battlers[i] = @actors[i] end end result = [] for id in @battlers result.push($game_actors[id]) unless $game_actors[id] == nil end return result end
#-------------------------------------------------------------------------- # new method: fixed_members #-------------------------------------------------------------------------- def fixed_members result = [] @fixed_actors = [] if @fixed_actors == nil for id in @fixed_actors result.push($game_actors[id]) unless $game_actors[id] == nil end return result end
#-------------------------------------------------------------------------- # new method: fix_actor #-------------------------------------------------------------------------- def fix_actor(actor_id) @fixed_actors = [] if @fixed_actors == nil battle_members if @battlers == nil return unless @battlers.include?(actor_id) @fixed_actors.push(actor_id) end
#-------------------------------------------------------------------------- # new method: unfix_actor #-------------------------------------------------------------------------- def unfix_actor(actor_id) @fixed_actors = [] if @fixed_actors == nil return unless @battlers.include?(actor_id) @fixed_actors.delete(actor_id) end
#-------------------------------------------------------------------------- # alias method: setup_starting_members #-------------------------------------------------------------------------- alias setup_starting_members_pss setup_starting_members unless $@ def setup_starting_members setup_starting_members_pss $game_switches[YEZ::PARTY::ENABLE_SWITCH] = true $game_switches[YEZ::PARTY::BATTLE_SWITCH] = YEZ::PARTY::BATTLE_DEFAULT end
#-------------------------------------------------------------------------- # alias method: add_actor #-------------------------------------------------------------------------- alias add_actor_pss add_actor unless $@ def add_actor(actor_id) last_size = @actors.size add_actor_pss(actor_id) if last_size < @actors.size battle_members if @battlers == nil for i in 0..(@battlers.size-1) if @battlers[i] == 0 @battlers[i] = actor_id break end end end end
#-------------------------------------------------------------------------- # alias method: remove_actor #-------------------------------------------------------------------------- alias remove_actor_pss remove_actor unless $@ def remove_actor(actor_id) battle_members if @battlers == nil @battlers[@battlers.index(actor_id)] = 0 if @battlers.include?(actor_id) remove_actor_pss(actor_id) end
#-------------------------------------------------------------------------- # alias method: control variable #-------------------------------------------------------------------------- alias command_122_pss command_122 unless $@ def command_122 n = command_122_pss $game_player.refresh if @params[0] == YEZ::PARTY::VAR_FOCUSED return n end
end # Game_Interpreter
Dernière édition par CloudStrife le Sam 7 Aoû 2010 - 19:32, édité 2 fois
#-------------------------------------------------------------------------- # alias method: create_command_window #-------------------------------------------------------------------------- alias create_command_window_pss create_command_window unless $@ def create_command_window create_command_window_pss return if $imported["CustomMenuCommand"] if $game_switches[YEZ::PARTY::ENABLE_SWITCH] and $game_party.all_members.size > 1 title = YEZ::PARTY::TITLE @command_party = @command_window.add_command(title) if @command_window.oy > 0 @command_window.oy -= Window_Base::WLH end end @command_window.index = @menu_index end
#-------------------------------------------------------------------------- # alias method: update_command_selection #-------------------------------------------------------------------------- alias update_command_selection_pss update_command_selection unless $@ def update_command_selection call_yez_command = 0 if Input.trigger?(Input::C) case @command_window.index when @command_party Sound.play_decision $scene = Scene_Party.new(@command_window.index, Scene_Party::HOST_MENU) return end end update_command_selection_pss end
if YEZ::PARTY::RESERVE_STATES_EFFECT #-------------------------------------------------------------------------- # alias method: start_main #-------------------------------------------------------------------------- if $imported["CustomStatusPropertiesZeal"] alias start_main_pss start_main unless $@ def start_main start_main_pss for member in $game_party.reserve_members for state in member.states; member.custom_status_effects(state, "BEGIN") end end end end
#-------------------------------------------------------------------------- # alias method: turn_end #-------------------------------------------------------------------------- alias turn_end_pss turn_end unless $@ def turn_end for member in $game_party.reserve_members member.slip_damage_effect member.do_auto_recovery member.remove_states_auto end turn_end_pss end end # YEZ::PARTY::RESERVE_STATES_EFFECT
#-------------------------------------------------------------------------- # alias method: display_level_up #-------------------------------------------------------------------------- unless $imported["VictoryAftermath"] alias display_level_up_pss display_level_up unless $@ def display_level_up display_level_up_pss exp = Integer($game_troop.exp_total * YEZ::PARTY::BATTLE_RESERVE_EXP) for actor in $game_party.reserve_members actor.gain_exp(exp, YEZ::PARTY::RESERVE_LEVEL_UP) if actor.exist? end wait_for_message end end
#-------------------------------------------------------------------------- # alias method: battle_end #-------------------------------------------------------------------------- alias battle_end_pss battle_end unless $@ def battle_end(result) battle_end_pss(result) for member in $game_party.reserve_members member.remove_states_battle end end
#-------------------------------------------------------------------------- # terminate #-------------------------------------------------------------------------- def terminate super dispose_menu_background @battlers_window.dispose if @battlers_window != nil @actors_window.dispose if @actors_window != nil @help_window.dispose if @help_window != nil @status_window.dispose if @status_window != nil @assort_window.dispose if @assort_window != nil @assort_back.dispose if @assort_back != nil end
#-------------------------------------------------------------------------- # return_scene #-------------------------------------------------------------------------- def return_scene case @host_menu when HOST_MAP $scene = Scene_Map.new when HOST_BATTLE $scene = Scene_Battle.new when HOST_MENU if $imported["CustomMenuCommand"] and $game_temp.menu_command_index.has_key?(:party) $scene = Scene_Menu.new($game_temp.menu_command_index[:party]) else $scene = Scene_Menu.new(@menu_index) end end $game_player.refresh end
#-------------------------------------------------------------------------- # update #-------------------------------------------------------------------------- def update super update_menu_background if @battlers_window.active update_battlers_window elsif @actors_window.active update_actors_window elsif @assort_window.active update_assort_window end end
#-------------------------------------------------------------------------- # refresh #-------------------------------------------------------------------------- def refresh @battlers_window.refresh @actors_window.refresh if @battlers_window.active @status_window.refresh(@battlers_window.item) if @battlers_window.item != @status_window.item elsif @actors_window.active @status_window.refresh(@actors_window.item) if @actors_window.item != @status_window.item end $game_player.refresh end
#-------------------------------------------------------------------------- # update_battlers_window #-------------------------------------------------------------------------- def update_battlers_window @battlers_window.update @help_window.refresh(1) if @help_window.type != 1 if @last_battler_index != @battlers_window.index @last_battler_index = @battlers_window.index @status_window.refresh(@battlers_window.item) if @battlers_window.item != @status_window.item end if Input.trigger?(Input::B) if @battlers_window.selected_index == nil if $game_party.battle_members == [] Sound.play_buzzer elsif $game_party.all_dead? Sound.play_buzzer else for actor in $game_party.fixed_members next if $game_party.battle_members.include?(actor) Sound.play_buzzer return end Sound.play_cancel return_scene end else @battlers_window.selected_index = nil refresh end elsif Input.trigger?(Input::A) id = @battlers_window.item if id != 0 and $game_party.fixed_members.include?($game_actors[id]) Sound.play_buzzer return end Sound.play_equip index = @battlers_window.index $game_party.battlers[index] = 0 refresh elsif Input.trigger?(Input::X) Sound.play_equip $game_party.battlers = @original_party.clone refresh elsif Input.trigger?(Input::L) Sound.play_equip index1 = @battlers_window.index index2 = index1 - 1 temp = $game_party.battlers[index1] $game_party.battlers[index1] = $game_party.battlers[index2] $game_party.battlers[index2] = temp @battlers_window.index -= 1 @battlers_window.index = 3 if @battlers_window.index < 0 refresh elsif Input.trigger?(Input::R) Sound.play_equip index1 = @battlers_window.index index2 = index1 - 3 temp = $game_party.battlers[index1] $game_party.battlers[index1] = $game_party.battlers[index2] $game_party.battlers[index2] = temp @battlers_window.index += 1 @battlers_window.index = 0 if @battlers_window.index > 3 refresh elsif Input.trigger?(Input::C) id = @battlers_window.item if id != 0 and $game_party.fixed_members.include?($game_actors[id]) Sound.play_buzzer return end if @battlers_window.selected_index == nil Sound.play_decision @battlers_window.selected_index = @battlers_window.index @battlers_window.draw_item(@battlers_window.index) @battlers_window.active = false @actors_window.active = true @actors_window.index = @last_actor_index @status_window.refresh(@actors_window.item) else Sound.play_equip actor_id = @battlers_window.item temp_id = @battlers_window.selected_item $game_party.battlers[@battlers_window.index] = temp_id $game_party.battlers[@battlers_window.selected_index] = actor_id @battlers_window.selected_index = nil refresh end elsif Input.trigger?(Input::DOWN) and @battlers_window.selected_index == nil Sound.play_cursor @battlers_window.active = false @battlers_window.index = -1 @actors_window.active = true @actors_window.index = @last_actor_index @status_window.refresh(@actors_window.item) end end
#-------------------------------------------------------------------------- # update_actors_window #-------------------------------------------------------------------------- def update_actors_window @help_window.refresh(2) if @help_window.type != 2 if @last_actor_index != @actors_window.index @last_actor_index = @actors_window.index @status_window.refresh(@actors_window.item) end if Input.trigger?(Input::B) Sound.play_cancel if @actors_window.selected_index != nil @actors_window.selected_index = nil @actors_window.refresh else @battlers_window.active = true @actors_window.active = false @battlers_window.index = @last_battler_index @battlers_window.selected_index = nil @battlers_window.draw_item(@battlers_window.index) @status_window.refresh(@battlers_window.item) end elsif Input.repeat?(Input::UP) and @actors_window.selected_index == nil and @actors_window.index == 0 and @battlers_window.selected_index == nil Sound.play_cursor @battlers_window.active = true @actors_window.active = false @battlers_window.index = @last_battler_index @battlers_window.selected_index = nil @battlers_window.draw_item(@battlers_window.index) @status_window.refresh(@battlers_window.item) elsif Input.trigger?(Input::A) and @actors_window.selected_index == nil Sound.play_decision @assort_window.active = true @assort_window.visible = true @assort_back.visible = true @actors_window.active = false @status_window.visible = false elsif Input.trigger?(Input::X) Sound.play_equip $game_party.actors = @original_order.clone refresh elsif Input.trigger?(Input::C) actor_id = @actors_window.item if @battlers_window.selected_index != nil Sound.play_equip if $game_party.battlers.include?(actor_id) and actor_id != 0 ix = $game_party.battlers.index(actor_id) jx = @battlers_window.selected_index $game_party.battlers[ix] = $game_party.battlers[jx] end $game_party.battlers[@battlers_window.selected_index] = actor_id @battlers_window.selected_index = nil @battlers_window.active = true @actors_window.active = false @battlers_window.index = @last_battler_index refresh elsif @actors_window.selected_index == nil and actor_id > 0 Sound.play_equip @actors_window.selected_index = @actors_window.index @actors_window.refresh elsif actor_id > 0 Sound.play_equip ix = $game_party.actors.index(actor_id) jx = @actors_window.selected_index $game_party.actors[ix] = $game_party.actors[jx] $game_party.actors[@actors_window.selected_index] = actor_id @actors_window.selected_index = nil @actors_window.refresh @status_window.refresh(@actors_window.item) end end @actors_window.update end
#-------------------------------------------------------------------------- # update_assort_window #-------------------------------------------------------------------------- def update_assort_window @assort_window.update if Input.trigger?(Input::B) Sound.play_cancel @assort_window.active = false @assort_window.visible = false @assort_back.visible = false @actors_window.active = true @status_window.visible = true elsif Input.trigger?(Input::C) or Input.trigger?(Input::A) if Input.trigger?(Input::C) @assort_window.active = false @assort_window.visible = false @assort_back.visible = false @actors_window.active = true @status_window.visible = true end Sound.play_equip #--- result = $game_party.all_members case @assort_window.command when :story priority = [] for id in YEZ::PARTY::STORY_SORTING_LIST priority.push($game_actors[id]) if $game_party.actors.include?(id) end priority.sort! { |a,b| a.id <=> b.id } result = (priority + result).uniq when :name; result.sort! { |a,b| a.name <=> b.name } when :class; result.sort! { |a,b| a.class.name <=> b.class.name } when :level; result.sort! { |a,b| b.level <=> a.level } when :hp; result.sort! { |a,b| b.maxhp <=> a.maxhp } when :mp; result.sort! { |a,b| b.maxhp <=> a.maxhp } when :atk; result.sort! { |a,b| b.atk <=> a.atk } when :def; result.sort! { |a,b| b.def <=> a.def } when :spi; result.sort! { |a,b| b.spi <=> a.spi } when :res; result.sort! { |a,b| b.res <=> a.res } when :dex; result.sort! { |a,b| b.dex <=> a.dex } when :agi; result.sort! { |a,b| b.agi <=> a.agi } when :hit; result.sort! { |a,b| b.hit <=> a.hit } when :eva; result.sort! { |a,b| b.eva <=> a.eva } when :cri; result.sort! { |a,b| b.cri <=> a.cri } when :dur; result.sort! { |a,b| b.max_dur <=> a.max_dur } when :luk; result.sort! { |a,b| b.luk <=> a.luk } when :odds; result.sort! { |a,b| b.odds <=> a.odds } end #--- $game_party.actors = [] for actor in result next if actor == nil next if $game_party.actors.include?(actor.id) $game_party.actors.push(actor.id) end refresh @status_window.refresh(@actors_window.item) end end
end # Scene_Party
#============================================================================== # Window_Command (imported from KGC) #==============================================================================
#-------------------------------------------------------------------------- # overwrite method: refresh #-------------------------------------------------------------------------- def refresh @item_max = $game_party.members.size create_contents colour_non_battler_background for i in 0..$game_party.members.size draw_item(i) end end
#-------------------------------------------------------------------------- # draw_item #-------------------------------------------------------------------------- def draw_item(index) actor = $game_party.members[index] return if actor == nil draw_actor_face(actor, 2, index * 96 + 2, 92) x = 104 y = index * 96 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_stun_indicator(x, y + WLH * 3, actor) if $imported["ClassStatDUR"] draw_actor_hp(actor, x + 120, y + WLH * 1, 120) draw_actor_mp(actor, x + 120, y + WLH * 2, 120) draw_menu_exp(actor, x + 120, y + WLH * 3, 120) end
#-------------------------------------------------------------------------- # new method: draw_menu_exp #-------------------------------------------------------------------------- def draw_menu_exp(actor, x, y, size = 120) if actor.next_exp != 0 gw = size * actor.now_exp gw /= actor.next_exp else gw = size end gc1 = text_color(YEZ::PARTY::EXP_GAUGE_1) gc2 = text_color(YEZ::PARTY::EXP_GAUGE_2) self.contents.fill_rect(x, y + WLH - 8, size, 6, gauge_back_color) self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2) self.contents.font.color = system_color self.contents.draw_text(x, y, 40, WLH, YEZ::PARTY::EXP_TEXT) self.contents.font.color = normal_color if actor.next_exp != 0 expercent = actor.now_exp * 100.0 expercent /= actor.next_exp else expercent = 100.0 end expercent = 100.0 if expercent > 100.0 text = sprintf(YEZ::PARTY::PERCENT_EXP, expercent) self.contents.draw_text(x, y, size, WLH, text, 2) end
#-------------------------------------------------------------------------- # new method: colour_non_battler_background #-------------------------------------------------------------------------- def colour_non_battler_background color = Color.new(0, 0, 0, YEZ::PARTY::BACK_OPACITY) dy = $game_party.battle_members.size * 96 dh = $game_party.reserve_members.size * 96 self.contents.fill_rect(0, dy, self.width - 32, dh, color) if dh > 0 end
#-------------------------------------------------------------------------- # refresh #-------------------------------------------------------------------------- def refresh $game_party.battle_members if $game_party.battlers == nil @data = [] for id in $game_party.battlers; @data.push(id); end @item_max = @data.size create_contents for i in 0..(@item_max-1); draw_item(i); end end
#-------------------------------------------------------------------------- # draw_item #-------------------------------------------------------------------------- def draw_item(index) actor = $game_actors[@data[index]] rect = item_rect(index) self.contents.clear_rect(rect) self.contents.font.color = normal_color if actor == nil color = Color.new(0, 0, 0, YEZ::PARTY::BACK_OPACITY) self.contents.fill_rect(rect.x+2, rect.y+2, rect.width-4, rect.height-4, color) if @selected_index != nil and @selected_index == index self.contents.font.color = text_color(YEZ::PARTY::ACTIVE_COLOUR) else self.contents.font.color = system_color end text = YEZ::PARTY::VOCAB[:empty] self.contents.draw_text(rect.x, WLH*3/2, rect.width, WLH, text, 1) return end draw_actor_face(actor, rect.x+2, rect.y+2, 92) draw_actor_name(actor, rect.x, rect.y) if $game_party.fixed_members.include?(actor) draw_icon(YEZ::PARTY::LOCKED_ICON, rect.x, rect.y + WLH*3) end end
#-------------------------------------------------------------------------- # new method: item #-------------------------------------------------------------------------- def item; return @data[self.index]; end
#-------------------------------------------------------------------------- # new method: selected_item #-------------------------------------------------------------------------- def selected_item; return @data[@selected_index]; end
#-------------------------------------------------------------------------- # refresh #-------------------------------------------------------------------------- def refresh @data = [] for actor in $game_party.all_members; @data.push(actor.id); end @data = @data + [0] @item_max = @data.size create_contents for i in 0..(@item_max-1); draw_item(i); end end
#-------------------------------------------------------------------------- # draw_item #-------------------------------------------------------------------------- def draw_item(index) rect = item_rect(index) actor = $game_actors[@data[index]] self.contents.clear_rect(rect) self.contents.font.color = normal_color if actor == nil draw_icon(YEZ::PARTY::CLEAR_ICON, rect.x+6, rect.y) rect.x += 32; rect.width -= 34 text = YEZ::PARTY::VOCAB[:clear] self.contents.draw_text(rect.x, rect.y, rect.width, WLH, text) return end offset = YEZ::PARTY::SPRITE_OFFSET draw_actor_graphic(actor, rect.x + 16, rect.y + rect.height + offset) rect.x += 32 rect.width -= 34 self.contents.font.color = hp_color(actor) enabled = !$game_party.battle_members.include?(actor) self.contents.font.color.alpha = enabled ? 255 : 128 if @selected_index != nil and @selected_index == index self.contents.font.color = text_color(YEZ::PARTY::ACTIVE_COLOUR) end self.contents.draw_text(rect.x, rect.y, rect.width, WLH, actor.name) end
#-------------------------------------------------------------------------- # item #-------------------------------------------------------------------------- def item; return @actor; end
#-------------------------------------------------------------------------- # refresh #-------------------------------------------------------------------------- def refresh(actor_id) self.contents.clear if actor_id <= 0 color = Color.new(0, 0, 0, YEZ::PARTY::BACK_OPACITY) self.contents.fill_rect(0, 0, self.width, self.height, color) self.contents.font.color = system_color text = YEZ::PARTY::VOCAB[:nodata] self.contents.draw_text(0, self.height/2-24, self.width-40, WLH, text, 1) return end actor = $game_actors[actor_id] @actor = actor draw_actor_face(actor, 0, 0, size = 96) x = 104 y = 0 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_stun_indicator(x, y + WLH * 3, actor) if $imported["ClassStatDUR"] draw_actor_hp(actor, x + 120, y + WLH * 1, 120) draw_actor_mp(actor, x + 120, y + WLH * 2, 120) draw_actor_exp(actor, x + 120, y + WLH * 3, 120) draw_actor_stats(actor, 0, y + WLH * 9/2) end
#-------------------------------------------------------------------------- # draw_actor_exp #-------------------------------------------------------------------------- def draw_actor_exp(actor, x, y, size = 120) if actor.next_exp != 0 gw = size * actor.now_exp gw /= actor.next_exp else gw = size end gc1 = text_color(YEZ::PARTY::EXP_GAUGE_1) gc2 = text_color(YEZ::PARTY::EXP_GAUGE_2) self.contents.fill_rect(x, y + WLH - 8, size, 6, gauge_back_color) self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2) self.contents.font.color = system_color self.contents.draw_text(x, y, 40, WLH, YEZ::PARTY::EXP_TEXT) self.contents.font.color = normal_color if actor.next_exp != 0 expercent = actor.now_exp * 100.0 expercent /= actor.next_exp else expercent = 100.0 end expercent = 100.0 if expercent > 100.0 text = sprintf(YEZ::PARTY::PERCENT_EXP, expercent) self.contents.draw_text(x, y, size, WLH, text, 2) end
#-------------------------------------------------------------------------- # draw_actor_stats #-------------------------------------------------------------------------- def draw_actor_stats(actor, dx, dy) fx = dx; fy = dy cw = calc_width for stat in YEZ::PARTY::SHOWN_STATS icon = 0; up_icon = YEZ::PARTY::UP_ICON; dn_icon = YEZ::PARTY::DN_ICON case stat when :atk up_icon = YEZ::ICONS[:upatk] if $imported["Icons"] dp_icon = YEZ::ICONS[:dnatk] if $imported["Icons"] icon = $imported["Icons"] ? YEZ::ICONS[:atk] : 0 icon = up_icon if actor.atk > actor.base_atk icon = dn_icon if actor.atk < actor.base_atk name = Vocab.atk value = actor.atk when :def up_icon = YEZ::ICONS[:updef] if $imported["Icons"] dp_icon = YEZ::ICONS[:dndef] if $imported["Icons"] icon = $imported["Icons"] ? YEZ::ICONS[:def] : 0 icon = up_icon if actor.def > actor.base_def icon = dn_icon if actor.def < actor.base_def name = Vocab.def value = actor.def when :spi up_icon = YEZ::ICONS[:upspi] if $imported["Icons"] dp_icon = YEZ::ICONS[:dnspi] if $imported["Icons"] icon = $imported["Icons"] ? YEZ::ICONS[:spi] : 0 icon = up_icon if actor.spi > actor.base_spi icon = dn_icon if actor.spi < actor.base_spi name = Vocab.spi value = actor.spi when :agi up_icon = YEZ::ICONS[:upagi] if $imported["Icons"] dp_icon = YEZ::ICONS[:dnagi] if $imported["Icons"] icon = $imported["Icons"] ? YEZ::ICONS[:agi] : 0 icon = up_icon if actor.agi > actor.base_agi icon = dn_icon if actor.agi < actor.base_agi name = Vocab.agi value = actor.agi when :hit icon = $imported["Icons"] ? YEZ::ICONS[:hit] : 0 value = sprintf("%d%%",[[actor.hit, 0].max, 99].min) name = Vocab.hit when :eva icon = $imported["Icons"] ? YEZ::ICONS[:eva] : 0 value = sprintf("%d%%",[[actor.eva, 0].max, 99].min) name = Vocab.eva when :cri icon = $imported["Icons"] ? YEZ::ICONS[:cri] : 0 value = sprintf("%d%%",[[actor.cri, 0].max, 99].min) name = Vocab.cri when :odds icon = $imported["Icons"] ? YEZ::ICONS[:odds] : 0 value = actor.odds name = Vocab.odds when :res next unless $imported["BattlerStatRES"] up_icon = YEZ::ICONS[:upres] if $imported["Icons"] dp_icon = YEZ::ICONS[:dnres] if $imported["Icons"] icon = $imported["Icons"] ? YEZ::ICONS[:res] : 0 icon = up_icon if actor.res > actor.base_res icon = dn_icon if actor.res < actor.base_res value = actor.res name = Vocab.res when :dex next unless $imported["BattlerStatDEX"] up_icon = YEZ::ICONS[:updex] if $imported["Icons"] dp_icon = YEZ::ICONS[:dndex] if $imported["Icons"] icon = $imported["Icons"] ? YEZ::ICONS[:dex] : 0 icon = up_icon if actor.dex > actor.base_dex icon = dn_icon if actor.dex < actor.base_dex value = actor.dex name = Vocab.dex when :luk next unless $imported["ClassStatLUK"] up_icon = YEZ::ICONS[:upluk] if $imported["Icons"] dp_icon = YEZ::ICONS[:dnluk] if $imported["Icons"] icon = $imported["Icons"] ? YEZ::ICONS[:luk] : 0 icon = up_icon if actor.luk > actor.base_luk icon = dn_icon if actor.luk < actor.base_luk value = actor.luk name = Vocab.luk when :dur next unless $imported["ClassStatDUR"] icon = $imported["Icons"] ? YEZ::ICONS[:dur] : 0 value = actor.max_dur name = Vocab.dur else; next end draw_icon(icon, dx, dy) self.contents.font.color = system_color self.contents.draw_text(dx+24, dy, 60, WLH, name, 0) self.contents.font.color = normal_color self.contents.draw_text(dx+84, dy, cw, WLH, value, 2) dx = dx == fx ? dx + (self.width-32)/2 : fx dy = dx == fx ? dy + WLH : dy break if dy + 24 > self.height - 32 end end
#-------------------------------------------------------------------------- # calc_width #-------------------------------------------------------------------------- def calc_width return @calc_width if @calc_width != nil n = 0 for actor in $game_party.members for item in YEZ::PARTY::SHOWN_STATS text = "" case item when :atk; text = actor.atk when :def; text = actor.def when :spi; text = actor.spi when :agi; text = actor.agi when :res; text = actor.res if $imported["BattlerStatRES"] when :dex; text = actor.dex if $imported["BattlerStatDEX"] when :hit; text = sprintf("%d%%", [[actor.hit, 0].max, 99].min) when :eva; text = sprintf("%d%%", [[actor.eva, 0].max, 99].min) when :cri; text = sprintf("%d%%", [[actor.cri, 0].max, 99].min) when :dur; text = actor.dur if $imported["ClassStatDUR"] when :luk; text = actor.luk if $imported["BattlerStatLUK"] when :odds; text = actor.odds else; next end n = [n, contents.text_size(text).width].max end end @calc_width = n return n end
#-------------------------------------------------------------------------- # command #-------------------------------------------------------------------------- def command; return @data[self.index]; end
#-------------------------------------------------------------------------- # refresh #-------------------------------------------------------------------------- def refresh @data = []; @vocab = [] for command in YEZ::PARTY::ASSORT_COMMANDS case command when :story, :name, :class, :level; @vocab.push(YEZ::PARTY::VOCAB[command]) when :hp; @vocab.push(sprintf(YEZ::PARTY::VOCAB[:stat], Vocab.hp)) when :mp; @vocab.push(sprintf(YEZ::PARTY::VOCAB[:stat], Vocab.mp)) when :atk; @vocab.push(sprintf(YEZ::PARTY::VOCAB[:stat], Vocab.atk)) when :def; @vocab.push(sprintf(YEZ::PARTY::VOCAB[:stat], Vocab.def)) when :spi; @vocab.push(sprintf(YEZ::PARTY::VOCAB[:stat], Vocab.spi)) when :agi; @vocab.push(sprintf(YEZ::PARTY::VOCAB[:stat], Vocab.agi)) when :hit; @vocab.push(sprintf(YEZ::PARTY::VOCAB[:stat], Vocab.hit)) when :eva; @vocab.push(sprintf(YEZ::PARTY::VOCAB[:stat], Vocab.eva)) when :cri; @vocab.push(sprintf(YEZ::PARTY::VOCAB[:stat], Vocab.cri)) when :odds; @vocab.push(sprintf(YEZ::PARTY::VOCAB[:stat], Vocab.odds)) when :res next unless $imported["BattlerStatRES"] @vocab.push(sprintf(YEZ::PARTY::VOCAB[:stat], Vocab.res)) when :dex next unless $imported["BattlerStatDEX"] @vocab.push(sprintf(YEZ::PARTY::VOCAB[:stat], Vocab.dex)) when :dur next unless $imported["ClassStatDUR"] @vocab.push(sprintf(YEZ::PARTY::VOCAB[:stat], Vocab.dur)) when :luk next unless $imported["ClassStatLUK"] @vocab.push(sprintf(YEZ::PARTY::VOCAB[:stat], Vocab.luk)) else; next end @data.push(command) end @item_max = @data.size create_contents for i in 0..(@item_max-1); draw_item(i); end end
#-------------------------------------------------------------------------- # draw_item #-------------------------------------------------------------------------- def draw_item(index) rect = item_rect(index) self.contents.clear_rect(rect) text = @vocab[index] return if text == nil icon = YEZ::PARTY::CLEAR_ICON if $imported["Icons"] and YEZ::ICONS.include?(@data[index]) icon = YEZ::ICONS[@data[index]] end draw_icon(icon, rect.x, rect.y) rect.x += 24 rect.width -= 28 self.contents.draw_text(rect, text, 0) end
end # Window_PartyAssort
#=============================================================================== # # END OF FILE # #===============================================================================
Merci d'avance à la personne qui pourra m'aider. =)
Je le sais bien seulement au début le PHS ne figure pas dans le menu pour la simple et bonne raison qu'il devient accessible un peu plus tard après et ensuite celui des leader permet un changement plus rapide et évite de passé dans le menu.
Zangther
Maître des Duels
Age : 32 Inscrit le : 29/07/2009 Messages : 7841
Sujet: Re: [Résolu][Script] Problème de compatibilité Jeu 5 Aoû 2010 - 19:35
t'as essayé de le faire en event sinon ?
Garruk
Aventurier Lv.16
Age : 40 Inscrit le : 03/09/2009 Messages : 1503
Sujet: Re: [Résolu][Script] Problème de compatibilité Sam 7 Aoû 2010 - 18:05
Le problème c'est que j'ai un paquet de perso (15 sont prévus) et certains sont cacher + les monstres qu'ont peu amadouer ça fait vraiment trop de perso et je passe mais journée à faire des event pour chaque perso comme le leader peut ne pas être le même, c'est surtout pour ça que j'ai besoin de ce script et je me sert des condition si tel actor est présent et ça m'embête vraiment d'activer le PHS au début. (Prise de tête).
Blockade
Ex-Admin Cruelle
Age : 32 Inscrit le : 03/07/2008 Messages : 2441
Sujet: Re: [Résolu][Script] Problème de compatibilité Sam 7 Aoû 2010 - 19:23
J'adore quand on nous fourni un script qui marche pas.. Mais franchement c'est super sympa.. Bon ca va les deux méthodes qui manquaient j'ai réussi à les refaires parce qu'elle étaient obvious m'enfin.. Donc la prochaine fois tu copie un script qui marche ou tu me passe les scripts qui vont avec pour le faire fonctionner
Passons ce problème j'ai corrigé le script de Sihn, enfin adapté au PHS. En fait Yanfly utilise sa propre méthode pour classer les héros et il faut utiliser
Code:
$game_party.battlers
et non pas
Code:
$game_party.actors
Tu tu copie ca en dessous du script de Sihn :
Code:
#============================================================================= # PATCH - Switcheur de héros #----------------------------------------------------------------------------- # Créé par Sihn, à partir du menu tournant de MakirouAru # Patch de compatibilité avec Party Selection System de Yanfly par Blockade # Conçu pour RMVX # Version 2.4 #=============================================================================
#============================================================================= # Scene_Map #============================================================================= class Scene_Map
alias ring_system_update update def update if @switcheur_window != nil if @switcheur_window.disposed? if $game_temp.switcheur_result and @switcheur_window.index != 0 target_actor = $game_party.battlers[@switcheur_window.index] while $game_party.battlers[0] != target_actor actor = $game_party.battlers[0] $game_party.battlers.delete_at(0) $game_party.battlers.push(actor) end $game_player.animation_id = ID_ANIMATION $game_player.refresh end $game_temp.switcheur_result = false @switcheur_window = nil else @switcheur_window.update end return end if Input.press?(SWITCHEUR_KEY) and $game_party.actors.size > 0 if SE_START != nil and SE_START != "" Audio.se_play("Audio/SE/" + SE_START, 80, 100) end @switcheur_window = Window_Switcheur.new end ring_system_update end end
Garruk
Aventurier Lv.16
Age : 40 Inscrit le : 03/09/2009 Messages : 1503
Sujet: Re: [Résolu][Script] Problème de compatibilité Sam 7 Aoû 2010 - 19:26
Merci énormément Blockade tu me sauves la vie. Pour les méthodes j'ai vu ça quand j'ai configurer son menu KGC refait par lui même. Sinon ses script marchaient chez moi ou alors j'ai mal copie celui du PHS =(
Enfin bref merci encore. =)
EDIT: D'accord promis je ne t'embêterai plus x) je voulais juste être sur qu'il fonctionne maintenant je peux édité le titre. =)
Dernière édition par CloudStrife le Sam 7 Aoû 2010 - 19:31, édité 1 fois
Blockade
Ex-Admin Cruelle
Age : 32 Inscrit le : 03/07/2008 Messages : 2441
Sujet: Re: [Résolu][Script] Problème de compatibilité Sam 7 Aoû 2010 - 19:29
De rien, mais t'es sur que t'oublie pas quelque chose ? (C'est la derniére fois que je suis gentille comme ca, y'en à marre xD)
Et pour le script à mon avis il fallait le script de menu de Yanfly avec, mais bon c'était juste pour dire que faut essayer sur une démo vierge avant tout !
Ok c'est bon t'es sauvé xD
Contenu sponsorisé
Sujet: Re: [Résolu][Script] Problème de compatibilité