The RPG Maker Resource Kit

RMRK RPG Maker Creation => VX => VX Scripts Database => Topic started by: worale on August 05, 2008, 03:25:33 PM

Title: + [ Battle Result Window ] +
Post by: worale on August 05, 2008, 03:25:33 PM
Battle Result Window
Version 1.0
by Woratana
Release Date: 05/08/2008


Introduction
I discussed about battle result window for VX with my friend for a while.
The problem is that there is no built-in battle result window in VX.
(The result will show in message box instead)

So I try to script this to see if it's possible to make one.
I put the same information as the battle result window in XP.

Enjoy~  :lol:


Screenshots
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fwww.uppic.net%2Fib%2Fbattle_result_window.png&hash=e95eb2c96f9b81cb9620f52b33b536fd489aacab)


Script
Place it above main
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi28.tinypic.com%2F25thhqt.jpg&hash=833f5ec2a8321d5a9849e130e03ba2e23cc6930b)
Code: [Select]
#===============================================================
# ? [VX] ? Battle Result Window ? ?
#--------------------------------------------------------------
# ? by Woratana [woratana@hotmail.com]
# ? Thaiware RPG Maker Community
# ? Released on: 03/08/2008
# ? Version: 1.0
#--------------------------------------------------------------

class Window_Battle_Result < Window_Base
  def initialize(result_data)
    super(0, 0, 516, 32 + (WLH * ($game_party.members.size + 2)) )
    self.z = 10001
    contents.font.color = normal_color
    contents.draw_text(0, 0, contents.width, WLH, result_data[0])
    contents.draw_text(0, WLH, contents.width, WLH, result_data[1])
    $game_party.members.each_index do |i|
      actor = $game_party.members[i]
      ty = WLH * (i + 2)
      draw_actor_name(actor, 0, ty)
      draw_actor_hp(actor, 140, ty)
      contents.font.color = system_color
      text = sprintf(Vocab::ExpNext, Vocab::level)
      tw = contents.text_size(text).width
      contents.draw_text(292, ty, contents.width, WLH, text)
      contents.font.color = normal_color
      contents.draw_text(292 + tw + 16, ty, contents.width, WLH, actor.next_exp_s)
    end
  end
end

class Scene_Battle < Scene_Base
  alias wora_batreswin_scebat_batend battle_end
  alias wora_batreswin_scebat_disexpgold display_exp_and_gold
 
  def battle_end(result)
    @result_window.dispose if result == 0
    wora_batreswin_scebat_batend(result)
  end
 
  def display_exp_and_gold
    result_data = [sprintf(Vocab::ObtainExp, $game_troop.exp_total),
  sprintf(Vocab::ObtainGold, $game_troop.gold_total, Vocab::gold)]
    @result_window = Window_Battle_Result.new(result_data)
    wora_batreswin_scebat_disexpgold
  end
end


Instruction
Just place script above main :D


Author's Notes
Free for use in your work if credit is included.


Bug Report?
Please give me these informations:
Quote
- What is it says in error window?
- When is it get error? (Right after run game, when you choose something, etc.)
- Do you have any other scripts running in your game that may crash with this script?
Title: Re: + [ Battle Result Window ] +
Post by: modern algebra on August 05, 2008, 04:08:24 PM
It looks great. Nice work worale.
Title: Re: + [ Battle Result Window ] +
Post by: Leventhan on August 06, 2008, 01:48:39 AM
I think so too.  ;8
Title: Re: + [ Battle Result Window ] +
Post by: moejoeman on August 22, 2008, 03:16:23 AM
Thanx mate great script
Title: Re: + [ Battle Result Window ] +
Post by: Razielboy on October 05, 2008, 01:26:12 AM
Thank you for this I will be using this in my game.
Title: Re: + [ Battle Result Window ] +
Post by: Razielboy on October 06, 2008, 09:14:58 PM
Ok i have a problem with this the numbers cut off at the end. I was wondering if there was a way to fix this
Title: Re: + [ Battle Result Window ] +
Post by: WeaponMaster Kaesar on November 12, 2008, 09:18:25 AM
Nice script, works well. Only thing I could hope for is that the numbers for the TNL showed how much you need, compared to the bar for next level.

EX
Gained 50 EXP
(Current) Bob H 123 / 321 To Next Level 500

Gained 50 EXP
(Wished for) Bob H 123 / 321 To Next Level 450

Otherwise, it's awesome.
Title: Re: + [ Battle Result Window ] +
Post by: ehmz1021 on December 05, 2010, 01:10:48 PM
Thanks for this awesome script <3 :lol:
Title: Re: + [ Battle Result Window ] +
Post by: Cooldoode137 on March 28, 2011, 03:55:44 AM
This works fine. I have one problem though. How do I get my game to not show the original battle result window? And how do I move THIS result window to the middle or bottom of the screen?
Title: Re: + [ Battle Result Window ] +
Post by: Ark_Fantasy on May 11, 2011, 07:48:33 PM
Nice job worale!!! I like this and I am going to put it in my game. Congratz!
Title: Re: + [ Battle Result Window ] +
Post by: Kotone123 on July 15, 2011, 09:17:57 PM
Truly a remarkable script there!
Title: Re: + [ Battle Result Window ] +
Post by: mittenrc on July 16, 2011, 05:09:30 AM
Superb. I'd love to use this on our game :)