WolfwoodSama
Member
Firstly, the script in question:
Now, normally when I want to make a window slide into position I o something like this:
And that works quite perfectly! However, the above script does not have a "def update", and I am not talented enough to figure out where one might go. So, how could I go about making the levelup window slide into place?
Code:
#==============================================================================
# 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, 0, 640, 340)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 0
self.opacity = 0
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
draw_actor_body(actor,320,0,255)
self.contents.font.size = 36
self.contents.font.outline = true
self.contents.font.underline = true
self.contents.font.color = Color.orange
self.contents.draw_text( 170, 48, 260, 48, "LEVEL UP: "+actor.name+" Lv"+actor.level.to_s)
self.contents.font.underline = false
self.contents.font.color = system_color
self.contents.draw_text( 170, 80, 160, 48, $data_system.words.hp)
self.contents.draw_text( 170, 110, 160, 48, $data_system.words.sp)
self.contents.draw_text( 170, 140, 80, 48, $data_system.words.str)
self.contents.draw_text( 170, 170, 80, 48, $data_system.words.dex)
self.contents.draw_text( 170, 200, 80, 48, $data_system.words.agi)
self.contents.draw_text( 170, 230, 80, 48, $data_system.words.int)
self.contents.font.color = normal_color
#self.contents.draw_text( 0, 0, 88, 24, last_lv.to_s, 2)
self.contents.draw_text( 170, 80, 260, 48, "+" + up_hp.to_s, 2)
self.contents.draw_text( 170, 110, 260, 48, "+" + up_sp.to_s, 2)
self.contents.draw_text( 170, 140, 260, 48, "+" + up_str.to_s, 2)
self.contents.draw_text( 170, 170, 260, 48, "+" + up_dex.to_s, 2)
self.contents.draw_text( 170, 200, 260, 48, "+" + up_agi.to_s, 2)
self.contents.draw_text( 170, 230, 260, 48, "+" + up_int.to_s, 2)
#self.contents.draw_text( 170, 0, 128, 48, "Lv"+actor.level.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 -= 0
@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/008-Fanfare02"
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
Now, normally when I want to make a window slide into position I o something like this:
Code:
def update
if @the_window.x != 0
@the_window.x += 4
end
...
...
...
end
And that works quite perfectly! However, the above script does not have a "def update", and I am not talented enough to figure out where one might go. So, how could I go about making the levelup window slide into place?