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_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
Group: Member
Posts: 99
Type: None
RM Skill: Skilled
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?
Group: Member
Posts: 1
Type: Developer
RM Skill: Undisclosed
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.
Group: Revolutionary
Posts: 204
Type: Artist
RM Skill: Skilled
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)
Group: Member
Posts: 1
Type: Artist
RM Skill: Beginner
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':
Group: Member
Posts: 7
Type: Artist
RM Skill: Beginner
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.
__________________________
Current Project: The Tempest Database: 18% Maps: 4% Storyline: 79% Artwork: 3% Music/sounds: 3% Scripts: 1% (Help is always appreciated) --------------------------------- Completed: 4%