Announcement
Announcement
| Crystal Fantasy takes 1st as the 2013 2nd Quarter Contest Winner!!! See the Community Announcements section. |
![]() ![]() |
Feb 28 2012, 01:27 PM
Post
#1
|
|
![]() adorable kyon ![]() Type: Undisclosed Alignment: Lawful Good |
i would like to request a compatability patch or fix with these two scripts
the two scripts im using affects the victory results, which Victory aftermath shows a window for the exp gained and items looted and so on while battle cry VX does play sounds at the beginning and at the end of the battle like an intro and ending sounds like from the tales series Battlecry VX works on the beginning of the battle cause nothing affects the beginning of the battle while after the battle, no sounds where played when you succesfully ended the battle, instead just the victory aftermath which makes the two incompatible here is the script for Victory aftermath: [codebox]#=============================================================================== # # Yanfly Engine Zealous - Victory Aftermath # Last Date Updated: 2010.01.17 # Level: Normal, Hard, Lunatic # # The victory aftermath scene after battles are finished hardly display any # data at all for the player. All that's generally mentioned is how much EXP # they've acquired, who levels up, and what items are dropped in only a message # box window. Now, the whole process is more visual and will contain lists to # show the player what changes have been made as far as the victory portion is # concerned. The item drop list will also no longer go on and on forever with # the message windows, but instead, show them properly in a list window. # #=============================================================================== # Updates # ----------------------------------------------------------------------------- # o 2010.01.17 - Custom Message System compatibility. # o 2010.01.03 - Started Script and Finished. #=============================================================================== # 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. # #=============================================================================== # Compatibility # ----------------------------------------------------------------------------- # - Works With: YEZ Party Selection System # ----------------------------------------------------------------------------- # Note: This script may not work with former Yanfly Engine ReDux scripts. # Use Yanfly Engine Zealous scripts to work with this if available. #=============================================================================== $imported = {} if $imported == nil $imported["VictoryAftermath"] = true module YEZ module VICTORY #=========================================================================== # Basic Settings # -------------------------------------------------------------------------- # The following below will adjust the basic settings and vocabulary that # will display throughout the script. Change them as you see fit. #=========================================================================== # This is how many frames to wait before displaying the victory aftermath # scene on the screen. WAIT = 60 # The following adjusts the two switches that are associated with this # script so bind them accordingly. Bypassing the BGM will cause no BGM # change from battle start to end. Skip victory switch will cause the # victory display portion to be ignored (but gaining EXP and such will # still occur). BYPASS_BGM_SWITCH = 61 SKIP_VICTORY_SWITCH = 62 # This hash adjusts the vocabulary used throughout the script. VOCAB ={ :top_message => "Battle Results", :gold_found => "Found %s Gold", :exp_receive => "Earned %s EXP", :percent_exp => "%1.2f%%", :next_level => "To Level %s", :max_level => "Max Level", :next_exp => "%s EXP", :level_up => "LEVELS UP", :to_level => "to Level %s", :level_msg => "%s has reached level %s!", :next_stat => "→", :new_skills => "Skills Acquired", :spoils => "Victory Spoils", :no_items => "No items were found.", :found_items => "%s has found items!", :item_amount => "×%2d", } # Do not remove this. # This determines the gauge information for the victory screens. FACE_OPACITY = 200 # This adjusts the opacity of the actor's faces EXP_TICKS = 10 # This is how many ticks it takes to fill the gauge. EXP_GAUGE_1 = 28 # Experience gauge color 1 for non-leveled characters. EXP_GAUGE_2 = 29 # Experience gauge color 2 for non-leveled characters. EXP_FONT_SIZE = 18 # Font size used for experience gauge. LVL_COLOUR = 6 # Text color used for leveling up. LVL_GAUGE_1 = 20 # Experience gauge color 1 for leveled characters. LVL_GAUGE_2 = 21 # Experience gauge color 2 for leveled characters. #=========================================================================== # Experience Settings # -------------------------------------------------------------------------- # The following below allows you to adjust the amount of experience each # actor will earn and the rules that govern the experience gained. #=========================================================================== # If any allies are dead, are they allowed to gain EXP? DEAD_ALLY_EXP = false # Do you want the game to scale the experience based on how many actors are # in the party? This means actors can earn more or less. PARTY_SPLIT_EXP = false PARTY_SIZE_SCALING ={ 1 => 1.000, # If one actor is active. 2 => 0.500, # If two actors are active. 3 => 0.334, # If three actors are active. 4 => 0.250, # If four actors are active. 5 => 0.200, # If five actors are active. 6 => 0.167, # If six actors are active. 7 => 0.143, # If seven actors are active. 8 => 0.125, # If eight actors are active. } # Do not remove this. # The following will determine how HP and MP recovery is calculated upon # leveling up. 0 - no change. 1 - difference from max. 2 - full recovery. HP_RECOVERY = 1 # Adjusts HP Recovery Style MP_RECOVERY = 1 # Adjusts MP Recovery Style #=========================================================================== # Level Settings # -------------------------------------------------------------------------- # The following below allows you to adjust the amount of experience each # actor will earn and the rules that govern the experience gained. #=========================================================================== # The following array determines which stats will be shown with level up # increases and also what order. Only the following can be used. # :maxhp, :maxmp, :atk, :def, :spi, :res, :dex, :agi SHOWN_STATS = [:maxhp, :maxmp, :atk, :def, :spi, :res, :dex, :agi] # The following hash adjusts the colours used to display each of the # various objects inside of the level window. LEVEL_COLOURS ={ :stat_name => 4, # The stat's name. :arrow => 4, # Arrow in between the old and new stats. :old_stat => 5, # The older unleveled stat. :new_stat => 6, # The newer leveled stat. } # Do not remove this. # Changing the following value to an icon ID will change the → arrow to use # an icon instead. i.e. ARROW_ICON = 142 ARROW_ICON = nil # Changing the following below will show the change in stat difference from # the old stat to the new stat rather than just showing the new stat. SHOW_DIFFERENCE = false #=========================================================================== # Audio Settings # -------------------------------------------------------------------------- # This part of the module adjusts everything that's audio related. Be sure # to modify them accordingly. #=========================================================================== # This victory BGM will play once the fanfare finishes. BGM = RPG::BGM.new("Field1", 100, 100) # This sound adjusts the ticking noise that occurs as the experience bar # goes upward. Adjust it accordingly. TICK_SOUND = RPG::SE.new("Decision1", 80, 100) # The following adjusts how long to play the Victory ME after finishing # battle in milliseconds (if it is still continuing). FANFARE_FADE = 1000 # This is the level up sound that plays when an actor levels up. LEVEL_SOUND = RPG::SE.new("Flash1", 100, 100) # This is the sound that will play if items were found. ITEM_SOUND = RPG::SE.new("Item1", 80, 100) end # VICTORY end # YEZ #=============================================================================== # Lunatic Mode - Victory Aftermath # ----------------------------------------------------------------------------- # This mode allows you to add in a bit more of a personal touch to your game by # adding in victory battle quotes. If they're on, actors who were participating # in battle can brief the victory spoils and whatnot. # # To use this mode, bind each actor to a common event ID. Those common events # will play out the messages written for them. However, to distinguish when to # display each message, use conditional branches with a script value check. # Insert the following into your script value checks: # # victory_quote("Main") Occurs at the first page of victory. # victory_quote("JP") Requires YEZ Job System: Base. # victory_quote("Level") Occurs when leveling up your character. # victory_quote("Skill") Occurs when leveling up and learning a skill. # victory_quote("Nothing") Occurs when no drops are found. # victory_quote("Drops") Occurs if the enemy has left drops. # # When displaying the message events, a few new text shortcuts should be taken # note of. They are the two following: # # \VN This displays the talking actor's name. # \VF This displays the talking actor's face. # # Anything else in the common event will run normally. #=============================================================================== module YEZ::VICTORY # If this is enabled, victory quotes will occur instead of the typical # battle end messages. ENABLE_QUOTES = false # The following hash determines which common event ID's are bound to which # actors when their victory quotes are to be launched. ACTOR_QUOTES ={ # Actor 0 is the actor used for unlisted actors. # ActorID => Common Event ID 0 => 20, # Common Victory Quotes 1 => 21, # Ralph's Victory Quotes 2 => 22, # Ulrika's Victory Quotes 3 => 23, # Bennett's Victory Quotes 4 => 24, # Ylva's Victory Quotes 5 => 25, # Lawrence's Victory Quotes 6 => 26, # Oscar's Victory Quotes 7 => 27, # Vera's Victory Quotes 8 => 28, # Elmer's Victory Quotes } # Do not remove this. end # YEZ::VICTORY #=============================================================================== # 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. #=============================================================================== #=============================================================================== # Game_Temp #=============================================================================== class Game_Temp #-------------------------------------------------------------------------- # public instance variables #-------------------------------------------------------------------------- attr_accessor :victory_actor attr_accessor :victory_quote attr_accessor :victory_clone end # Game_Temp #=============================================================================== # Game_Actor #=============================================================================== class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # new method: learned_skills #-------------------------------------------------------------------------- def learned_skills result = [] for i in @skills result.push($data_skills[i]) end return result end #-------------------------------------------------------------------------- # new method: now_exp #-------------------------------------------------------------------------- def now_exp return @exp - @exp_list[@level] end #-------------------------------------------------------------------------- # new method: next_exp #-------------------------------------------------------------------------- def next_exp return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0 end end # Game_Actor #============================================================================== # Game_Interpreter #============================================================================== class Game_Interpreter #-------------------------------------------------------------------------- # victory_quote #-------------------------------------------------------------------------- def victory_quote(text) return false unless $game_temp.in_battle and $scene.is_a?(Scene_Battle) return false if $game_temp.victory_quote == nil return true if text.upcase == $game_temp.victory_quote return false end end # Game_Interpreter #=============================================================================== # Scene Map #=============================================================================== class Scene_Map < Scene_Base #-------------------------------------------------------------------------- # alias method: call battle #-------------------------------------------------------------------------- alias call_battle_va call_battle unless $@ def call_battle if $game_switches[YEZ::VICTORY::BYPASS_BGM_SWITCH] @spriteset.update Graphics.update $game_player.make_encounter_count $game_player.straighten $game_temp.map_bgm = RPG::BGM.last $game_temp.map_bgs = RPG::BGS.last Sound.play_battle_start $game_temp.next_scene = nil $scene = Scene_Battle.new else call_battle_va end end end # Scene Map #=============================================================================== # Scene_Battle #=============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # alias method: terminate #-------------------------------------------------------------------------- alias terminate_va terminate unless $@ def terminate @top_window.dispose if @top_window != nil @exp_window.dispose if @exp_window != nil @gold_window.dispose if @gold_window != nil @exp_back_window.dispose if @exp_back_window != nil @exp_front_window.dispose if @exp_front_window != nil @drops_window.dispose if @drops_window != nil terminate_va end #-------------------------------------------------------------------------- # overwrite method: process_victory #-------------------------------------------------------------------------- def process_victory wait(YEZ::VICTORY::WAIT, true) @info_viewport.visible = false if $imported["BattleEngineZealous"] @message_window.dispose @message_window = Window_BattleMessage.new elsif $imported["VictoryCompatibility"] @message_window.dispose @message_window = Window_BattleMessageCompatible.new end @message_window.visible = true unless $game_switches[YEZ::VICTORY::BYPASS_BGM_SWITCH] RPG::BGM.stop $game_system.battle_end_me.play YEZ::VICTORY::BGM.play unless YEZ::VICTORY::BGM == nil end create_victory_clones create_victory_actor display_exp_and_gold display_level_up display_drop_items battle_end(0) $game_temp.victory_actor = nil $game_temp.victory_clone = nil if $imported["BattleEngineZealous"] and YEZ::BATTLE::ZEALOUS::COMMON_EVENTS[:battle_end] != nil common_event = YEZ::BATTLE::ZEALOUS::COMMON_EVENTS[:battle_end] $game_temp.common_event_id = common_event end victory_me = Thread.new { time = YEZ::VICTORY::FANFARE_FADE RPG::ME.fade(time) sleep(time / 1000.0) RPG::ME.stop } battle_end(0) end #-------------------------------------------------------------------------- # overwrite method: display_exp_and_gold #-------------------------------------------------------------------------- def display_exp_and_gold unless $game_switches[YEZ::VICTORY::SKIP_VICTORY_SWITCH] show_exp_and_gold else @exp = $game_troop.exp_total if YEZ::VICTORY::PARTY_SPLIT_EXP size = YEZ::VICTORY::DEAD_ALLY_EXP ? $game_party.members.size : $game_party.existing_members.size @exp = Integer(@exp * YEZ::VICTORY::PARTY_SIZE_SCALING[size]) end $game_party.gain_gold($game_troop.gold_total) end end #-------------------------------------------------------------------------- # overwrite method: display_level_up #-------------------------------------------------------------------------- def display_level_up unless $game_switches[YEZ::VICTORY::SKIP_VICTORY_SWITCH] show_level_up else group = YEZ::VICTORY::DEAD_ALLY_EXP ? $game_party.members : $game_party.existing_members for actor in group last_level = actor.level last_skills = actor.learned_skills.clone actor.gain_exp(@exp, false) end if $imported["PartySelectionSystem"] @exp = Integer(@exp * YEZ::PARTY::BATTLE_RESERVE_EXP) for actor in $game_party.reserve_members last_level = actor.level last_skills = actor.learned_skills.clone actor.gain_exp(@exp, false) if actor.exist? or YEZ::VICTORY::DEAD_ALLY_EXP end end end end #-------------------------------------------------------------------------- # overwrite method: display_drop_items #-------------------------------------------------------------------------- def display_drop_items @active_battler = nil unless $game_switches[YEZ::VICTORY::SKIP_VICTORY_SWITCH] show_drop_items else drop_items = $game_troop.make_drop_items for item in drop_items; $game_party.gain_item(item, 1); end end end #-------------------------------------------------------------------------- # new method: create_victory_clones #-------------------------------------------------------------------------- def create_victory_clones $game_temp.victory_clone = {} $game_temp.in_battle = false for actor in $game_party.members $game_temp.victory_clone[actor.id] = actor.clone end $game_temp.in_battle = true end #-------------------------------------------------------------------------- # new method: create_victory_actor #-------------------------------------------------------------------------- def create_victory_actor $game_temp.victory_actor = nil @original_victory_actor = victory_actor end #-------------------------------------------------------------------------- # new method: victory_actor #-------------------------------------------------------------------------- def victory_actor if $game_temp.victory_actor == nil roulette = [] for actor in $game_party.existing_members; roulette.push(actor); end $game_temp.victory_actor = roulette.size > 0 ? roulette[rand(roulette.size)] : nil end return $game_temp.victory_actor end #-------------------------------------------------------------------------- # new method: victory_actor_quote #-------------------------------------------------------------------------- def victory_actor_quote(value) $game_temp.victory_quote = value if YEZ::VICTORY::ACTOR_QUOTES.include?(victory_actor.id) $game_temp.common_event_id = YEZ::VICTORY::ACTOR_QUOTES[victory_actor.id] else $game_temp.common_event_id = YEZ::VICTORY::ACTOR_QUOTES[0] end @message_window.visible = true process_victory_event end #-------------------------------------------------------------------------- # new method: process_victory_event #-------------------------------------------------------------------------- def process_victory_event loop do $game_troop.interpreter.update $game_troop.setup_battle_event wait_for_message return unless $game_troop.interpreter.running? update_basic end end #-------------------------------------------------------------------------- # new method: show_exp_and_gold #-------------------------------------------------------------------------- def show_exp_and_gold #--- Draw Victory Message @top_window = Window_Help.new text = YEZ::VICTORY::VOCAB[:top_message] @top_window.set_text(text, 1) #--- Draw EXP Window @exp = $game_troop.exp_total if YEZ::VICTORY::PARTY_SPLIT_EXP size = YEZ::VICTORY::DEAD_ALLY_EXP ? $game_party.members.size : $game_party.existing_members.size @exp = Integer(@exp * YEZ::VICTORY::PARTY_SIZE_SCALING[size]) end @exp_window = Window_Base.new(272, 56, 272, 56) text = sprintf(YEZ::VICTORY::VOCAB[:exp_receive], @exp) @exp_window.contents.draw_text(0, 0, 240, 24, text, 1) #--- Draw Gold Window @gold = $game_troop.gold_total $game_party.gain_gold(@gold) @gold_window = Window_Base.new(0, 56, 272, 56) text = sprintf(YEZ::VICTORY::VOCAB[:gold_found], @gold) @gold_window.contents.draw_text(0, 0, 240, 24, text, 1) #--- Draw Party EXP Windows @exp_back_window = Window_Party_Exp_Back.new @exp_front_window = Window_Party_Exp_Front.new fill_exp_gauge #--- Battle Quotes if YEZ::VICTORY::ENABLE_QUOTES victory_actor_quote("MAIN") else text = sprintf(Vocab::Victory, $game_party.name) $game_message.texts.push(text) wait_for_message end end #-------------------------------------------------------------------------- # new method: fill_exp_gauge #-------------------------------------------------------------------------- def fill_exp_gauge ticks = 0 percent = 0 increase = 100 / YEZ::VICTORY::EXP_TICKS until ticks > YEZ::VICTORY::EXP_TICKS ticks += 1 percent += increase @exp_front_window.refresh(percent) if @exp_front_window.full_actors != $game_party.existing_members.size YEZ::VICTORY::TICK_SOUND.play if YEZ::VICTORY::TICK_SOUND != nil end update_basic end end #-------------------------------------------------------------------------- # new method: show_level_up #-------------------------------------------------------------------------- def show_level_up @exp_window.visible = false @gold_window.visible = false @exp_back_window.visible = false @exp_front_window.visible = false group = YEZ::VICTORY::DEAD_ALLY_EXP ? $game_party.members : $game_party.existing_members for actor in group last_level = actor.level last_skills = actor.learned_skills.clone actor.gain_exp(@exp, false) create_level_up_windows(actor, last_skills) if actor.level > last_level end if $imported["PartySelectionSystem"] @exp = Integer(@exp * YEZ::PARTY::BATTLE_RESERVE_EXP) for actor in $game_party.reserve_members last_level = actor.level last_skills = actor.learned_skills.clone actor.gain_exp(@exp, false) if actor.exist? or YEZ::VICTORY::DEAD_ALLY_EXP create_level_up_windows(actor, last_skills) if actor.level > last_level end end wait_for_message end #-------------------------------------------------------------------------- # new method: create_level_up_windows #-------------------------------------------------------------------------- def create_level_up_windows(actor, last_skills) @active_battler = actor #--- Basic Settings YEZ::VICTORY::LEVEL_SOUND.play if YEZ::VICTORY::LEVEL_SOUND != nil $game_temp.victory_actor = actor new_skills = actor.learned_skills - last_skills @top_window.contents.clear text = sprintf(YEZ::VICTORY::VOCAB[:level_msg], actor.name, actor.level) @top_window.set_text(text, 1) case YEZ::VICTORY::HP_RECOVERY when 1; actor.hp += actor.maxhp - $game_temp.victory_clone[actor.id].maxhp when 2; actor.hp = actor.maxhp end case YEZ::VICTORY::MP_RECOVERY when 1; actor.mp += actor.maxmp - $game_temp.victory_clone[actor.id].maxmp when 2; actor.mp = actor.maxmp end #--- Create Windows if new_skills != [] @levelup_window = Window_Level_Up.new(actor, 0, 56, 316, 232) @skill_back_window = Window_Base.new(316, 56, 228, 232) @skill_back_window.contents.font.color = @skill_back_window.system_color text = YEZ::VICTORY::VOCAB[:new_skills] @skill_back_window.contents.draw_text(0, 0, 196, 24, text, 1) @skill_list_window = Window_New_Skills.new(new_skills) else @levelup_window = Window_Level_Up.new(actor, 0, 56, 544, 232) end if YEZ::VICTORY::ENABLE_QUOTES value = (last_skills != actor.learned_skills) ? "SKILL" : "LEVEL" victory_actor_quote(value) else text = sprintf(Vocab::LevelUp, actor.name, Vocab::level, actor.level) $game_message.new_page $game_message.texts.push(text) if new_skills != [] for skill in new_skills text = sprintf(Vocab::ObtainSkill, skill.name) $game_message.texts.push(text) end end wait_for_message end #--- Skill Window Scrolling if new_skills.size > 7 @skill_list_window.index = 0 @skill_list_window.active = true @skill_list_window.help_window = @top_window loop do update_basic @skill_list_window.update if Input.trigger?(Input::C) Sound.play_decision; break elsif Input.trigger?(Input:: Sound.play_cancel; break elsif Input.press?(Input::A) break end end end #--- Disposal of Windows @levelup_window.dispose if @levelup_window != nil @levelup_window = nil @skill_back_window.dispose if @skill_back_window != nil @skill_back_window = nil @skill_list_window.dispose if @skill_list_window != nil @skill_list_window = nil #--- HP and MP Recovery end #-------------------------------------------------------------------------- # new method: show_drop_items #-------------------------------------------------------------------------- def show_drop_items @drop_items = $game_troop.make_drop_items for item in @drop_items; $game_party.gain_item(item, 1); end if @drop_items != [] @top_window.set_text(YEZ::VICTORY::VOCAB[:spoils],1) YEZ::VICTORY::ITEM_SOUND.play if YEZ::VICTORY::ITEM_SOUND != nil @drops_window = Window_BattleDrops.new(@drop_items) else @top_window.set_text(YEZ::VICTORY::VOCAB[:no_items],1) @exp_window.visible = true @gold_window.visible = true @exp_back_window.visible = true @exp_front_window.visible = true @exp_front_window.refresh end if YEZ::VICTORY::ENABLE_QUOTES $game_temp.victory_actor = @original_victory_actor value = (@drop_items == []) ? "NOTHING" : "DROPS" victory_actor_quote(value) else if @drop_items == [] text = YEZ::VICTORY::VOCAB[:no_items] else text = sprintf(YEZ::VICTORY::VOCAB[:found_items], $game_party.name) end $game_message.texts.push(text) wait_for_message end if @drop_items != [] and @drops_window.item_max > 16 @drops_window.index = 0 @drops_window.active = true @drops_window.help_window = @top_window loop do update_basic @drops_window.update if Input.trigger?(Input::C) Sound.play_decision; break elsif Input.trigger?(Input:: Sound.play_cancel; break elsif Input.press?(Input::A) break end end end end end # Scene_Battle #=============================================================================== # Window_Message #=============================================================================== class Window_Message < Window_Selectable #-------------------------------------------------------------------------- # alias method: convert_special_characters #-------------------------------------------------------------------------- unless $imported["CustomMessageSystemZeal"] alias convert_special_characters_va convert_special_characters unless $@ def convert_special_characters @text.gsub!(/\\VF/i) { victory_face_art } @text.gsub!(/\\VN/i) { victory_actor_name } convert_special_characters_va end end #-------------------------------------------------------------------------- # new method: victory_actor_name #-------------------------------------------------------------------------- def victory_actor_name return "" unless $scene.is_a?(Scene_Battle) return $scene.victory_actor.name end #-------------------------------------------------------------------------- # new method: victory_face_art #-------------------------------------------------------------------------- def victory_face_art return "" unless $scene.is_a?(Scene_Battle) $game_message.face_name = $scene.victory_actor.face_name $game_message.face_index = $scene.victory_actor.face_index return "" end end # Window_Message #=============================================================================== # Window_Party_Exp_Back #=============================================================================== class Window_Party_Exp_Back < Window_Base #-------------------------------------------------------------------------- # initialize #-------------------------------------------------------------------------- def initialize super(0, 112, 544, 176) refresh end #-------------------------------------------------------------------------- # refresh #-------------------------------------------------------------------------- def refresh self.contents.clear sw = self.width - 32 dy = 0 dx = (sw/2) - $game_party.members.size*60 for actor in $game_party.members opacity = YEZ::VICTORY::FACE_OPACITY draw_party_face(actor, dx+12, dy, opacity) self.contents.draw_text(dx+12, dy, 96, WLH, actor.name, 1) dx += 120 end end #-------------------------------------------------------------------------- # Draw Party Face #-------------------------------------------------------------------------- def draw_party_face(actor, x, y, opacity = 255, size = 96) face_name = actor.face_name face_index = actor.face_index bitmap = Cache.face(face_name) rect = Rect.new(0, 0, 0, 0) rect.x = face_index % 4 * 96 + (96 - size) / 2 rect.y = face_index / 4 * 96 + (96 - size) / 2 rect.width = size rect.height = size self.contents.blt(x, y, bitmap, rect, opacity) bitmap.dispose end end # Window_Party_Exp_Back #=============================================================================== # Window_Party_Exp_Front #=============================================================================== class Window_Party_Exp_Front < Window_Base #-------------------------------------------------------------------------- # public instance variables #-------------------------------------------------------------------------- attr_accessor :full_actors #-------------------------------------------------------------------------- # initialize #-------------------------------------------------------------------------- def initialize super(0, 112, 544, 176) self.opacity = 0 refresh end #-------------------------------------------------------------------------- # refresh #-------------------------------------------------------------------------- def refresh(extra_per = 0) self.contents.clear @full_actors = 0 sw = self.width - 32 dy = WLH*4 dx = (sw/2) - $game_party.members.size*60 for actor in $game_party.members self.contents.font.color = normal_color self.contents.font.size = Font.default_size draw_exp_gauge(actor, dx, dy, extra_per) draw_exp_text(actor, dx, dy+WLH, extra_per) dx += 120 end end #-------------------------------------------------------------------------- # draw_exp_gauge #-------------------------------------------------------------------------- def draw_exp_gauge(actor, dx, dy, extra_per) self.contents.font.size = YEZ::VICTORY::EXP_FONT_SIZE gc1 = text_color(YEZ::VICTORY::EXP_GAUGE_1) gc2 = text_color(YEZ::VICTORY::EXP_GAUGE_2) if actor.level > $game_temp.victory_clone[actor.id].level gc1 = text_color(YEZ::VICTORY::LVL_GAUGE_1) gc2 = text_color(YEZ::VICTORY::LVL_GAUGE_2) gw = 96 self.contents.font.color = text_color(YEZ::VICTORY::LVL_COLOUR) text = YEZ::VICTORY::VOCAB[:level_up] elsif actor.next_exp != 0 gw = 96 * (actor.now_exp + exp_gained(extra_per, actor)) gw /= actor.next_exp gw = [[gw, 96].min, 0].max text = sprintf(YEZ::VICTORY::VOCAB[:next_level], actor.level + 1) if gw == 96 self.contents.font.color = text_color(YEZ::VICTORY::LVL_COLOUR) gc1 = text_color(YEZ::VICTORY::LVL_GAUGE_1) gc2 = text_color(YEZ::VICTORY::LVL_GAUGE_2) text = YEZ::VICTORY::VOCAB[:level_up] end else gw = 96 text = YEZ::VICTORY::VOCAB[:max_level] end self.contents.fill_rect(dx + 12, dy - 6, 96, 6, gauge_back_color) self.contents.gradient_fill_rect(dx + 12, dy - 6, gw, 6, gc1, gc2) self.contents.draw_text(dx, dy, 120, WLH, text, 1) self.contents.font.color = normal_color end #-------------------------------------------------------------------------- # draw_exp_text #-------------------------------------------------------------------------- def draw_exp_text(actor, dx, dy, extra_per) if actor.level > $game_temp.victory_clone[actor.id].level exp_percent = 100.0 text1 = sprintf(YEZ::VICTORY::VOCAB[:percent_exp], exp_percent) text2 = sprintf(YEZ::VICTORY::VOCAB[:to_level], actor.level) elsif actor.next_exp != 0 exp_percent = (actor.now_exp + exp_gained(extra_per, actor)) * 100.0 exp_percent /= actor.next_exp exp_percent = [[exp_percent, 100.0].min, 0].max @full_actors += 1 if exp_percent >= 100.0 value = [actor.next_rest_exp_s - exp_gained(extra_per, actor), 0].max text1 = sprintf(YEZ::VICTORY::VOCAB[:percent_exp], exp_percent) text2 = sprintf(YEZ::VICTORY::VOCAB[:next_exp], value) else exp_percent = 100.0 @full_actors += 1 text1 = sprintf(YEZ::VICTORY::VOCAB[:percent_exp], exp_percent) text2 = "" end self.contents.draw_text(dx, dy - WLH * 2, 120, WLH, text1, 1) self.contents.draw_text(dx, dy, 120, WLH, text2, 1) end #-------------------------------------------------------------------------- # exp_gained #-------------------------------------------------------------------------- def exp_gained(extra_per, actor) return 0 if actor.dead? extra_per = 100 if extra_per > 100 exp = $game_troop.exp_total members = $game_party.members.size if YEZ::VICTORY::PARTY_SPLIT_EXP size = YEZ::VICTORY::DEAD_ALLY_EXP ? $game_party.members.size : $game_party.existing_members.size exp = Integer(exp * YEZ::VICTORY::PARTY_SIZE_SCALING[size]) end exp *= 2 if actor.double_exp_gain exp *= extra_per exp /= 100 return exp end end # Window_Party_Exp_Front #=============================================================================== # Window_New_Skills #=============================================================================== class Window_New_Skills < Window_Selectable #-------------------------------------------------------------------------- # initialize #-------------------------------------------------------------------------- def initialize(new_skills) @new_skills = new_skills super(316, 80, 228, 208) self.index = -1 self.opacity = 0 refresh end #-------------------------------------------------------------------------- # skill #-------------------------------------------------------------------------- def skill; return @data[self.index]; end #-------------------------------------------------------------------------- # refresh #-------------------------------------------------------------------------- def refresh @data = [] for skill in @new_skills @data.push(skill) 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) skill = @data[index] return if skill == nil draw_item_name(skill, rect.x, rect.y) end #-------------------------------------------------------------------------- # update_help #-------------------------------------------------------------------------- def update_help @help_window.set_text(skill == nil ? "" : skill.description) end end # Window_New_Skills #=============================================================================== # Window_BattleDrops #=============================================================================== class Window_BattleDrops < Window_Selectable #-------------------------------------------------------------------------- # initialize #-------------------------------------------------------------------------- def initialize(drop_items) super(0, 56, 544, 232) @drop_items = drop_items @column_max = 2 self.index = -1 refresh end #-------------------------------------------------------------------------- # item #-------------------------------------------------------------------------- def item; return @data[self.index]; end #-------------------------------------------------------------------------- # refrehs #-------------------------------------------------------------------------- def refresh @items = {}; @weapons = {}; @armours = {}; @goods = {}; @data = [] for item in @drop_items case item when RPG::Item @items[item] = 0 if @items[item] == nil @items[item] += 1 when RPG::Weapon @weapons[item] = 0 if @weapons[item] == nil @weapons[item] += 1 when RPG::Armor @armours[item] = 0 if @armours[item] == nil @armours[item] += 1 end end @items = @items.sort { |a,b| a[0].id <=> b[0].id } @weapons = @weapons.sort { |a,b| a[0].id <=> b[0].id } @armours = @armours.sort { |a,b| a[0].id <=> b[0].id } for key in @items; @goods[key[0]] = key[1]; @data.push(key[0]); end for key in @weapons; @goods[key[0]] = key[1]; @data.push(key[0]); end for key in @armours; @goods[key[0]] = key[1]; @data.push(key[0]); 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) item = @data[index] return if item == nil number = @goods[item] rect.width -= 4 draw_item_name(item, rect.x, rect.y) self.contents.draw_text(rect, sprintf(YEZ::VICTORY::VOCAB[:item_amount], number), 2) end #-------------------------------------------------------------------------- # update_help #-------------------------------------------------------------------------- def update_help @help_window.set_text(item == nil ? "" : item.description) end end # Window_BattleDrops #=============================================================================== # Window_Level_Up #=============================================================================== class Window_Level_Up < Window_Base #-------------------------------------------------------------------------- # initialize #-------------------------------------------------------------------------- def initialize(actor, dx, dy, dw, dh) super(dx, dy, dw, dh) @actor = actor @clone = $game_temp.victory_clone[actor.id] refresh end #-------------------------------------------------------------------------- # refresh #-------------------------------------------------------------------------- def refresh self.contents.clear sw = self.width - 32 dy = 0; dx = sw/2 - 234/2 draw_stats(dx, dy) end #-------------------------------------------------------------------------- # draw_stats #-------------------------------------------------------------------------- def draw_stats(dx, dy) arrow = YEZ::VICTORY::VOCAB[:next_stat] colours = YEZ::VICTORY::LEVEL_COLOURS for stat in YEZ::VICTORY::SHOWN_STATS case stat when :maxhp icon = $imported["Icons"] ? YEZ::ICONS[:hp] : 0 text = Vocab.hp value1 = @clone.maxhp value2 = @actor.maxhp when :maxmp icon = $imported["Icons"] ? YEZ::ICONS[:mp] : 0 text = Vocab.mp value1 = @clone.maxmp value2 = @actor.maxmp when :atk icon = $imported["Icons"] ? YEZ::ICONS[:atk] : 0 text = Vocab.atk value1 = @clone.atk value2 = @actor.atk when :def icon = $imported["Icons"] ? YEZ::ICONS[:def] : 0 text = Vocab.def value1 = @clone.def value2 = @actor.def when :spi icon = $imported["Icons"] ? YEZ::ICONS[:spi] : 0 text = Vocab.spi value1 = @clone.spi value2 = @actor.spi when :agi icon = $imported["Icons"] ? YEZ::ICONS[:agi] : 0 text = Vocab.agi value1 = @clone.agi value2 = @actor.agi when :dex next unless $imported["BattlerStatDEX"] icon = $imported["Icons"] ? YEZ::ICONS[:dex] : 0 text = Vocab.dex value1 = @clone.dex value2 = @actor.dex when :res next unless $imported["BattlerStatRES"] icon = $imported["Icons"] ? YEZ::ICONS[:res] : 0 text = Vocab.res value1 = @clone.res value2 = @actor.res else; next end value2 = sprintf("%+d", value2 - value1) if YEZ::VICTORY::SHOW_DIFFERENCE draw_icon(icon, dx, dy) self.contents.font.color = text_color(colours[:stat_name]) self.contents.draw_text(dx+24, dy, 60, WLH, text, 0) self.contents.font.color = text_color(colours[:old_stat]) self.contents.draw_text(dx+84, dy, 60, WLH, value1, 2) if YEZ::VICTORY::ARROW_ICON.is_a?(Integer) draw_icon(YEZ::VICTORY::ARROW_ICON, dx+147, dy) else self.contents.font.color = text_color(colours[:arrow]) self.contents.draw_text(dx+144, dy, 30, WLH, arrow, 1) end self.contents.font.color = text_color(colours[:new_stat]) self.contents.draw_text(dx+174, dy, 60, WLH, value2, 0) dy += WLH end end end # Window_Level_Up #=============================================================================== # # END OF FILE # #===============================================================================[/codebox] while here is the code for Battlecry VX: [codebox]#======================================================================= # Battle Cry VX version 1.00 #----------------------------------------------------------------------- # Function: # Plays user configured battle cries for characters at the start # of battle and at the end of battle. # Pre-battle cries are selected by the difficulty of the enemy # troop, and post-battle cries are selected by the remaining # hp percentage of the actor that scored the final blow. # # Compatibility: # This script -should- be compatible with other custom battle scripts # but compatibility has not as of yet been tested. # # Instructions: # Simply configure the arrays of actor sounds in the case statements # More detailed instructions will be given in the respective areas. # Only skills truly needed are typing, copy, and paste. #----------------------------------------------------------------------- # Contact: # Should you encounter a bug or incompatibility with this script, # e-mail NAMKCOR at Rockman922@hotmail.com, or message at # http://www.rmrk.net or http://forum.chaos-project.com # # This script was designed for use and distribution only on # The RPG Maker Resource Kit (RMRK) and Chaos Project. # If this script is found posted on any other website, it is STOLEN # and it is advised to contact NAMKCOR at the above methods. # # This script is -strictly- for NON-commercial purposes. Please # credit NAMKCOR for the creation of this script if you use it. #======================================================================= module NAMKCOR #======================================================================= # volume: simply set the return value to be equal to the volume # you want the battlecries to be played at #======================================================================= def self.volume return 100 end #======================================================================= # battle_range: set the return value to be how many levels above or # below the enemy for easy/difficult battles. #======================================================================= def self.battle_range return 5 end #======================================================================= # mid_hp: set the return value to be the percentage of hitpoints that # is the -minimum- value for being in 'middle' hp range. #======================================================================= def self.mid_hp return 50 end #======================================================================= # high_hp: set the return value to be the percentage of hitpoints that # is the -minimum- value for being in 'high' hp range. #======================================================================= def self.high_hp return 200 end #======================================================================= # bosses: to add a boss, simply create a "when" clause for the # troop id, and set the 'return' value to 'true' # do not touch the 'else' clause # example: # when 5 # return true #======================================================================= def self.bosses(id) case id when 1 return true when 10 return true else return false end end #======================================================================= # troop_level: to set a troop level, create a "when" clause for the # troop id, and set the 'return' value to be the level # desired. do not touch the 'else' clause. # THERE MUST BE AN ENTRY FOR EVERY TROOP IN THE DATABASE # example: # when 5 # return 3 #======================================================================= def self.troop_level(id) case id when 2 return 5 when 3 return 5 when 4 return 10 else return 0 end end #======================================================================= # start_battlecry: to add a new actor's set of battlecries to the # listing, create a "when" clause for the actor's id # and the return value to an array, configured as follows. # array config: ["easy_battle_se", "normal_battle_se", "hard_battle_se", # "boss_battle_se"] # the values in "" are the names of the sound files. # ALL SOUND FILES MUST BE PLACED IN 'AUDIO/Battlecry' # # Suggestion: for organization's sake, try naming the files by actor id # # example: # when 3 # return ["easy","normal","hard","boss"] #======================================================================= def self.start_battlecry(id) case id when 1 return ["L1", "L2", "L3", "L4"] when 2 return ["A1", "A2", "A3", "A4"] when 3 return ["S1", "S2", "S3", "S4"] when 4 return ["M1", "M2", "M3", "M4"] when 5 return ["R1", "R2", "R3", "R4"] when 6 return ["O1", "O2", "O3", "O4"] else return nil end end #======================================================================= # victory_battlecry: to add a new actor's set of battlecries to the # listing, create a "when" clause for the actor's id # and the return value to an array, configured as follows. # array config: ["highHP_win", "normalHP_win", "lowHP_win"] # the values in "" are the names of the sound files. # ALL SOUND FILES MUST BE PLACED IN 'AUDIO/Battlecry' # # Suggestion: for organization's sake, try naming the files by actor id # # example: # when 3 # return ["high","normal","hurting"] #======================================================================= def self.victory_battlecry(id) case id when 1 return ["LW1","LW2","LW3"] when 2 return ["AW1", "AW2", "AW3"] when 3 return ["SW1", "SW2", "SW3"] when 4 return ["MW1", "MW2", "MW3"] when 5 return ["RW1", "RW2", "RW3"] when 6 return ["OW1", "OW2", "OW3"] else return nil end end end #======================================================================= # DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING #======================================================================= class Game_Troop < Game_Unit def id return @troop_id end end class Scene_Battle < Scene_Base alias :old_start :start def start old_start @id = $game_party.members[rand($game_party.members.size)] if NAMKCOR.bosses($game_troop.id) == true @type = 3 else if (@id.level + NAMKCOR.battle_range) <= NAMKCOR.troop_level($game_troop.id) @type = 2 elsif (@id.level - NAMKCOR.battle_range) >= NAMKCOR.troop_level($game_troop.id) @type = 0 else @type = 1 end end @bcArray = NAMKCOR.start_battlecry(@id.id) if @bcArray[@type] != nil Audio.se_play("Audio/Battlecry/" + @bcArray[@type], NAMKCOR.volume, 0) end end alias :old_victory :process_victory def process_victory @hp_percent = (@active_battler.hp / @active_battler.maxhp) * 100 if @hp_percent < NAMKCOR.mid_hp @hp_state = 2 elsif @hp_percent > NAMKCOR.high_hp @hp_state = 1 else @hp_state = 0 end @bcArray = NAMKCOR.victory_battlecry(@active_battler.id) if @bcArray[@hp_state] != nil Audio.se_play("Audio/Battlecry/" + @bcArray[@hp_state], NAMKCOR.volume, 0) end old_victory end end [/codebox] note: Battlecry VX is placed at the topmost of all the scripts (below main) cause it won't work if it is below or in middle while for the victory aftermath i placed it in either middle and below -------------------- I support:
Spoiler: My game: Spoiler: ![]() |
|
|
|
Mar 3 2012, 05:32 AM
Post
#2
|
|
![]() adorable kyon ![]() Type: Undisclosed Alignment: Lawful Good |
bump
-------------------- I support:
Spoiler: My game: Spoiler: ![]() |
|
|
|
Mar 3 2012, 06:10 PM
Post
#3
|
|
![]() Type: Coder |
there's obviously compatibility issues between these two scripts. obvious comment.
I would look through both of those scripts side-by-side (if you have Windows 7 this is easy) and see if there are any overwritten methods, classes, etc. that are in conflict with one another. Also, see if both scripts try to alias the same method. Ruby doesn't allow for aliasing a method twice, to my knowledge. if you were to fix any issues like that, it should theoretically fix the whole issue. -------------------- See everything I'm up to in my web page.
Current project(s): Lost in the Dark(working title): ±2% complete (resource editing) Blacklight Menu System: -5% (planning stages) |
|
|
|
Mar 4 2012, 12:51 AM
Post
#4
|
|
![]() adorable kyon ![]() Type: Undisclosed Alignment: Lawful Good |
i didn't understand XD haha
well yep i guess there's compatibility issue -------------------- I support:
Spoiler: My game: Spoiler: ![]() |
|
|
|
Mar 5 2012, 05:51 PM
Post
#5
|
|
![]() Type: Coder |
What didn't you understand? Looking through the scripts?
If you were to copy the scripts individually into new Notepad files without formatting, you can look through them at the same time. That way you can see if both scripts try to overwrite the same class, or alias the same method in a class. If the scripts both overwrite a class, the bottom-mpst overwrite will take effect. Since your Battlecry script is bottom-most and not working, that isnt the case, most likely. Which leaves aliases. Aliasing, to my understanding, is a method of overwriting a method without it messing up another script that needs that method as is. The way that Ruby scripting works, you are completely unable to alias the same method twice, or alias an alias. For all intents and purposes it renames a method, allowing you to make changes to that renamed method. That beig said, it shouldn't be hard to see if the aliasing issue is a thing that happened. -------------------- See everything I'm up to in my web page.
Current project(s): Lost in the Dark(working title): ±2% complete (resource editing) Blacklight Menu System: -5% (planning stages) |
|
|
|
Mar 18 2012, 01:55 AM
Post
#6
|
|
![]() Type: Coder Alignment: Neutral Good |
Try put Battlercry VX script after Victory Aftermath script.
Victory Aftermath script overwrite process_victory method while Battlecry VX alias that method. |
|
|
|
Apr 4 2012, 10:54 AM
Post
#7
|
|
![]() That's all, folks! ![]() Type: Coder Alignment: Chaotic Neutral |
Try put Battlercry VX script after Victory Aftermath script. Victory Aftermath script overwrite process_victory method while Battlecry VX alias that method. Good idea, it should work. If not, maybe would be a good idea to merge the two 'process_victory'(Scene_Battle) in the desired manner. donleon, how it should work? -------------------- ![]() |
|
|
|
![]() ![]() |
| Lo-Fi Version | Time is now: 19th June 2013 - 01:29 AM |
|
|