Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> Submission: FF8 Battle Report, by Prexus
Prexus
post Oct 15 2005, 03:14 AM
Post #1


Level 3
Group Icon

Group: Member
Posts: 31
Type: Event Designer
RM Skill: Masterful






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.

This post has been edited by Night_Runner: Apr 4 2010, 06:36 AM
Reason for edit: Edited o remove random ?'s


__________________________
Go to the top of the page
 
+Quote Post
   

Posts in this topic
- Prexus   Submission: FF8 Battle Report   Oct 15 2005, 03:14 AM
- - Rpgx   Ahh now there's somethin I remember! FF8.....   Nov 6 2005, 06:06 PM
- - Taku   Woah, that's pretty good. I like it *thumbs up...   Nov 6 2005, 06:25 PM
- - Noobitron   Very nice script! you have done it once again.   Jan 27 2006, 03:40 AM
- - Soku   Prexus, prexus prexus...Sigh... How are you so g...   Jun 13 2006, 12:23 AM
- - Raven The Dark Angel   Hmm for some reason it isn't working for me. C...   Jun 26 2006, 10:16 AM
- - sithious   Go to the view bar on your browser and change the ...   Jun 26 2006, 10:41 AM
- - italianstal1ion   every time i try to use this script, it says: Ty...   Jul 8 2006, 08:30 PM
- - sithious   ok everywhere it says $fontsize and $fon...   Jul 11 2006, 01:00 AM
- - Guardian   I copy it, but it only pastes on one line for me.....   Jul 11 2006, 01:18 AM
|- - jens009   QUOTE (Guardian @ Jul 11 2006, 01:18 AM)I cop...   Jul 11 2006, 08:29 AM
- - Guardian   Nevermind, but now, when I try to play it after sw...   Jul 11 2006, 02:04 PM
- - italianstal1ion   Ahh i figured it out! Th system uses its own ...   Jul 12 2006, 09:33 PM
- - Guardian   That'll work?   Jul 12 2006, 09:45 PM
- - RockmanNeo   All these scripts might convince me to actually tr...   Jul 13 2006, 08:45 AM
- - italianstal1ion   god this script is giving me so many errors... Ye...   Jul 13 2006, 05:30 PM
- - pomeang   QUOTE (Prexus @ Oct 15 2005, 06:14 PM) ...   Jun 21 2009, 05:11 AM
|- - Shiroiyuki   Alright, I tried to incorporate this script into m...   Jul 7 2009, 08:35 PM
|- - Sepharius   I get this error: Script 'Level' line 3: S...   Jul 28 2009, 05:58 AM
- - Night5h4d3   you need to find/remove all the question marks tha...   Jul 28 2009, 06:17 AM
|- - Sepharius   QUOTE (Night5h4d3 @ Jul 28 2009, 03:17 PM...   Jul 28 2009, 10:20 AM
- - zzcloudzz   why are there question marks anyway? What a waste ...   Apr 3 2010, 12:07 PM
- - Night_Runner   Edited the original post to address the issues of ...   Apr 4 2010, 06:38 AM
- - yamina-chan   It has been a while since the last post in this to...   Apr 3 2011, 06:56 AM
- - Night_Runner   @> yamina-chan: How's this? [Show/Hide] Ni...   Apr 4 2011, 05:55 AM
- - yamina-chan   It's great, thank you =D This is exactly what ...   Apr 4 2011, 08:45 AM
- - evil joesph   I apologize for necrobumping, but I was looking at...   Aug 3 2011, 07:04 AM


Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 23rd May 2013 - 10:18 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker