Help - Search - Members - Calendar
Full Version: Submission: FF8 Battle Report
RPG RPG Revolution Forums > Scripting > Script Submissions > RGSS-Submissions
Prexus


I made this for Lionheart's FF8 remake, thus the reason for there being a maximum of 3 party members.

Also, it is arranged for the DBS. If you wish to apply this to other battle systems please figure it out yourself as I get frustrated with other's problems usually if I don't have the code directly infront of me (I don't use other's battle systems ever.)

Make sure to import an entirely black image 640x480 into the Picture's folder named Blackout.png (Click Here)

Put this in a new script above MAIN called 'level':
CODE
$fontface = Font.default_name if $fontface.nil?
$fontsize = Font.default_size if $fontsize.nil?

class Window_EXPTitle < Window_Base
def initialize
super(0, 0, 640, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
self.visible = false
refresh
end
def refresh
self.contents.clear
self.contents.draw_text(4,0,640,32,"EXP")
end
end

class Window_EXPPlayer1 < Window_Base
def initialize(exp)
@exp = exp
super(32, 64, 288, 128)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
self.z += 10
self.visible = false
refresh
end
def refresh
self.contents.clear
actor = $game_party.actors[0]
draw_actor_name(actor, 4, 0)
draw_actor_level(actor, 4, 32)
draw_actor_rcvexp(actor, 100, 0, @exp)
draw_actor_curexp(actor, 100, 32)
draw_actor_nxtexp(actor, 100, 64)
end
end

class Window_EXPPlayer2 < Window_Base
def initialize(exp)
@exp = exp
super(32, 192, 288, 128)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
self.z += 10
self.visible = false
refresh
end
def refresh
self.contents.clear
actor = $game_party.actors[1]
draw_actor_name(actor, 4, 0)
draw_actor_level(actor, 4, 32)
draw_actor_rcvexp(actor, 100, 0, @exp)
draw_actor_curexp(actor, 100, 32)
draw_actor_nxtexp(actor, 100, 64)
end
end

class Window_EXPPlayer3 < Window_Base
def initialize(exp)
@exp = exp
super(32, 320, 288, 128)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
self.z += 10
self.visible = false
refresh
end
def refresh
self.contents.clear
actor = $game_party.actors[2]
draw_actor_name(actor, 4, 0)
draw_actor_level(actor, 4, 32)
draw_actor_rcvexp(actor, 100, 0, @exp)
draw_actor_curexp(actor, 100, 32)
draw_actor_nxtexp(actor, 100, 64)
end
end

class Window_EXPBlank2 < Window_Base
def initialize
super(32, 192, 288, 128)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
self.z += 10
self.visible = false
end
end

class Window_EXPBlank3 < Window_Base
def initialize
super(32, 320, 288, 128)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
self.z += 10
self.visible = false
end
end

class Window_Background < Window_Base
def initialize
super(-16,-16,672,512)
self.opacity = 0
self.z = 9
self.visible = false
self.contents = Bitmap.new(width - 32, height - 32)
icon_bitmap = RPG::Cache.picture("Blackout.png") # Replace this with a 640x480 image of BLACK
self.contents.blt(0, 0, icon_bitmap, icon_bitmap.rect)
icon_bitmap.dispose
end
end

class Scene_Battle
def main
$game_temp.in_battle = true
$game_temp.battle_turn = 0
$game_temp.battle_event_flags.clear
$game_temp.battle_abort = false
$game_temp.battle_main_phase = false
$game_temp.battleback_name = $game_map.battleback_name
$game_temp.forcing_battler = nil
$game_system.battle_interpreter.setup(nil, 0)
@troop_id = $game_temp.battle_troop_id
$game_troop.setup(@troop_id)
s1 = $data_system.words.attack
s2 = $data_system.words.skill
s3 = $data_system.words.guard
s4 = $data_system.words.item
@actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])
@actor_command_window.y = 160
@actor_command_window.back_opacity = 160
@actor_command_window.active = false
@actor_command_window.visible = false
@party_command_window = Window_PartyCommand.new
@help_window = Window_Help.new
@help_window.back_opacity = 160
@help_window.visible = false
@status_window = Window_BattleStatus.new
@message_window = Window_Message.new
@spriteset = Spriteset_Battle.new
@wait_count = 0
if $data_system.battle_transition == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$data_system.battle_transition)
end
start_phase1
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
$game_map.refresh
Graphics.freeze
@actor_command_window.dispose
@party_command_window.dispose
@help_window.dispose
@status_window.dispose
@message_window.dispose
if @skill_window != nil
@skill_window.dispose
end
if @item_window != nil
@item_window.dispose
end
if @result_window != nil
@result_window.dispose
end
if @titleresult_window != nil
@titleresult_window.dispose
@p1result_window.dispose
@p2result_window.dispose
@p3result_window.dispose
@background_window.dispose
end
@spriteset.dispose
if $scene.is_a?(Scene_Title)
Graphics.transition
Graphics.freeze
end
if $BTEST and not $scene.is_a?(Scene_Gameover)
$scene = nil
end
end

def start_phase5
@phase = 5
$game_system.me_play($game_system.battle_end_me)
$game_system.bgm_play($game_temp.map_bgm)
exp = 0
gold = 0
treasures = []
for enemy in $game_troop.enemies
unless enemy.hidden
exp += enemy.exp
gold += enemy.gold
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
treasures = treasures[0..5]
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 += exp
if actor.level > last_level
@status_window.level_up(i)
end
end
end
$game_party.gain_gold(gold)
for item in treasures
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
end
@result_window = Window_BattleResult.new(gold, treasures)
@titleresult_window = Window_EXPTitle.new
case $game_party.actors.size
when 1
@p1result_window = Window_EXPPlayer1.new(exp)
@p2result_window = Window_EXPBlank2.new
@p3result_window = Window_EXPBlank3.new
when 2
@p1result_window = Window_EXPPlayer1.new(exp)
@p2result_window = Window_EXPPlayer2.new(exp)
@p3result_window = Window_EXPBlank3.new
when 3
@p1result_window = Window_EXPPlayer1.new(exp)
@p2result_window = Window_EXPPlayer2.new(exp)
@p3result_window = Window_EXPPlayer3.new(exp)
end
@background_window = Window_Background.new
@phase5_wait_count = 60
end
def update_phase5
if @phase5_wait_count > 0
@phase5_wait_count -= 1
if @phase5_wait_count == 0
@titleresult_window.visible = true
@p1result_window.visible = true
@p2result_window.visible = true
@p3result_window.visible = true
@result_window.visible = true
@background_window.visible = true
$game_temp.battle_main_phase = false
@status_window.refresh
end
return
end
if Input.trigger?(Input::C)
$game_switches[0001] = true
battle_end(0)
end
end
end

class Window_BattleResult < Window_Base
def initialize(gold, treasures)
@gold = gold
@treasures = treasures
super(320, 64, 288, 384)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
self.z += 10
self.visible = false
refresh
end
def refresh
self.contents.clear
x = 4
self.contents.font.color = normal_color
cx = contents.text_size(@gold.to_s).width
self.contents.draw_text(x, 0, cx, 32, @gold.to_s)
x += cx + 4
self.contents.font.color = system_color
self.contents.draw_text(x, 0, 128, 32, $data_system.words.gold)
y = 32
for item in @treasures
draw_item_name(item, 4, y)
y += 32
end
end
end

class Window_Base
#-
def draw_actor_rcvexp(actor,x,y,exp)
self.contents.font.color = Color.new(255,255,128,255)
self.contents.draw_text(x,y,288,32,"EXP:")
self.contents.font.color = normal_color
self.contents.draw_text(x+60,y,80,32,exp.to_s,2)
end
#-
def draw_actor_curexp(actor,x,y)
self.contents.font.color = Color.new(255,255,128,255)
self.contents.draw_text(x,y,288,32,"Current:")
self.contents.font.color = normal_color
self.contents.draw_text(x+60,y,80,32,actor.exp_s,2)
end
#-
def draw_actor_nxtexp(actor,x,y)
self.contents.font.color = Color.new(255,255,128,255)
self.contents.draw_text(x,y,288,32,"Next:")
self.contents.font.color = normal_color
self.contents.draw_text(x+60,y,80,32,actor.next_exp_s,2)
end
end
class Window_BattleStatus < Window_Base
def initialize
super(0, 320, 640, 160)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
self.z = 8
@level_up_flags = [false, false, false, false]
refresh
end
end

class Spriteset_Battle
def initialize
@viewport1 = Viewport.new(0, 0, 640, 320)
@viewport2 = Viewport.new(0, 0, 640, 480)
@viewport3 = Viewport.new(0, 0, 640, 480)
@viewport4 = Viewport.new(0, 0, 640, 480)
@viewport2.z = 8
@viewport3.z = 200
@viewport4.z = 5000
@battleback_sprite = Sprite.new(@viewport1)
@enemy_sprites = []
for enemy in $game_troop.enemies.reverse
@enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
end
@actor_sprites = []
@actor_sprites.push(Sprite_Battler.new(@viewport2))
@actor_sprites.push(Sprite_Battler.new(@viewport2))
@actor_sprites.push(Sprite_Battler.new(@viewport2))
@actor_sprites.push(Sprite_Battler.new(@viewport2))
@weather = RPG::Weather.new(@viewport1)
@picture_sprites = []
for i in 51..100
@picture_sprites.push(Sprite_Picture.new(@viewport3,
$game_screen.pictures[i]))
end
@timer_sprite = Sprite_Timer.new
update
end
end


Enjoy.
Rpgx
Ahh now there's somethin I remember! FF8.. good times! Anyway, once again congradulations! Prexus, I don't know what RRR could do without ya!
Taku
Woah, that's pretty good. I like it *thumbs up*. If I get around to making a XP project that'd be a nice script to implement. Much better then the standard deal eh?
Noobitron
Very nice script! you have done it once again.
Soku
Prexus, prexus prexus...Sigh...

How are you so godly?
Raven The Dark Angel
Hmm for some reason it isn't working for me. Could you possibly repost the script because all those little "?" thingies are getting in the way. Thanks a lot.
sithious
Go to the view bar on your browser and change the coding to unicode (CTF-8)
italianstal1ion
every time i try to use this script, it says: TypeError ??????

"no implicit conversions from nil to integer"

EDIT: It always says that for lines 6, 288, 388 which is:

self.contents.font.size = $fontsize

I guess it's not reading the font size right, but I don't know enough about code to fix it. please help!
sithious
ok everywhere it says $fontsize and $fontname you need to reeplace it with "Tahoma"(for fontname) and 12 (or whicever font size you preefer for fontsize)
The Wanderer
I copy it, but it only pastes on one line for me...
jens009
QUOTE (Guardian @ Jul 11 2006, 01:18 AM)
I copy it, but it only pastes on one line for me...
*


Click reply on Prexus Post.. Copy the script on replying to his quote
The Wanderer
Nevermind, but now, when I try to play it after switching the font size, it says

cannot convert String into Integer.
italianstal1ion
Ahh i figured it out!

Th system uses its own default type and size, so instead of just : self.contents.font.name = $fontface it needs to be:

self.contents.font.name = $defaultfonttype

And instead of : self.contents.font.size = $fontsize

it needs to be:

self.contents.font.size = $defaultfontsize

:Smilie7: :Smilie7: :Smilie7:
The Wanderer
That'll work?
Rockman
All these scripts might convince me to actually try to use RMXP again. Good job! :Thumbup:
italianstal1ion
god this script is giving me so many errors...

Yes, guardian when you put the $defaultfont instead of $font it works, but once I got rid of the text errors, more and more began to pop up.

i found a four player battle report anyway...
pomeang
QUOTE (Prexus @ Oct 15 2005, 06:14 PM) *


I made this for Lionheart's FF8 remake, thus the reason for there being a maximum of 3 party members.

Also, it is arranged for the DBS. If you wish to apply this to other battle systems please figure it out yourself as I get frustrated with other's problems usually if I don't have the code directly infront of me (I don't use other's battle systems ever.)

Make sure to import an entirely black image 640x480 into the Picture's folder named Blackout.png (Click Here)

Put this in a new script above MAIN called 'level':
CODE
class Window_EXPTitle < Window_Base
def initialize
? super(0, 0, 640, 64)
? self.contents = Bitmap.new(width - 32, height - 32)
? self.contents.font.name = $fontface
? self.contents.font.size = $fontsize
? self.visible = false
? refresh
end
def refresh
? self.contents.clear
? self.contents.draw_text(4,0,640,32,"EXP")
end
end

class Window_EXPPlayer1 < Window_Base
def initialize(exp)
? @exp = exp
? super(32, 64, 288, 128)
? self.contents = Bitmap.new(width - 32, height - 32)
? self.contents.font.name = $fontface
? self.contents.font.size = $fontsize
? self.z += 10
? self.visible = false
? refresh
end
def refresh
? self.contents.clear
? actor = $game_party.actors[0]
? draw_actor_name(actor, 4, 0)
? draw_actor_level(actor, 4, 32)
? draw_actor_rcvexp(actor, 100, 0, @exp)
? draw_actor_curexp(actor, 100, 32)
? draw_actor_nxtexp(actor, 100, 64)
end
end

class Window_EXPPlayer2 < Window_Base
def initialize(exp)
? @exp = exp
? super(32, 192, 288, 128)
? self.contents = Bitmap.new(width - 32, height - 32)
? self.contents.font.name = $fontface
? self.contents.font.size = $fontsize
? self.z += 10
? self.visible = false
? refresh
end
def refresh
? self.contents.clear
? actor = $game_party.actors[1]
? draw_actor_name(actor, 4, 0)
? draw_actor_level(actor, 4, 32)
? draw_actor_rcvexp(actor, 100, 0, @exp)
? draw_actor_curexp(actor, 100, 32)
? draw_actor_nxtexp(actor, 100, 64)
end
end

class Window_EXPPlayer3 < Window_Base
def initialize(exp)
? @exp = exp
? super(32, 320, 288, 128)
? self.contents = Bitmap.new(width - 32, height - 32)
? self.contents.font.name = $fontface
? self.contents.font.size = $fontsize
? self.z += 10
? self.visible = false
? refresh
end
def refresh
? self.contents.clear
? actor = $game_party.actors[2]
? draw_actor_name(actor, 4, 0)
? draw_actor_level(actor, 4, 32)
? draw_actor_rcvexp(actor, 100, 0, @exp)
? draw_actor_curexp(actor, 100, 32)
? draw_actor_nxtexp(actor, 100, 64)
end
end

class Window_EXPBlank2 < Window_Base
def initialize
? super(32, 192, 288, 128)
? self.contents = Bitmap.new(width - 32, height - 32)
? self.contents.font.name = $fontface
? self.contents.font.size = $fontsize
? self.z += 10
? self.visible = false
end
end

class Window_EXPBlank3 < Window_Base
def initialize
? super(32, 320, 288, 128)
? self.contents = Bitmap.new(width - 32, height - 32)
? self.contents.font.name = $fontface
? self.contents.font.size = $fontsize
? self.z += 10
? self.visible = false
end
end

class Window_Background < Window_Base
? def initialize
? ? super(-16,-16,672,512)
? ? self.opacity = 0
? ? self.z = 9
? ? self.visible = false
? ? self.contents = Bitmap.new(width - 32, height - 32)
? ? icon_bitmap = RPG::Cache.picture("Blackout.png") # Replace this with a 640x480 image of BLACK
? ? self.contents.blt(0, 0, icon_bitmap, icon_bitmap.rect)
? ? icon_bitmap.dispose
? end
end

class Scene_Battle
def main
? $game_temp.in_battle = true
? $game_temp.battle_turn = 0
? $game_temp.battle_event_flags.clear
? $game_temp.battle_abort = false
? $game_temp.battle_main_phase = false
? $game_temp.battleback_name = $game_map.battleback_name
? $game_temp.forcing_battler = nil
? $game_system.battle_interpreter.setup(nil, 0)
? @troop_id = $game_temp.battle_troop_id
? $game_troop.setup(@troop_id)
? s1 = $data_system.words.attack
? s2 = $data_system.words.skill
? s3 = $data_system.words.guard
? s4 = $data_system.words.item
? @actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])
? @actor_command_window.y = 160
? @actor_command_window.back_opacity = 160
? @actor_command_window.active = false
? @actor_command_window.visible = false
? @party_command_window = Window_PartyCommand.new
? @help_window = Window_Help.new
? @help_window.back_opacity = 160
? @help_window.visible = false
? @status_window = Window_BattleStatus.new
? @message_window = Window_Message.new
? @spriteset = Spriteset_Battle.new
? @wait_count = 0
? if $data_system.battle_transition == ""
? ? Graphics.transition(20)
? else
? ? Graphics.transition(40, "Graphics/Transitions/" +
? ? ? $data_system.battle_transition)
? end
? start_phase1
? loop do
? ? Graphics.update
? ? Input.update
? ? update
? ? if $scene != self
? ? ? break
? ? end
? end
? $game_map.refresh
? Graphics.freeze
? @actor_command_window.dispose
? @party_command_window.dispose
? @help_window.dispose
? @status_window.dispose
? @message_window.dispose
? if @skill_window != nil
? ? @skill_window.dispose
? end
? if @item_window != nil
? ? @item_window.dispose
? end
? if @result_window != nil
? ? @result_window.dispose
? end
? if @titleresult_window != nil
? ? @titleresult_window.dispose
? ? @p1result_window.dispose
? ? @p2result_window.dispose
? ? @p3result_window.dispose
? ? @background_window.dispose
? end
? @spriteset.dispose
? if $scene.is_a?(Scene_Title)
? ? Graphics.transition
? ? Graphics.freeze
? end
? if $BTEST and not $scene.is_a?(Scene_Gameover)
? ? $scene = nil
? end
end

def start_phase5
? @phase = 5
? $game_system.me_play($game_system.battle_end_me)
? $game_system.bgm_play($game_temp.map_bgm)
? exp = 0
? gold = 0
? treasures = []
? for enemy in $game_troop.enemies
? ? unless enemy.hidden
? ? ? exp += enemy.exp
? ? ? gold += enemy.gold
? ? ? 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
? treasures = treasures[0..5]
? 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 += exp
? ? ? if actor.level > last_level
? ? ? ? @status_window.level_up(i)
? ? ? end
? ? end
? end
? $game_party.gain_gold(gold)
? for item in treasures
? ? 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
? end
? @result_window = Window_BattleResult.new(gold, treasures)
? @titleresult_window = Window_EXPTitle.new
? case $game_party.actors.size
? when 1
? ? @p1result_window = Window_EXPPlayer1.new(exp)
? ? @p2result_window = Window_EXPBlank2.new
? ? @p3result_window = Window_EXPBlank3.new
? when 2
? ? @p1result_window = Window_EXPPlayer1.new(exp)
? ? @p2result_window = Window_EXPPlayer2.new(exp)
? ? @p3result_window = Window_EXPBlank3.new
? when 3
? ? @p1result_window = Window_EXPPlayer1.new(exp)
? ? @p2result_window = Window_EXPPlayer2.new(exp)
? ? @p3result_window = Window_EXPPlayer3.new(exp)
? end
? @background_window = Window_Background.new
? @phase5_wait_count = 60
end
def update_phase5
? if @phase5_wait_count > 0
? ? @phase5_wait_count -= 1
? ? if @phase5_wait_count == 0
? ? ? @titleresult_window.visible = true
? ? ? @p1result_window.visible = true
? ? ? @p2result_window.visible = true
? ? ? @p3result_window.visible = true
? ? ? @result_window.visible = true
? ? ? @background_window.visible = true
? ? ? $game_temp.battle_main_phase = false
? ? ? @status_window.refresh
? ? end
? ? return
? end
? if Input.trigger?(Input::C)
? ? $game_switches[0001] = true
? ? battle_end(0)
? end
end
end

class Window_BattleResult < Window_Base
def initialize(gold, treasures)
? @gold = gold
? @treasures = treasures
? super(320, 64, 288, 384)
? self.contents = Bitmap.new(width - 32, height - 32)
? self.contents.font.name = $fontface
? self.contents.font.size = $fontsize
? self.z += 10
? self.visible = false
? refresh
end
def refresh
? self.contents.clear
? x = 4
? self.contents.font.color = normal_color
? cx = contents.text_size(@gold.to_s).width
? self.contents.draw_text(x, 0, cx, 32, @gold.to_s)
? x += cx + 4
? self.contents.font.color = system_color
? self.contents.draw_text(x, 0, 128, 32, $data_system.words.gold)
? y = 32
? for item in @treasures
? ? draw_item_name(item, 4, y)
? ? y += 32
? end
end
end

class Window_Base
? #-
? def draw_actor_rcvexp(actor,x,y,exp)
? ? self.contents.font.color = Color.new(255,255,128,255)
? ? self.contents.draw_text(x,y,288,32,"EXP:")
? ? self.contents.font.color = normal_color
? ? self.contents.draw_text(x+60,y,80,32,exp.to_s,2)
? end
? #-
? def draw_actor_curexp(actor,x,y)
? ? self.contents.font.color = Color.new(255,255,128,255)
? ? self.contents.draw_text(x,y,288,32,"Current:")
? ? self.contents.font.color = normal_color
? ? self.contents.draw_text(x+60,y,80,32,actor.exp_s,2)
? end
? #-
? def draw_actor_nxtexp(actor,x,y)
? ? self.contents.font.color = Color.new(255,255,128,255)
? ? self.contents.draw_text(x,y,288,32,"Next:")
? ? self.contents.font.color = normal_color
? ? self.contents.draw_text(x+60,y,80,32,actor.next_exp_s,2)
? end
end
class Window_BattleStatus < Window_Base
? def initialize
? ? super(0, 320, 640, 160)
? ? self.contents = Bitmap.new(width - 32, height - 32)
? ? self.contents.font.name = $fontface
? ? self.contents.font.size = $fontsize
? ? self.z = 8
? ? @level_up_flags = [false, false, false, false]
? ? refresh
? end
end

class Spriteset_Battle
? def initialize
? ? @viewport1 = Viewport.new(0, 0, 640, 320)
? ? @viewport2 = Viewport.new(0, 0, 640, 480)
? ? @viewport3 = Viewport.new(0, 0, 640, 480)
? ? @viewport4 = Viewport.new(0, 0, 640, 480)
? ? @viewport2.z = 8
? ? @viewport3.z = 200
? ? @viewport4.z = 5000
? ? @battleback_sprite = Sprite.new(@viewport1)
? ? @enemy_sprites = []
? ? for enemy in $game_troop.enemies.reverse
? ? ? @enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
? ? end
? ? @actor_sprites = []
? ? @actor_sprites.push(Sprite_Battler.new(@viewport2))
? ? @actor_sprites.push(Sprite_Battler.new(@viewport2))
? ? @actor_sprites.push(Sprite_Battler.new(@viewport2))
? ? @actor_sprites.push(Sprite_Battler.new(@viewport2))
? ? @weather = RPG::Weather.new(@viewport1)
? ? @picture_sprites = []
? ? for i in 51..100
? ? ? @picture_sprites.push(Sprite_Picture.new(@viewport3,
? ? ? ? $game_screen.pictures[i]))
? ? end
? ? @timer_sprite = Sprite_Timer.new
? ? update
? end
end


Enjoy.


Thank allot
Shiroiyuki
Alright, I tried to incorporate this script into my editor but it came up with a lot of errors.


I've removed the question marks. This was not the problem. I added the script right where the instructions said to add it, and even uploading the png file just to make sure there'd be no error.

But it still will not work.

The only thing I can figure is I don't have the correct battle system. Would you mind explaining what you mean by 'DBS', and where I could get the script for that (if need be)?

I'd very much like to have this work but it is very frustrating right now. Thanks.
Sepharius
I get this error:
Script 'Level' line 3: SyntaxError occurred.
Night5h4d3
you need to find/remove all the question marks that dont belong:

CODE
? super(0, 0, 640, 64)
becomes
CODE
   super(0, 0, 640, 64)
Sepharius
QUOTE (Night5h4d3 @ Jul 28 2009, 03:17 PM) *
you need to find/remove all the question marks that dont belong:

CODE
? super(0, 0, 640, 64)
becomes
CODE
   super(0, 0, 640, 64)


Thanks, worked like a charm but when I enter a battle I now get this o.o (thumbnail)

QUOTE (sithious @ Jul 11 2006, 10:00 AM) *
ok everywhere it says $fontsize and $fontname you need to reeplace it with "Tahoma"(for fontname) and 12 (or whicever font size you preefer for fontsize)

Ohh so from
self.contents.font.name = $fontface
self.contents.font.size = $fontsize

to

self.contents.font.name = $Tahoma
self.contents.font.size = $12

or


self.contents.font.name = Tahoma
self.contents.font.size = 12

?
zzcloudzz
why are there question marks anyway? What a waste of my time.
QUOTE (Night5h4d3 @ Jul 28 2009, 07:17 AM) *
you need to find/remove all the question marks that dont belong:

CODE
? super(0, 0, 640, 64)
becomes
CODE
   super(0, 0, 640, 64)




I got the same thing to.
QUOTE (Sepharius @ Jul 28 2009, 11:20 AM) *
QUOTE (Night5h4d3 @ Jul 28 2009, 03:17 PM) *
you need to find/remove all the question marks that dont belong:

CODE
? super(0, 0, 640, 64)
becomes
CODE
   super(0, 0, 640, 64)


Thanks, worked like a charm but when I enter a battle I now get this o.o (thumbnail)

QUOTE (sithious @ Jul 11 2006, 10:00 AM) *
ok everywhere it says $fontsize and $fontname you need to reeplace it with "Tahoma"(for fontname) and 12 (or whicever font size you preefer for fontsize)

Ohh so from
self.contents.font.name = $fontface
self.contents.font.size = $fontsize

to

self.contents.font.name = $Tahoma
self.contents.font.size = $12

or


self.contents.font.name = Tahoma
self.contents.font.size = 12

?


Please just edit your old posts ~ Night_Runner
Night_Runner
Edited the original post to address the issues of $fontface, $fontsize, and the random ?'s
In answer to the previous question, it's
$fontface = "Tahoma"
and
$fontsize = 12
and the question marks are there due to formatting issues, nothing sinister.
yamina-chan
It has been a while since the last post in this topic was made, but there is something I have to say.
One thing I noticed while testing this for a while is that it does not infrom you if you gain a Level or learn something new. Is someone able to change that? Say for example, an aditional window pop's up if the Player earned a new Level, a second one if a new ability was lerned.
Sceenshots to show what I am talking about.
Default:


What I mean:
Night_Runner
@> yamina-chan:
How's this?

[Show/Hide] Night_Runner's Edit
CODE
#==============================================================================
# ** Prexus' FF Battle Report
#------------------------------------------------------------------------------
# History:
#  Edited by: Night_Runner
#  Date Edited: 04/Apr/11
#  Created for: yamina-chan
#   @> http://www.rpgrevolution.com/forums/index.php?showtopic=196
#
# Description:
#  This script is designed to show a report after the completion of
#  a battle, and shows actor's exp, exp gained, items gained, etc.
#  This edit showsa pop-up message telling the player of any skills
#  learnt / level changes.
#
# How to Install:
#  Copy this entire script. In your game, select Tools >> Script Editor.
#  Along the left, scroll all the way to the bottom, right click on 'Main',
#   and select 'Insert'
#  Paste the code in the blank window on the right.
#
# Customization:
#  See directly below.
#  To chagne where the pop-up windows are placed, please refer to
#  lines 181 - 202.
#==============================================================================



#==============================================================================
# ** Customization
#==============================================================================

module Prexus_FFBattleReport_Customization
  ReportTitleText = "Battle Report"
  ReportTitleAlignment = 1 # 0 for left, 1 for middle, 2 for right
  LevelUpText = "LV Up!"
  SkillLearntText = "New Skill!"
  BackgroundBitmap = "Blackout.png" # Displays black if not found
  EXPGained = "EXP:"
  EXPCurrent = "Current:"
  EXPUntilLvlUp = "Next:"
end

#==============================================================================
# ** End of Customization
#==============================================================================



#==============================================================================
# ** Define Postality Knights variables.
#==============================================================================
$fontface = Font.default_name if $fontface.nil?
$fontsize = Font.default_size if $fontsize.nil?
#==============================================================================
# ** End defining Postality Knights variables.
#==============================================================================



#==============================================================================
# ** Window_BattleReportActor
#------------------------------------------------------------------------------
#  This window shows an actors starts during the battle report
#==============================================================================

class Window_BattleReportActor < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(actor_index, gained_exp)
    @actor = $game_party.actors[actor_index]
    @gained_exp = gained_exp
    super(32, 64 + 128 * actor_index, 288, 128)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fontface
    self.contents.font.size = $fontsize
    self.z += 10
    self.visible = false
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    # Clear the bitmap
    self.contents.clear
    # Draw nothing if there is no actor
    return if @actor.nil?
    draw_actor_name(@actor, 4, 0)
    draw_actor_level(@actor, 4, 32)
    draw_actor_rcvexp(@actor, 100, 0, @gained_exp)
    draw_actor_curexp(@actor, 100, 32)
    draw_actor_nxtexp(@actor, 100, 64)
  end
end



#==============================================================================
# ** Window_BattleReportItems
#------------------------------------------------------------------------------
#  This window is part of the battle report, it shows the items & gold gained.
#==============================================================================

class Window_BattleReportItems < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(gold, treasures)
    @gold = gold
    @treasures = treasures
    super(320, 64, 288, 384)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fontface
    self.contents.font.size = $fontsize
    self.z += 10
    self.visible = false
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    # Clear the bitmap
    self.contents.clear
    # Draw the gold gained in normal_color
    x = 4
    self.contents.font.color = normal_color
    cx = contents.text_size(@gold.to_s).width
    self.contents.draw_text(x, 0, width - 32, 32, @gold.to_s)
    # Draw the gold symbol (G) in blue
    x += cx + 4
    self.contents.font.color = system_color
    self.contents.draw_text(x, 0, 128, 32, $data_system.words.gold)
    # Draw each of the treasures
    y = 32
    for item in @treasures
      draw_item_name(item, 4, y)
      y += 32
    end
  end
end



#==============================================================================
# ** Window_BattleReportItems
#------------------------------------------------------------------------------
#  This window is part of the battle report, it shows the items & gold gained.
#==============================================================================

class Window_BattleReportPopUp < Window_Base
  #--------------------------------------------------------------------------
  # * Module
  #--------------------------------------------------------------------------
  include Prexus_FFBattleReport_Customization
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(actor_index, type)
    @type = type
    x = get_x(actor_index, type)
    y = get_y(actor_index, type)
    width = get_width(actor_index, type)
    super(x, y, width, 48)
    self.z += 100
    self.contents = Bitmap.new(width - 32, height - 32)
    self.visible = false
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    case @type
    when 0 # Level Up
      self.contents.draw_text(0, -8, width - 32, 32, LevelUpText)
    when 1 # New Skill
      self.contents.draw_text(0, -8, width - 32, 32, SkillLearntText)
    end
  end
  #--------------------------------------------------------------------------
  # * Get x coordinate of window
  #--------------------------------------------------------------------------
  def get_x(index, type)
    case type
    when 0 # Level Up
      return 191
    when 1 # New Skill
      return 32
    end
  end
  #--------------------------------------------------------------------------
  # * Get y coordinate of window
  #--------------------------------------------------------------------------
  def get_y(index, type)
    case type
    when 0 # Level Up
      return 57 + 128 * index
    when 1 # Skill
      return 144 + 128 * index
    end
  end
  #--------------------------------------------------------------------------
  # * Get width of window
  #--------------------------------------------------------------------------
  def get_width(index, type)
    case type
    when 0 # Level Up
      return 74
    when 1 # Skill
      return 110
    end
  end
end



#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
#  Edited to show the battlereport
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # * Alias Methods
  #--------------------------------------------------------------------------
  alias prexus_battleReport_main  main unless $@
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main(*args)
    # Run the original code
    prexus_battleReport_main(*args)
    # Dispose of the windows
    if @titleresult_window != nil
      @titleresult_window.dispose
      @actorresult_windows.each { |window| window.dispose }
      @battlereport_sprite.bitmap.dispose
      @battlereport_sprite.dispose
      @battlereport_popup_windows.each { |window| window.dispose }
    end
  end
  #--------------------------------------------------------------------------
  # * Start Phase 5
  #--------------------------------------------------------------------------
  def start_phase5
    custom = Prexus_FFBattleReport_Customization
    @phase = 5
    $game_system.me_play($game_system.battle_end_me)
    $game_system.bgm_play($game_temp.map_bgm)
    exp = 0
    gold = 0
    treasures = []
    for enemy in $game_troop.enemies
      unless enemy.hidden
        exp += enemy.exp
        gold += enemy.gold
        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
    treasures = treasures[0..5]
    # Keep record of changes in level & skills
    level_changed = [false] * 3
    skills_learnt = [false] * 3
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      if actor.cant_get_exp? == false
        last_level = actor.level
        last_skillList = actor.skills.clone
        actor.exp += exp
        if actor.level > last_level
          @status_window.level_up(i)
          level_changed[i] = true
        end
        skills_learnt[i] = last_skillList != actor.skills
      end
    end
    $game_party.gain_gold(gold)
    for item in treasures
      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
    end
    # Make the blackout background
    @battlereport_sprite = Sprite.new
    # Draw the bitmap (if it exists)
    begin
      @battlereport_sprite.bitmap = RPG::Cache.picture(custom::BackgroundBitmap)
    rescue
      @battlereport_sprite.bitmap = Bitmap.new(640, 480)
      rect = Rect.new(0, 0, 640, 480)
      color = Color.new(0, 0, 0)
      @battlereport_sprite.bitmap.fill_rect(rect, color)
    end
    @battlereport_sprite.z = 100
    @battlereport_sprite.visible = false
    # Make the items window
    @result_window = Window_BattleReportItems.new(gold, treasures)
    # Make the title window
    @titleresult_window = Window_Help.new
    text, align = [custom::ReportTitleText, custom::ReportTitleAlignment]
    @titleresult_window.set_text(text, align)
    @titleresult_window.visible = false
    # Make the actors windows
    @actorresult_windows = []
    (0..2).each {|i| @actorresult_windows<<Window_BattleReportActor.new(i, exp)}
    # Make the LV Up and New Skill windows
    @battlereport_popup_windows = []
    for i in 0..2
      if level_changed[i]
        @battlereport_popup_windows << Window_BattleReportPopUp.new(i, 0)
      end
      if skills_learnt[i]
        @battlereport_popup_windows << Window_BattleReportPopUp.new(i, 1)
      end
    end
    # Have the pause for effect
    @phase5_wait_count = 60
  end
  #--------------------------------------------------------------------------
  # * Update Phase 5
  #--------------------------------------------------------------------------
  def update_phase5
    if @phase5_wait_count > 0
      @phase5_wait_count -= 1
      if @phase5_wait_count == 0
        @titleresult_window.visible = true
        @actorresult_windows.each { |window| window.visible = true }
        @result_window.visible = true
        @battlereport_sprite.visible = true
        @battlereport_popup_windows.each { |window| window.visible = true }
        $game_temp.battle_main_phase = false
        @status_window.refresh
      end
      return
    end
    if Input.trigger?(Input::C)
      $game_switches[1] = true
      battle_end(0)
    end
  end
end



#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
#  Edited to show the battlereport
#==============================================================================

class Window_Base
  #--------------------------------------------------------------------------
  # * Draw Actor Recieved EXP
  #--------------------------------------------------------------------------
  def draw_actor_rcvexp(actor,x,y,exp)
    self.contents.font.color = Color.new(255,255,128,255)
    text = Prexus_FFBattleReport_Customization::EXPGained
    self.contents.draw_text(x,y,288,32,text)
    self.contents.font.color = normal_color
    self.contents.draw_text(x+60,y,80,32,exp.to_s,2)
  end
  #--------------------------------------------------------------------------
  # * Draw Actor EXP
  #--------------------------------------------------------------------------
  def draw_actor_curexp(actor,x,y)
    self.contents.font.color = Color.new(255,255,128,255)
    text = Prexus_FFBattleReport_Customization::EXPCurrent
    self.contents.draw_text(x,y,288,32,text)
    self.contents.font.color = normal_color
    self.contents.draw_text(x+60,y,80,32,actor.exp_s,2)
  end
  #--------------------------------------------------------------------------
  # * Draw Actor EXP until level up
  #--------------------------------------------------------------------------
  def draw_actor_nxtexp(actor,x,y)
    self.contents.font.color = Color.new(255,255,128,255)
    text = Prexus_FFBattleReport_Customization::EXPUntilLvlUp
    self.contents.draw_text(x,y,288,32,text)
    self.contents.font.color = normal_color
    self.contents.draw_text(x+60,y,80,32,actor.next_exp_s,2)
  end
end




#==============================================================================
# ** Window_BattleStatus
#------------------------------------------------------------------------------
#  Edited to lower the z
#==============================================================================

class Window_BattleStatus < Window_Base
  #--------------------------------------------------------------------------
  # * Alias Methods
  #--------------------------------------------------------------------------
  alias prexus_battleReport_initialize  initialize  unless $@
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(*args)
    # Run the original initialize
    prexus_battleReport_initialize(*args)
    # Set the Z
    self.z = 8
  end
end



#==============================================================================
# ** Spriteset_Battle
#------------------------------------------------------------------------------
#  Edited the z layers...
#==============================================================================

class Spriteset_Battle
  #--------------------------------------------------------------------------
  # * Alias Methods
  #--------------------------------------------------------------------------
  alias prexus_battleReport_initialize  initialize  unless $@
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(*args)
    # Run the original initialize
    prexus_battleReport_initialize(*args)
    # Set the Z of the viewport2
    @viewport2.z = 8
  end
end



#==============================================================================
# ** End of Script.
#==============================================================================
yamina-chan
It's great, thank you =D
This is exactly what seemed to be missing ^^
evil joesph
I apologize for necrobumping, but I was looking at your modifications Night_Runner, and I wish I could have it with 4 people and the pop ups for leveling up etc. I realize there is already a four person battle report script, but I'm have no knowledge in scripting so that could just take it and throw in the pop ups as well. Your help would be much appreciated, but it's definitely nothing urgent.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.