battle dome help

Started by nathmatt, February 28, 2011, 08:56:24 pm

Previous topic - Next topic

nathmatt

ok so in trying to get an event command to run after battle but it doesn't seem to run

i created my hash to make things easier
@keys = {0 => 601, 1 => 602, 2 => 603}


i have this to get the commands for each result

class Interpreter
 
  alias battle_dome_command_301 command_301
  def command_301
    $Battle_Dome.event = @event_id
    ((@index+1)..@list.size).each{|i|
    case @list[i].code
    when 301 then break
    when 601,602
      id = $Battle_Dome.keys.index(@list[i].code)
      $Battle_Dome.list.push([id,@list[i+1]])
    when 603
      id = $Battle_Dome.keys.index(@list[i].code)
      $Battle_Dome.list.push([id,@list[i+1]])
      break
    end}
    battle_dome_command_301
  end
 
end


and this to get the command needed

def set_result(i)
  return if $game_temp.battle_proc == nil
  @list.each{|a|@list = a[1] if a[0] == i}
  $game_temp.battle_proc = nil
end


this so i can edit the list

class Game_Event
  attr_accessor :list
end


and finally this to in Scene_Map update to run the event after leaving

if !$Battle_Dome.in_battle && $Battle_Dome.event != nil && 
    !$game_temp.player_transferring
  $game_map.events[$Battle_Dome.event].list = [$Battle_Dome.list]
  $game_map.events[$Battle_Dome.event].start
  $game_map.events[$Battle_Dome.event].refresh
  $Battle_Dome.event = nil
end
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


ForeverZer0

February 28, 2011, 09:22:37 pm #1 Last Edit: February 28, 2011, 09:26:38 pm by ForeverZer0
Are the flags for transferring, etc. being cleared before the update method in Scene_Map has a chance to execute? You really didn't show if that runs before or after. That could be one easy thing to check.

It seems like you may be over-complicating things a bit with this. I would likely just set up an "after_battle" array, which contains Proc objects, which you can set up easy enough based on the same conditions you are using.

Then all you have to do is add a condition at the beginning of the Scene_Map update:


while $game_temp.after_battle != []
 $game_temp.after_battle.shift.call
end


This will also allow you to add some flexibility, since you can call anything and are not confined to starting events.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

nathmatt

if it helps the entire script

part 1

Spoiler: ShowHide
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Battle Dome by Nathmatt
# Version: 1.19
# Type: Add On
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
#                                    PART 1
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#   
#  This work is protected by the following license:
# #----------------------------------------------------------------------------
# # 
# #  Creative Commons - Attribution-NonCommercial-ShareAlike 3.0 Unported
# #  ( http://creativecommons.org/licenses/by-nc-sa/3.0/ )
# # 
# #  You are free:
# # 
# #  to Share - to copy, distribute and transmit the work
# #  to Remix - to adapt the work
# # 
# #  Under the following conditions:
# # 
# #  Attribution. You must attribute the work in the manner specified by the
# #  author or licensor (but not in any way that suggests that they endorse you
# #  or your use of the work).
# # 
# #  Noncommercial. You may not use this work for commercial purposes.
# # 
# #  Share alike. If you alter, transform, or build upon this work, you may
# #  distribute the resulting work only under the same or similar license to
# #  this one.
# # 
# #  - For any reuse or distribution, you must make clear to others the license
# #    terms of this work. The best way to do this is with a link to this web
# #    page.
# # 
# #  - Any of the above conditions can be waived if you get permission from the
# #    copyright holder.
# # 
# #  - Nothing in this license impairs or restricts the author's moral rights.
# # 
# #-----------------------------------------------------------------------------
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#==============================================================================
# Battle_Dome
#------------------------------------------------------------------------------
#  This is the master control, configuration.
#  module for Battle_Dome.
#==============================================================================
module Battle_Dome
 
 
 
  #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  # Battle_Dome::Control
  #----------------------------------------------------------------------------
  #  This module provides in-game control configurations.
  #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  module Control
    Escape    = 'R' # The button you press to escape(only in battle).
  end
  #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  # Battle_Dome::Config
  #----------------------------------------------------------------------------
  #  This module provides Battle_Dome configurations.
  #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  module Config
    # in frames
    Escape_Time     = 250         # How long it will take to escape
    Escape_Text     = 'RUNNING'   # The text displayed when escaping
    Use_Tons        = false       # If you want to use tons bars
    Escape_bar_x    = 200         # The escape bar x co-ordanance
    Escape_bar_y    = 410         # The escape bar y co-ordanance
    Wait_Time       = 5           # How long the result window will be displayed
    Disable_menu    = true        # Disables the menu during battle
    Menu            = false       # Allows you to call a battle menu
                                  # false or the call example('Scene_Menu')
  end
  #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  # Battle_Dome::Transition_Pack
  #----------------------------------------------------------------------------
  #  This module ensures compatibility with Transition Pack by Fantasist.
  #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  module Transition_Pack
    Using = false                # Whether or not you are using the Transition Pack
    Type  = 0                    # The type defined in the Transition Pack instructions
    Args  = nil                  # The args defined in the Transition Pack instructions
  end
  #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  # Battle_Dome::Terrains
  #----------------------------------------------------------------------------
  #  This module provides Battle_Dome terrain information.
  #  Add You'r Terrains here to change your terrain call
  #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  module Terrains
  Terrain = []
  #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  #
  # Terrain[1] = [M,X,Y,D] Terrain[2] = [M,X,Y,D] ect...
  #
  # M,        # Replace the (M) with the map id you want to go to.
  #
  # X,        # Replace the (X) with the X concordances you want go to.
  #
  # Y,        # Replace the (Y) with the  Y concordances you go to.
  #
  # D,        # Replace the (D) with the direction you want to face
  #           # (8) IS UP (6) IS RIGHT (2) IS DOWN (4) IS LEFT
  #
  #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
    Terrain[1] = [12,8,5,2]
    Terrain[2] = [13,8,5,2]
    Terrain[3] = [14,8,5,2]
  end
  #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  # Battle_Dome::Terrain_Maps
  #----------------------------------------------------------------------------
  #  This module changes the terrain automaticly depending on the map
  #  you are on.
  #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  module Terrain_Maps
    #--------------------------------------------------------------------------
    # Terrains
    #  (id) - is the terrain id
    #  (return [the map ids]) - is the array of map ids for that terrain
    #  This is where you set up what maps equals what terrains.
    #--------------------------------------------------------------------------
    def self.Terrains(id)
      case id
      when 1 then return [3,4]
      when 2 then return [6,7]
      when 3 then return [9,10]
      end
    end
  end
end


part 2
Spoiler: ShowHide
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
# Battle Dome by Nathmatt
# Version: 1.19
# Type: Add On
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
#
#                                    PART 2
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
#   
#  This work is protected by the following license:
# #-----------------------------------------------------------------------------
# # 
# #  Creative Commons - Attribution-NonCommercial-ShareAlike 3.0 Unported
# #  ( http://creativecommons.org/licenses/by-nc-sa/3.0/ )
# # 
# #  You are free:
# # 
# #  to Share - to copy, distribute and transmit the work
# #  to Remix - to adapt the work
# # 
# #  Under the following conditions:
# # 
# #  Attribution. You must attribute the work in the manner specified by the
# #  author or licensor (but not in any way that suggests that they endorse you
# #  or your use of the work).
# # 
# #  Noncommercial. You may not use this work for commercial purposes.
# # 
# #  Share alike. If you alter, transform, or build upon this work, you may
# #  distribute the resulting work only under the same or similar license to
# #  this one.
# # 
# #  - For any reuse or distribution, you must make clear to others the license
# #    terms of this work. The best way to do this is with a link to this web
# #    page.
# # 
# #  - Any of the above conditions can be waived if you get permission from the
# #    copyright holder.
# # 
# #  - Nothing in this license impairs or restricts the author's moral rights.
# # 
# #-----------------------------------------------------------------------------
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
#
#  This is the part of the script that runs everything.
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
module Battle_Dome
 
  # version of Battle_Dome
  Version = 1.19
 
  #============================================================================
  # Battle_Dome::Processor
  #----------------------------------------------------------------------------
  #  This class provides methods for Battle Dome's handling.
  #============================================================================
  class Processor
   
    # setting all accessible variables
    attr_accessor :escape_time,:exp,:gold,:items,:event,:list
    attr_reader   :in_battle,:keys
    #--------------------------------------------------------------------------
    # Initialization
    #--------------------------------------------------------------------------
    def initialize
      @list = []
      @keys = {0 => 601, 1 => 602, 2 => 603}
      reset
    end
    #--------------------------------------------------------------------------
    # reset
    #  resets all my variables.
    #--------------------------------------------------------------------------
    def reset
      @exp,@gold,@items,@in_battle,@result,@bar_opacity,@enemies_called,@escape_bar,
      @escape_time,@phase = 0,0,[],false,false,255,false,nil,Config::Escape_Time,0
      @evented = RPG::Event.new(0, 0)
    end
    #--------------------------------------------------------------------------
    # Call_Battle
    #  Calls the battle map and sets a few necessary variables
    #--------------------------------------------------------------------------
    def Call_Battle
      @in_battle,@escaped,$game_temp.battle_calling,$game_temp.menu_calling,
      $game_temp.menu_beep,$game_temp.map_bgm = true,false,false,false,false,
      $game_system.playing_bgm
      $game_player.make_encounter_count
      $game_system.bgm_stop
      $game_system.se_play($data_system.battle_start_se)
      $game_system.bgm_play($game_system.battle_bgm)
      @returns = [$game_map.map_id,$game_player.x,$game_player.y,$game_player.direction]
      @id       = []
      @b_Name   = []
      @troop_id = $game_temp.battle_troop_id
      @t_Name   = $data_troops[@troop_id].name
      $game_troop.setup(@troop_id)
      (0...$game_troop.enemies.size).each {|e|
      @id[e]     = ($data_troops[@troop_id].members[e].enemy_id)
      @b_Name[e] = ($game_troop.enemies[e].battler_name)}
      teleport = check_terrain
      if teleport == nil
        raise 'No map was Dectected please use the config to create a terrain for this map'
      end
      Transfer(true,teleport)
      @phase = 1
    end
    #--------------------------------------------------------------------------
    # check_terrain
    #  returns the terrain id from the current map id
    #--------------------------------------------------------------------------
    def check_terrain
      (1...Terrains::Terrain.size).each {|i|
      if Terrain_Maps.Terrains(i).include?(@returns[0])
        return Terrains::Terrain[i]
      end}
      return nil
    end
    #--------------------------------------------------------------------------
    # Transfer
    #  Teleports the player to the difined location
    #--------------------------------------------------------------------------
    def Transfer(battle=false,array=[])
      $game_temp.player_new_map_id    = (battle ? array[0]:@returns[0])
      $game_temp.player_new_x         = (battle ? array[1]:@returns[1])
      $game_temp.player_new_y         = (battle ? array[2]:@returns[2])
      $game_temp.player_new_direction = (battle ? array[3]:@returns[3])
      (battle ? $scene.transfer_battle : $scene.transfer_player)
    end
    #--------------------------------------------------------------------------
    # set_result
    #  sets the return result
    #--------------------------------------------------------------------------
    def set_result(i)
      return if $game_temp.battle_proc == nil
      @list.each{|a|@list = a[1] if a[0] == i}
      $game_temp.battle_proc = nil
    end
    #--------------------------------------------------------------------------
    # delay
    #  delays all actions for the defined secounds
    #--------------------------------------------------------------------------
    def delay(frames)
      wait = 0
      while frames * 40 > wait
        wait += 1
        Graphics.update
        Input.update
      end
    end
    #--------------------------------------------------------------------------
    # create_event
    #  Creates an event with the defined graphic
    #--------------------------------------------------------------------------
    def create_event(character_name,enemy)
      @evented.pages[0].graphic.character_name = character_name
      graphic = [0,character_name,0,2,0,255,0]
      id = $BlizzABS.create_event(0, 0, "\\e[#{enemy}]",@evented.pages)
      x, y = $BlizzABS.get_respawn_coordinates($game_map.events[id])
      $BlizzABS.create_event_page_graphic([graphic])
      $game_map.events[id].moveto(x,y)
    end
    #--------------------------------------------------------------------------
    # can_escape
    #  This checks to see if you can escape
    #--------------------------------------------------------------------------
    def can_escape?
      enemies_agi = actors_agi = 0
      en = $game_map.enemies.size
      an = $game_map.actors.size
      $game_map.enemies.each{|battler|enemies_agi += battler.enemy.agi}
      enemies_agi /= en if en > 0
      $game_map.actors.each{|actor|actors_agi += actor.agi}
      actors_agi /= actors.size if actors.size > 0
      return rand(100) < 50 * actors_agi / enemies_agi
    end
    #--------------------------------------------------------------------------
    # update
    #  Updates Battle Dome's processes.
    #--------------------------------------------------------------------------
    def update
      case @phase
      when 1
        create_enemies
      when 2
        battle_check
      when 3
        escape
      when 4
        finish
      end
    end
    #--------------------------------------------------------------------------
    # create_enemies
    #  Creates the enemies on the map.
    #--------------------------------------------------------------------------
    def create_enemies
      return if $game_map.map_id == @map_id
      (0...$game_troop.enemies.size).each {|e| create_event(@b_Name[e],(e + 1))}
      @phase = 2
    end
    #--------------------------------------------------------------------------
    # battle_check
    #  Checks whether you win or escape the battle.
    #--------------------------------------------------------------------------
    def battle_check
      if Input.trigger?(Input::Escape)
        return if $game_temp.battle_can_escape == false
        @escape_bar = Window_Escape_Bar.new
        @phase = 3
      end
      @phase = 4 if $game_map.battlers.size == 0
    end
    #--------------------------------------------------------------------------
    # escape
    #  Runs the escape proccesing.
    #--------------------------------------------------------------------------
    def escape
      @escape_bar.update
      @escape_time -= 1
      return if @escape_time != 0
      @escape_time = Config::Escape_Time
      @escape_bar.dispose
      @escape_bar = nil
      @phase = 2
      return if !can_escape?
      $game_system.se_play($data_system.escape_se)
      $game_system.bgm_play($game_temp.map_bgm)
      reset
      Transfer()
      set_result(3)
      @phase = 0
    end
    #--------------------------------------------------------------------------
    # finish
    #  Runs the win proccesing.
    #--------------------------------------------------------------------------
    def finish
      $game_system.me_play($game_system.battle_end_me)
      treasures = @items
      $game_party.gain_gold(@gold)
      @escape_time = Battle_Dome::Config::Escape_Time
      $game_party.actors.each {|actor|
      actor.exp += @exp if !actor.cant_get_exp?}
      treasures = treasures[0..5]
      treasures.each {|item|
      case item
      when RPG::Item
        $game_party.gain_item(item.id, 1)
      when RPG::Weapon
        $game_party.gain_weapon(item.id, 1)
      when RPG::Armor
      $game_party.gain_armor(item.id, 1)
      end}
      @result_window = Window_BattleResult.new(@exp, @gold, treasures)
      @result_window.y += 50
      @result_window.visible = true
      delay(Config::Wait_Time)
      @result_window.dispose
      @result_window = nil
      Transfer()
      set_result(0)
      $game_system.bgm_play($game_temp.map_bgm)
      reset
    end
     
  end
end
# load Battle Dome's Processor
$Battle_Dome = Battle_Dome::Processor.new
#============================================================================
# Scene Map
#============================================================================
class Scene_Map
  # Calls the battle scene
  def call_battle
    $Battle_Dome.Call_Battle
  end
  # updates the battle proccessing
  alias battle_dome_update update
  def update
    $Battle_Dome.update if $Battle_Dome.in_battle
    if !$Battle_Dome.in_battle && $Battle_Dome.event != nil &&
        !$game_temp.player_transferring
      $game_map.events[$Battle_Dome.event].list = [$Battle_Dome.list]
      $game_map.events[$Battle_Dome.event].start
      $Battle_Dome.event = nil
    end
    battle_dome_update
  end
  # adds the ability to refresh spriteset
  def sprite_refresh
    @spriteset = Spriteset_Map.new
  end
  # disables menu during battle
  alias battle_dome_call_menu call_menu
  def call_menu
    if $Battle_Dome.in_battle && Battle_Dome::Config::Disable_menu
      $game_temp.menu_calling = false
      if Battle_Dome::Config::Menu != false
        eval("$scene = #{Battle_Dome::Config::Menu}.new")
      end
    else
      battle_dome_call_menu
    end
  end

  def transfer_battle
    Graphics.freeze
    t = Battle_Dome::Transition_Pack
    $scene = Transition.new($scene,t::Type , t::Args) if t::Using
    if $game_map.map_id != $game_temp.player_new_map_id
      $game_map.setup($game_temp.player_new_map_id)
    end
    $game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
    case $game_temp.player_new_direction
    when 2  # down
      $game_player.turn_down
    when 4  # left
      $game_player.turn_left
    when 6  # right
      $game_player.turn_right
    when 8  # up
      $game_player.turn_up
    end
    $game_player.straighten
    $game_map.update
    @spriteset.dispose
    @spriteset = Spriteset_Map.new
    if !t::Using
      Graphics.transition(40, "Graphics/Transitions/" +
        $data_system.battle_transition,100)
    end
    $game_map.autoplay
    Graphics.frame_reset
    Input.update
  end
 
  alias battle_dome_setup_gameover setup_gameover
  def setup_gameover
    if judge && !$game_temp.battle_can_lose
      $Battle_Dome.Transfer()
      $Battle_Dome.set_result(1)
      return false
    end
    return battle_dome_setup_gameover
  end
 
end
#============================================================================
# Map_Enemy
#----------------------------------------------------------------------------
# Get enemy id
#============================================================================
class Map_Enemy < Map_Battler
  attr_reader   :enemy
end
#============================================================================
# BlizzABS::Processor
#----------------------------------------------------------------------------
#  This edits the part of bliz'z script that controls
#  how you get exp, gold, and items so you get it after battle.
#============================================================================
class BlizzABS::Processor
 
  #--------------------------------------------------------------------------
  # drop_items
  #  enemy - the killed enemy event
  #  Returns array of items that will be dropped.
  #--------------------------------------------------------------------------
  def drop_items(enemy)
    # initialize array
    items = []
    if $tons_version != nil && $tons_version >= 5.98 &&
        TONS_OF_ADDONS::MULTI_DROP
      $Battle_Dome.items += BlizzCFG.dropped_items(enemy.battler)
    elsif rand(100) < enemy.battler.treasure_prob
      if enemy.battler.item_id > 0
        $Battle_Dome.items.push($data_items[enemy.battler.item_id])
      elsif enemy.battler.weapon_id > 0
        $Battle_Dome.items.push($data_weapons[enemy.battler.weapon_id])
      elsif enemy.battler.armor_id > 0
        $Battle_Dome.items.push($data_armors[enemy.battler.armor_id])
      end
    end
    return items
  end
  #--------------------------------------------------------------------------
  # exp_result
  #  enemy - the killed enemy event
  #  Processes EXP gain after the death of an enemy.
  #--------------------------------------------------------------------------
  def exp_result(enemy)
    return 0 if enemy.exp == 0
    exp = enemy.exp
    if $tons_version != nil
      if $tons_version >= 6.4 && TONS_OF_ADDONS::DIFFICULTY
        exp = exp * $game_system.exp_rate / 100
      end
    end
    $Battle_Dome.exp += exp
    exp = 0
    return exp
  end
  #--------------------------------------------------------------------------
  # gold_result
  #  enemy - the killed enemy event
  #  Processes gold gain after the death of an enemy.
  #--------------------------------------------------------------------------
  def gold_result(enemy)
    return 0 if enemy.gold == 0
    gold = enemy.gold
    if $tons_version != nil
      if $tons_version >= 6.4 && TONS_OF_ADDONS::DIFFICULTY
        gold = gold * $game_system.gold_rate / 100
      end
    end
    $Battle_Dome.gold += gold
    return gold
  end
 
  alias battle_dome_create_event_page create_event_page
  def create_event_page(data)
    if data.is_a?(RPG::Event::Page)
      return data
    end
    return battle_dome_create_event_page
  end
   
end
#============================================================================
# BlizzABS::Cache
#----------------------------------------------------------------------------
#  This class was enhanced to support the yellow escpae bar
#============================================================================
class BlizzABS::Cache
 
  alias battle_dome_initialize initialize
  def initialize
    battle_dome_initialize
    # add image
    @data['empty_hud_yellow_bar'] = @data['empty_hud_green_bar'].clone
    @data['empty_hud_yellow_bar'].hue_change(-60)
    # prevent "Script is hanging" error
    Graphics.update
    # add image
    @data['hud_yellow_bar'] = @data['hud_green_bar'].clone
    @data['hud_yellow_bar'].hue_change(-60)
    # prevent "Script is hanging" error
    Graphics.update
  end
end
# load Blizz-ABS Processor
$BlizzABS = BlizzABS::Processor.new
#==============================================================================
# Window_Escape_Bar
#==============================================================================
class Window_Escape_Bar < Sprite
 
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super
    # create bitmap
    self.bitmap = Bitmap.new(206, 96)
    self.x, self.y = 200, 0
    self.z = 1000
    update
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def update
   rate = (Battle_Dome::Config::Escape_Time > 0 ? $Battle_Dome.escape_time.to_f /
   Battle_Dome::Config::Escape_Time : 0)
    if rate > 0.6
      color1 = Color.new(80 - 150 * (rate-0.6), 80, 50 * (rate-0.6), 192)
      color2 = Color.new(240 - 450 * (rate-0.6), 240, 150 * (rate-0.6), 192)
    elsif rate > 0.2 && rate <= 0.6
      color1 = Color.new(80, 200 * (rate-0.2), 0, 192)
      color2 = Color.new(240, 600 * (rate-0.2), 0, 192)
    elsif rate <= 0.2
      color1 = Color.new(400 * rate, 0, 0, 192)
      color2 = Color.new(240, 0, 0, 192)
    end
    color3 = Color.new(0, 80, 0, 192)
    self.bitmap.font.color = normal_color
    if Battle_Dome::Config::Use_Tons &&  $tons_version != nil
      self.bitmap.gradient_bar(55,10,114, color1, color2, color3, rate)
    else
      self.bitmap.gradient_bar_hud(55, 32, 114, rate, 'hud_yellow_bar')
    end
    self.bitmap.draw_text_full(65,-6,100,32,Battle_Dome::Config::Escape_Text.to_s)
  end
end
#==============================================================================
# Input
#==============================================================================
module Input
  Escape =  [Key[Battle_Dome::Control::Escape]]
end
#==============================================================================
# Interpreter
#==============================================================================
class Interpreter
 
  alias battle_dome_command_301 command_301
  def command_301
    $Battle_Dome.event = @event_id
    ((@index+1)..@list.size).each{|i|
    case @list[i].code
    when 301 then break
    when 601,602
      id = $Battle_Dome.keys.index(@list[i].code)
      $Battle_Dome.list.push([id,@list[i+1]])
    when 603
      id = $Battle_Dome.keys.index(@list[i].code)
      $Battle_Dome.list.push([id,@list[i+1]])
      break
    end}
    battle_dome_command_301
  end
 
end
#==============================================================================
# Game_Event
#==============================================================================
class Game_Event
  attr_accessor :interpreter,:list
end
#==============================================================================
# Game_Map
#==============================================================================
class Game_Map
  #----------------------------------------------------------------------------
  # enemy
  #  Returns all alive enemies.
  #----------------------------------------------------------------------------
  def enemies
    return (@events.values.find_all {|e| e.is_a?(Map_Enemy) && !e.dead?})
  end
  #----------------------------------------------------------------------------
  # actors
  #  Returns all actors enemies.
  #----------------------------------------------------------------------------
  def actors
    return (battlers.values.find_all {|e| e.is_a?(Map_Actor) && !e.dead?})
  end
 
end
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


ForeverZer0

I'll check it out after work and see if I can help you find something you may have overlooked.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

nathmatt

Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script