Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 RTAB Compatibility Help!
#1
I recently found a Battle Result Script by Raziel. I think that it's the only Battle Result Script that is compatible with the Tanketai Sideview Battle Script.

Here's what the Battle Result Script does.

[Image: ErrorRTAB2.jpg]

Here's The Battle Result Script.
PHP Code:
#==============================================================================
# ** Battle Report
#==============================================================================
# Raziel (originally by David Schooley alias Illustrationism)
# Version 1.6
# 2006-10-08
#------------------------------------------------------------------------------
# * Instructions
#  ~ Place this script above main. Make a folder in the pictures folder
#    and call it Faces. When using a face picture, make sure it's
#    named like the character's file. To turn facesets on search for
#    @face = false and set it to true to turn facesets on.
#------------------------------------------------------------------------------
#==============================================================================
# ** Game_Actor
#==============================================================================

class Game_Actor Game_Battler
  
#--------------------------------------------------------------------------
  # * Change EXP
  #     exp : new EXP
  #--------------------------------------------------------------------------
  
def exp=(exp)
    @
exp = [[exp9999999].min0].max
    
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
      
@level += 1
      
# NEW - David
      
$d_new_skill nil
      
for j in $data_classes[@class_id].learnings
        
if j.level == @level
          learn_skill
(j.skill_id)
          
# NEW - David
          
skill $data_skills[j.skill_id]
          
$d_new_skill skill.name
        end
      end
    end
    
while @exp < @exp_list[@level]
      @
level -= 1
    end
    
@hp = [@hpself.maxhp].min
    
@sp = [@spself.maxsp].min
  end
  
#--------------------------------------------------------------------------
  # * Get the current EXP
  #--------------------------------------------------------------------------
  
def now_exp
    
return @exp - @exp_list[@level]
  
end
  
#--------------------------------------------------------------------------
  # * Get the next level's EXP
  #--------------------------------------------------------------------------
  
def next_exp
    
return @exp_list[@level+1] > ? @exp_list[@level+1] - @exp_list[@level] : 0
  end
end  
#==============================================================================
# ** Window_LevelUP
#==============================================================================

class Window_LevelUp Window_Base
  
#--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  
def initialize(actorpos)
    
#change this to true to show the actor's face
    
@face true
    
@actor actor
    y 
= (pos 120)
    
super(280y360120)
    
self.contents Bitmap.new(width 32height 32)
    
self.back_opacity 255    
    
if $d_dum == false
      refresh
    end
  end
  
#--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  
def refresh
    self
.contents.clear
    self
.contents.font.size 18
    
if @face == true
      draw_actor_face
(@actor40)
    else
      
draw_actor_graphic(@actor5080)
    
end
    draw_actor_name
(@actor1110)
    
draw_actor_level(@actor1860)
    
show_next_exp = @actor.level == 99 "---" "#{@actor.next_exp}"
    
min_bar = @actor.level == 99 : @actor.now_exp
    max_bar 
= @actor.level == 99 : @actor.next_exp
    draw_slant_bar
(11580min_barmax_bar1906bar_color Color.new(01000255), end_color Color.new(02550255))
    
self.contents.draw_text(1152430032"Exp: #{@actor.now_exp}")
    
self.contents.draw_text(1154830032"Level Up: #{show_next_exp}")
  
end
  
#--------------------------------------------------------------------------
  # * Level UP
  #--------------------------------------------------------------------------
  
def level_up
    self
.contents.font.color system_color
    self
.contents.draw_text(230488032"LEVEL UP!")
  
end
  
#--------------------------------------------------------------------------
  # * Learn Skill
  #--------------------------------------------------------------------------
  
def learn_skill(skill)
    
self.contents.font.color normal_color
    unless $d_new_skill 
== nil
      Audio
.se_play("Audio/SE/105-Heal01")
      
self.contents.draw_text(186248032"Learned:")
      
self.contents.font.color system_color
      self
.contents.draw_text(261249032skill)
    
end
  end
end
#==============================================================================
# ** Window_Exp
#==============================================================================

class Window_EXP Window_Base
  
#--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  
def initialize(exp)
    
super(0028060)
    
self.contents Bitmap.new(width 32height 32)
    
self.back_opacity 255
    refresh
(exp)
  
end
  
#--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  
def refresh(exp)
    
self.contents.clear
    self
.contents.font.color system_color
    self
.contents.draw_text(0015032"Exp Earned:")
    
self.contents.font.color normal_color
    self
.contents.draw_text(18005432exp.to_s2)
  
end
end
#==============================================================================
# ** Window_Money_Items
#==============================================================================

class Window_Money_Items Window_Base
  
#--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  
def initialize(moneytreasures)
    @
treasures treasures
    super
(060280420)
    
self.contents Bitmap.new(width 32height 32)
    
self.back_opacity 255
    refresh
(money)
  
end
  
#--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  
def refresh(money)
    @
money money
    self
.contents.clear
    self
.contents.font.color system_color
    self
.contents.draw_text(4410032"Items Found:")
    
self.contents.font.color normal_color
    y 
32
    
for item in @treasures
      draw_item_name
(item4y)
      
+= 32
    end
    cx 
contents.text_size($data_system.words.gold).width
    self
.contents.font.color normal_color
    self
.contents.draw_text(4340220-cx-232$game_party.gold.to_s2)
    
self.contents.font.color normal_color
    self
.contents.draw_text(4300220-cx-232"+ " + @money.to_s2)
    
self.contents.font.color system_color
    self
.contents.draw_text(124-cx340cx 10032$data_system.words.gold2)
  
end
end
#==============================================================================
# ** Scene_Battle
#==============================================================================

class Scene_Battle
  
#--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  
alias raz_battle_report_main main
  alias raz_battle_report_be battle_end
  
#--------------------------------------------------------------------------
  # * Game Temp Variable Setup
  #--------------------------------------------------------------------------
  
def main
    
@lvup_window = []
    @
show_dummies true
    raz_battle_report_main
    
@lvup_window nil
    
@level_up nil
    
@ch_stats nil
    
@ch_compare_stats nil
    Audio
.me_stop
  end
  
#--------------------------------------------------------------------------
  # * Battle Ends
  #     result : results (0:win 1:lose 2:escape)
  #--------------------------------------------------------------------------
  
def battle_end(result)
    
raz_battle_report_be(result)
    @
status_window.visible false
    
@spriteset.dispose
    Graphics
.transition
    
if result == 0
      display_lv_up
(@exp, @gold, @treasures)
      
loop do
        
Graphics.update
        Input
.update
        
if Input.trigger?(Input::C)
          break
        
end
      end
      trash_lv_up
    end
  end
  
#--------------------------------------------------------------------------
  # * Start After Battle Phase
  #--------------------------------------------------------------------------
  
def start_phase5
    
# Shift to phase 5
    
@phase 5
    
# Play battle end ME
    
$game_system.me_play($game_system.battle_end_me)
    
# Return to BGM before battle started
    
$game_system.bgm_play($game_temp.map_bgm)
    
# Initialize EXP, amount of gold, and treasure
    
exp 0
    gold 
0
    treasures 
= []
    
# Loop
    
for enemy in $game_troop.enemies
      
# If enemy is not hidden
      
unless enemy.hidden
        
# Add EXP and amount of gold obtained
        
exp += enemy.exp
        gold 
+= enemy.gold
        
# Determine if treasure appears
        
if rand(100) < enemy.treasure_prob
          
if enemy.item_id 0
            treasures
.push($data_items[enemy.item_id])
          
end
          
if enemy.weapon_id 0
            treasures
.push($data_weapons[enemy.weapon_id])
          
end
          
if enemy.armor_id 0
            treasures
.push($data_armors[enemy.armor_id])
          
end
        end
      end
    end
    
# Treasure is limited to a maximum of 6 items
    
treasures treasures[0..5]
    @
treasures treasures
    
@exp  exp
    
@gold gold
    
for item in treasures
      
case item
      when RPG
::Item
        $game_party
.gain_item(item.id1)
      
when RPG::Weapon
        $game_party
.gain_weapon(item.id1)
      
when RPG::Armor
        $game_party
.gain_armor(item.id1)
      
end
    end
    
@phase5_wait_count 10
  end
  
#--------------------------------------------------------------------------
  # * Frame Update (after battle phase)
  #--------------------------------------------------------------------------
  
def update_phase5
    
if @phase5_wait_count 0
      
@phase5_wait_count -= 1
      
if @phase5_wait_count == 0
        $game_temp
.battle_main_phase false        
      end
      
return
    
end
    battle_end
(0)
  
end
  
#--------------------------------------------------------------------------
  # * Display Level UP
  #--------------------------------------------------------------------------
  
def display_lv_up(expgoldtreasures)
    
$d_dum false
    d_extra 
0
    i 
0
    
for actor in $game_party.actors
      
# Fill up the Lv up windows
      
@lvup_window[i] = Window_LevelUp.new($game_party.actors[i], i)
      
+= 1
    end
    
# Make Dummies
    
if @show_dummies == true
      $d_dum 
true
      
for m in i..3
        
@lvup_window[m] = Window_LevelUp.new(mm)
      
end
    end
    
@exp_window Window_EXP.new(exp)
    @
m_i_window Window_Money_Items.new(goldtreasures)
    @
press_enter nil
    gainedexp 
exp
    
@level_up = [0000]
    @
d_new_skill = [""""""""]
    @
d_breakout false
    
@m_i_window.refresh(gold)
    
wait_for_OK
    
@d_remember $game_system.bgs_memorize
    Audio
.bgs_play("Audio/SE/032-Switch01"100300)
    
max_exp exp
    value 
28
    
if exp value
      value 
exp
    end
    
if value == 0
      value 
1
    end
    
for n in 0..gainedexp - (max_exp value)
      
exp -= (max_exp value)
      if @
d_breakout == false
        Input
.update
      end
      
for i in 0...$game_party.actors.size
        actor 
$game_party.actors[i]
        if 
actor.cant_get_exp? == false
          last_level 
actor.level
          actor
.exp += (max_exp value)
          
# Fill up the Lv up windows
          
if @d_breakout == false
            
@lvup_window[i].refresh
            
@exp_window.refresh(exp)
          
end
          
if actor.level last_level
            
@level_up[i] = 5
            Audio
.se_play("Audio/SE/056-Right02.ogg"70150)
            if 
$d_new_skill
              
@d_new_skill[i] = $d_new_skill
            end
          end
          
if @level_up[i] == 0
            
@d_new_skill[i] = ""
          
end
          
if @level_up[i] > 0
            
@lvup_window[i].level_up
            
if @d_new_skill[i] != ""
              
@lvup_window[i].learn_skill(@d_new_skill[i])
            
end
          end
          
if Input.trigger?(Input::C) or exp <= 0
            
@d_breakout true
          end
        end
        
if @d_breakout == false
          
if @level_up[i] >0
            
@level_up[i] -= 1
          end
          Graphics
.update
        end
      end
      
if @d_breakout == true
        
for i in 0...$game_party.actors.size
          actor 
$game_party.actors[i]
          if 
actor.cant_get_exp? == false
            actor
.exp += exp
          end
        end
        exp 
0
        
break
      
end
    end
    Audio
.bgs_stop
    
@d_remember $game_system.bgs_restore
    
for i in 0...$game_party.actors.size
      
@lvup_window[i].refresh
    end
    
@exp_window.refresh(exp)
    
Audio.se_play("Audio/SE/006-System06.ogg"70150)
    
$game_party.gain_gold(gold)
    @
m_i_window.refresh(0)
    
Graphics.update
  end
  
#--------------------------------------------------------------------------
  # * Trash Level UP
  #--------------------------------------------------------------------------
  
def trash_lv_up
    
for i in 0...4
      
@lvup_window[i].visible false
    end
    
@exp_window.visible false
    
@m_i_window.visible false
    
@lvup_window nil
    
@exp_window nil
    
@m_i_window nil
  end
  
# Wait until OK key is pressed
  
def wait_for_OK
    loop 
do
      
Input.update
      Graphics
.update
      
if Input.trigger?(Input::C)
        break
      
end
    end
  end
end  
#--------------------------------------------------------------------------
#   * Module RPG::Cache
#--------------------------------------------------------------------------
  
module RPG::Cache
  def self
.face(filenamehue 0)
    
self.load_bitmap("Graphics/Faces/"filenamehue)
  
end
end
#--------------------------------------------------------------------------
# * Window_Base
#--------------------------------------------------------------------------

class Window_Base Window
  
#--------------------------------------------------------------------------
  # * Draw Actor Face
  #--------------------------------------------------------------------------
  
def draw_actor_face(actorxy)
    
bitmap RPG::Cache.face(actor.character_nameactor.character_hue)
    
self.contents.blt(xybitmapRect.new(0,0,bitmap.widthbitmap.height))
  
end
  
#--------------------------------------------------------------------------
  # * Draw Slant Bar(by SephirothSpawn)
  #--------------------------------------------------------------------------
  
def draw_slant_bar(xyminmaxwidth 152height 6,
      
bar_color Color.new(15000255), end_color Color.new(25525560255))
    
# Draw Border
    
for i in 0..height
      self
.contents.fill_rect(iheight iwidth 11Color.new(505050255))
    
end
    
# Draw Background
    
for i in 1..(height 1)
      
100 * (height i) / height height
      g 
100 * (height i) / height height
      b 
100 * (height i) / height height
      a 
255 * (height i) / height 255 height
      self
.contents.fill_rect(iheight iwidth1Color.new(rbga))
    
end
    
# Draws Bar
    
for i in 1..( (min max.to_f) * width 1)
      for 
j in 1..(height 1)
        
bar_color.red * (width i) / width end_color.red width
        g 
bar_color.green * (width i) / width end_color.green width
        b 
bar_color.blue * (width i) / width end_color.blue width
        a 
bar_color.alpha * (width i) / width end_color.alpha width
        self
.contents.fill_rect(jheight j11Color.new(rgba))
      
end
    end
  end
end 

And Here's the Addon which makes the Battle Result Script compatible with RTAB scripts.
PHP Code:
class Scene_Battle
 alias raz_battle_fix_be battle_end
 def battle_end
(result)
   
raz_battle_fix_be(result)
   @
status_window.visible false
   
@spriteset.dispose
   Graphics
.transition
   
if result == 0
     display_lv_up
(@exp, @gold, @treasures)
     
loop do
       
Graphics.update
       Input
.update
       
if Input.trigger?(Input::C)
         break
       
end
     end
     trash_lv_up
   end
 end
end 

The Battle Result script comes with a addon script which makes it compatible with an RTAB script(By DerVVulfman), so i got the addon that came with the Battle Result Script because i'm also using Atoa's RTAB. Everything goes good until i complete a battle, this error shows up.

[Image: RTABError.jpg]

The error comes up after i close the battle result window. Can someone help me out?
Reply }


Messages In This Thread
RTAB Compatibility Help! - by Flare Knight - 04-06-2010, 07:04 AM
[Resolved] RTAB Compatibility Help! - by MGC - 04-06-2010, 08:47 PM
[Resolved] RTAB Compatibility Help! - by MGC - 04-07-2010, 08:55 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
   Script compatibility help Lord Vectra 3 3,655 07-25-2021, 11:42 PM
Last Post: DerVVulfman
   Adding face script on Cogwheel's RTAB Battle Status rekkatsu 15 13,154 08-25-2020, 03:09 AM
Last Post: DerVVulfman
Question  MGC ISO Engine + Extra Movement Frames compatibility Morrigan Aensland 1 5,421 10-26-2013, 12:03 PM
Last Post: evindom
   Cogwheels RTAB help sherper1 15 14,898 01-29-2010, 04:32 PM
Last Post: DerVVulfman
   Issue with RTAB and battle event systems... samsonite789 4 6,896 11-08-2009, 07:21 AM
Last Post: Jaberwocky



Users browsing this thread: