Level up window

Well I've been wanting something like this for ages, so basically I got the base of it from a script made by fukuyama (not sure who that is ), got the sections needed and edited it quite a lot (including some minor edits that you won't notice).

What it does

The script shows a window when you level up telling you what your level change is, HP and SP changes are and all you other stats changes are.


How to use it

Simply make a new script below 'Window_BattleResult' and add the 'Window_LevelUpWindow' code in and then make a new script above 'Main' and add the 'Scene_Battle add ons' script in.


Screenies

http://h1.ripway.com/RPGMXP/Levelupwindow.png[/img]

I don't think any other screenies are needed.

The Code

Window_LevelUpWindow Spoiler
#==============================================================================
# Window_LevelUpWindow
#------------------------------------------------------------------------------
# Base from fukuyama's
# Compiled by Syvkal
#==============================================================================

class Window_LevelUpWindow < Window_Base

#--------------------------------------------------------------------------
# Window size
#--------------------------------------------------------------------------

def initialize(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
super(0, 128, 160, 192)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 160
self.visible = false
refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
end

#--------------------------------------------------------------------------
# Editable part of contents
#--------------------------------------------------------------------------

def refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
self.contents.clear
self.contents.font.color = system_color
self.contents.font.name = "Arial"
self.contents.font.size = 14
self.contents.draw_text( 0,   0, 160, 24, "LEVEL UP!!")
self.contents.font.size = 18
self.contents.draw_text( 0,  28, 160, 24, $data_system.words.hp)
self.contents.draw_text( 0,  50, 160, 24, $data_system.words.sp)
self.contents.font.size = 14
self.contents.draw_text( 0,  72,  80, 24, $data_system.words.str)
self.contents.draw_text( 0,  94,  80, 24, $data_system.words.dex)
self.contents.draw_text( 0, 116,  80, 24, $data_system.words.agi)
self.contents.draw_text( 0, 138,  80, 24, $data_system.words.int)
self.contents.font.name = "Wingdings"
self.contents.draw_text(97,   0, 128, 24, "")
self.contents.font.name = "Arial"
self.contents.draw_text(76,  28, 128, 24, "=)
self.contents.draw_text(76,  50, 128, 24, "=")
self.contents.draw_text(76,  72, 128, 24, "=")
self.contents.draw_text(76,  94, 128, 24, "=")
self.contents.draw_text(76, 116, 128, 24, "=")
self.contents.draw_text(76, 138, 128, 24, "=")
self.contents.font.color = normal_color
self.contents.draw_text( 0,   0,  88, 24, last_lv.to_s, 2)
self.contents.draw_text( 0,  28,  72, 24, "+" + up_hp.to_s, 2)
self.contents.draw_text( 0,  50,  72, 24, "+" + up_sp.to_s, 2)
self.contents.draw_text( 0,  72,  72, 24, "+" + up_str.to_s, 2)
self.contents.draw_text( 0,  94,  72, 24, "+" + up_dex.to_s, 2)
self.contents.draw_text( 0, 116,  72, 24, "+" + up_agi.to_s, 2)
self.contents.draw_text( 0, 138,  72, 24, "+" + up_int.to_s, 2)
self.contents.font.size = 20
self.contents.draw_text( 0,   0, 128, 24, actor.level.to_s, 2)
self.contents.draw_text( 0,  26, 128, 24, actor.maxhp.to_s, 2)
self.contents.draw_text( 0,  48, 128, 24, actor.maxsp.to_s, 2)
self.contents.draw_text( 0,  70, 128, 24, actor.str.to_s, 2)
self.contents.draw_text( 0,  92, 128, 24, actor.dex.to_s, 2)
self.contents.draw_text( 0, 114, 128, 24, actor.agi.to_s, 2)
self.contents.draw_text( 0, 136, 128, 24, actor.int.to_s, 2)
end
end
Expand to see the code.


"Scene_Battle add ons Spoiler
#==============================================================================
# Scene_Battle add ons
#------------------------------------------------------------------------------
# Base from fukuyama's
# Compiled by Syvkal
#==============================================================================

#--------------------------------------------------------------------------
# Search for :EDIT:  for parts you can edit.
#--------------------------------------------------------------------------

#==============================================================================
# Window_BattleStatus
#==============================================================================
class Window_BattleStatus < Window_Base
 
#--------------------------------------------------------------------------

attr_accessor :level_up_flags
end


#==============================================================================
# Game_Battler
#==============================================================================
class Game_Battler
 
#--------------------------------------------------------------------------

attr_accessor :exp_gain_ban

#--------------------------------------------------------------------------

alias xrxs_bp10_initialize initialize
def initialize
@exp_gain_ban = false
xrxs_bp10_initialize
end

#--------------------------------------------------------------------------

alias xrxs_bp10_cant_get_exp? cant_get_exp?
def cant_get_exp?
if @exp_gain_ban == true
   return true
else
   return xrxs_bp10_cant_get_exp?
end
end
end


#==============================================================================
# Scene_Battle
#==============================================================================
class Scene_Battle
 
#--------------------------------------------------------------------------

alias xrxs_bp10_start_phase5 start_phase5
def start_phase5

for i in 0...$game_party.actors.size
   $game_party.actors[i].exp_gain_ban = true
end
xrxs_bp10_start_phase5

for i in 0...$game_party.actors.size
   $game_party.actors[i].exp_gain_ban = false
end

@exp_gained = 0
for enemy in $game_troop.enemies
   
   @exp_gained += enemy.exp if not enemy.hidden
end

@phase5_step       = 0
@exp_gain_actor    = -1

@result_window.y -= 64
@result_window.visible = true

phase5_next_levelup
end

#--------------------------------------------------------------------------

alias xrxs_bp10_update_phase5 update_phase5
def update_phase5
case @phase5_step
when 1
   update_phase5_step1
else
   xrxs_bp10_update_phase5
   
   battle_end(0) if @levelup_window != nil and @phase5_wait_count <= 0
end
end

#--------------------------------------------------------------------------

def update_phase5_step1
#  Continue trigger, default : Input::C  (Enter)
if Input.trigger?(Input::C)
   
   @levelup_window.visible = false if @levelup_window != nil
   @status_window.level_up_flags[@exp_gain_actor] = false
   phase5_next_levelup
end
end

#--------------------------------------------------------------------------

def phase5_next_levelup
begin
   
   @exp_gain_actor += 1
 
   if @exp_gain_actor >= $game_party.actors.size
     
     @phase5_step = 0
     return
   end
   actor = $game_party.actors[@exp_gain_actor]
   if actor.cant_get_exp? == false
     
     last_level = actor.level
     last_maxhp = actor.maxhp
     last_maxsp = actor.maxsp
     last_str = actor.str
     last_dex = actor.dex
     last_agi = actor.agi
     last_int = actor.int
     
     actor.exp += @exp_gained
     
     if actor.level > last_level
       
       @status_window.level_up(@exp_gain_actor)
       if $data_system_level_up_se != ""
         Audio.se_stop
         #  :EDIT:             Sound effect of level up
         $data_system_level_up_se = "Audio/SE/001-System01"
         #  End :EDIT:
         Audio.se_play($data_system_level_up_se)
       end
       if $data_system_level_up_me != ""
         Audio.me_stop
         #  :EDIT:                Music effect of level up
         $data_system_level_up_me = "Audio/ME/007-Fanfare01"
         Audio.me_play($data_system_level_up_me)
         #  End :EDIT:
       end
       @levelup_window = Window_LevelUpWindow.new(actor, last_level,
         actor.maxhp - last_maxhp, actor.maxsp - last_maxsp, actor.str - last_str,
         actor.dex - last_dex, actor.agi - last_agi, actor.int - last_int)
       @levelup_window.x = 160 * @exp_gain_actor
       @levelup_window.visible = true
       @phase5_wait_count = 40
       @phase5_step       =  1
       
       @status_window.refresh
       return
     end
   end
end until false
end
end
Expand to see the code.




A Special Note From Me

ENJOY :D :D
Ok. I've updated it from the hack, but I'm missing something so if you know what it is please tell me :D
Syvkal does this show what new skills that were obtained in the level up?
Because I saw something EXACTLY like this in .net but I was'nt too sure if it showed new skills earned. But if it's not there you could try to add it. Why? because THAT could be something missing in these kind of scripts. (Just a suggestion or ya...)
Umm... one problem... Someone posted the script and I was going to edit into the level up window... but with the hack...

Does anyone have something that shows level up ?
Umm, where exactly do we post this? That would help... Or, it's there, and I'm just dumb... ':|
Sweet! Is there a way so it displays new abilities earned?
Nice job man. :)
Valor_Fomr: Simply make a new script below 'Window_BattleResult' and add the 'Window_LevelUpWindow' code in and then make a new script above 'Main' and add the 'Scene_Battle add ons' script in.

DrWeazel: I was going to do that, but the post with the script in was hacked so I no longer have the script with the skill learning window...
I saw one precisley like this on .net, but it showed the window after the Money, EXP thing came up and it showed the skills learned next to it.
OK, you sure you can't find it?
Re-do it?
I'm kidding about the re-do thing but, thanks anyway.
Here's a quick edit to this script that will show a skill learned at the bottom of the level up window. There is only space for one skill, so if you give more than one per level who knows what will happen (I'm not much good with Ruby yet).

#==============================================================================
# Window_LevelUpWindow
#------------------------------------------------------------------------------
# Base from fukuyama's
# Compiled by Syvkal
# Skill gain display by Nphyx
#==============================================================================

class Window_LevelUpWindow < Window_Base

#--------------------------------------------------------------------------
# Window size
#--------------------------------------------------------------------------

def initialize(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
super(0, 128, 160, 192)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 160
self.visible = false
refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
end

#--------------------------------------------------------------------------
# Editable part of contents
#--------------------------------------------------------------------------

def refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
self.contents.clear
self.contents.font.color = system_color
self.contents.font.name = "Arial"
self.contents.font.size = 14
self.contents.draw_text( 0,   0, 160, 24, "LEVEL UP!!")
self.contents.font.size = 16
self.contents.draw_text( 0,  20, 160, 24, $data_system.words.hp)
self.contents.draw_text( 0,  40, 160, 24, $data_system.words.sp)
self.contents.font.size = 14
self.contents.draw_text( 0,  60,  80, 24, $data_system.words.str)
self.contents.draw_text( 0,  80,  80, 24, $data_system.words.dex)
self.contents.draw_text( 0, 100,  80, 24, $data_system.words.agi)
self.contents.draw_text( 0, 120,  80, 24, $data_system.words.int)
self.contents.font.size = 16
    for j in $data_classes[actor.class_id].learnings
      if j.level == actor.level
        self.contents.draw_text( 0, 140, 160, 24, "Learned " + $data_skills[j.skill_id].name + "!")
      end
    end
self.contents.font.size = 14
self.contents.font.name = "Wingdings"
self.contents.draw_text(97,   0, 128, 24, "")
self.contents.font.name = "Arial"
self.contents.draw_text(76,  20, 128, 24, "=")
self.contents.draw_text(76,  40, 128, 24, "=")
self.contents.draw_text(76,  60, 128, 24, "=")
self.contents.draw_text(76,  80, 128, 24, "=")
self.contents.draw_text(76, 100, 128, 24, "=")
self.contents.draw_text(76, 120, 128, 24, "=")
self.contents.font.color = normal_color
self.contents.draw_text( 0,   0,  88, 24, last_lv.to_s, 2)
self.contents.draw_text( 0,  20,  72, 24, "+" + up_hp.to_s, 2)
self.contents.draw_text( 0,  40,  72, 24, "+" + up_sp.to_s, 2)
self.contents.draw_text( 0,  60,  72, 24, "+" + up_str.to_s, 2)
self.contents.draw_text( 0,  80,  72, 24, "+" + up_dex.to_s, 2)
self.contents.draw_text( 0, 100,  72, 24, "+" + up_agi.to_s, 2)
self.contents.draw_text( 0, 120,  72, 24, "+" + up_int.to_s, 2)
self.contents.font.size = 16
self.contents.draw_text( 0,   0, 128, 24, actor.level.to_s, 2)
self.contents.draw_text( 0,  20, 128, 24, actor.maxhp.to_s, 2)
self.contents.draw_text( 0,  40, 128, 24, actor.maxsp.to_s, 2)
self.contents.draw_text( 0,  60, 128, 24, actor.str.to_s, 2)
self.contents.draw_text( 0,  80, 128, 24, actor.dex.to_s, 2)
self.contents.draw_text( 0, 100, 128, 24, actor.agi.to_s, 2)
self.contents.draw_text( 0, 120, 128, 24, actor.int.to_s, 2)
end
end

#==============================================================================
# Scene_Battle add ons
#------------------------------------------------------------------------------
# Base from fukuyama's
# Compiled by Syvkal
#==============================================================================

#--------------------------------------------------------------------------
# Search for :EDIT:  for parts you can edit.
#--------------------------------------------------------------------------

#==============================================================================
# Window_BattleStatus
#==============================================================================
class Window_BattleStatus < Window_Base
 
#--------------------------------------------------------------------------

attr_accessor :level_up_flags
end


#==============================================================================
# Game_Battler
#==============================================================================
class Game_Battler
 
#--------------------------------------------------------------------------

attr_accessor :exp_gain_ban

#--------------------------------------------------------------------------

alias xrxs_bp10_initialize initialize
def initialize
@exp_gain_ban = false
xrxs_bp10_initialize
end

#--------------------------------------------------------------------------

alias xrxs_bp10_cant_get_exp? cant_get_exp?
def cant_get_exp?
if @exp_gain_ban == true
   return true
else
   return xrxs_bp10_cant_get_exp?
end
end
end


#==============================================================================
# Scene_Battle
#==============================================================================
class Scene_Battle
 
#--------------------------------------------------------------------------

alias xrxs_bp10_start_phase5 start_phase5
def start_phase5

for i in 0...$game_party.actors.size
   $game_party.actors[i].exp_gain_ban = true
end
xrxs_bp10_start_phase5

for i in 0...$game_party.actors.size
   $game_party.actors[i].exp_gain_ban = false
end

@exp_gained = 0
for enemy in $game_troop.enemies
   
   @exp_gained += enemy.exp if not enemy.hidden
end

@phase5_step       = 0
@exp_gain_actor    = -1

@result_window.y -= 64
@result_window.visible = true

phase5_next_levelup
end

#--------------------------------------------------------------------------

alias xrxs_bp10_update_phase5 update_phase5
def update_phase5
case @phase5_step
when 1
   update_phase5_step1
else
   xrxs_bp10_update_phase5
   
   battle_end(0) if @levelup_window != nil and @phase5_wait_count <= 0
end
end

#--------------------------------------------------------------------------

def update_phase5_step1
#  Continue trigger, default : Input::C  (Enter)
if Input.trigger?(Input::C)
   
   @levelup_window.visible = false if @levelup_window != nil
   @status_window.level_up_flags[@exp_gain_actor] = false
   phase5_next_levelup
end
end

#--------------------------------------------------------------------------

def phase5_next_levelup
begin
   
   @exp_gain_actor += 1
 
   if @exp_gain_actor >= $game_party.actors.size
     
     @phase5_step = 0
     return
   end
   actor = $game_party.actors[@exp_gain_actor]
   if actor.cant_get_exp? == false
     
     last_level = actor.level
     last_maxhp = actor.maxhp
     last_maxsp = actor.maxsp
     last_str = actor.str
     last_dex = actor.dex
     last_agi = actor.agi
     last_int = actor.int
     
     actor.exp += @exp_gained
     
     if actor.level > last_level
       
       @status_window.level_up(@exp_gain_actor)
       if $data_system_level_up_se != ""
         Audio.se_stop
         #  :EDIT:             Sound effect of level up
         $data_system_level_up_se = "Audio/SE/001-System01"
         #  End :EDIT:
         Audio.se_play($data_system_level_up_se)
       end
       if $data_system_level_up_me != ""
         Audio.me_stop
         #  :EDIT:                Music effect of level up
         $data_system_level_up_me = "Audio/ME/007-Fanfare01"
         Audio.me_play($data_system_level_up_me)
         #  End :EDIT:
       end
       @levelup_window = Window_LevelUpWindow.new(actor, last_level,
         actor.maxhp - last_maxhp, actor.maxsp - last_maxsp, actor.str - last_str,
         actor.dex - last_dex, actor.agi - last_agi, actor.int - last_int)
       @levelup_window.x = 160 * @exp_gain_actor
       @levelup_window.visible = true
       @phase5_wait_count = 40
       @phase5_step       =  1
       
       @status_window.refresh
       return
     end
   end
end until false
end
end
Expand to see the code.
Any way ro show it out of battle?
Brosek;315009 wrote:
Any way ro show it out of battle?


Use an event to call: Window_LevelUpWindow.new

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=1197