You've pointed out a nice mistake I made in my individual battlestatus windows script.
CODE
#==============================================================================
# ** XP: Night_Runner's Individual Battlestatus Windows
#------------------------------------------------------------------------------
# History:
# Date Created: 19/Feb/2012
# Last Edited: 25/Mar.2012
# Created for: Wonderjosh
# @> http://www.rpgrevolution.com/forums/index.php?showtopic=55412
#
# Description:
# This script has individual battlestatus windows for each actor, lines
# 64 - 75 make the active battler's window move up a bit.
#
# How to Install:
# Copy this entire script. In your game editor select Tools >> Script
# Editor. Along the left hand side scroll to the bottom, right click on
# 'Main' and select 'Insert'. Past on the right.
#==============================================================================
#==============================================================================
# ** Customization
#==============================================================================
module NR_IndividualBattlestatusWindows
WindowWidth = 120 # Width of the individual windows (pixels)
WindowHeight = 150 # Height of the individual windows (pixels)
WindowDistBottom = 20 # Distance between the bottom of the screen and
# individual windows (pixels)
MoveUpDist = 20 # Amount to move the active actor's window up
# by (pixels)
WindowMoveSpeed = 2 # Speed to move up at (pixels/frame)
TextDY = 26 # Distance between each line of text (pixels)
ShowState = true # Append a Status/Level up line (true/false)
end
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# Edited to have the actors match the window positions
#==============================================================================
class Game_Actor
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :battle_active_y
#--------------------------------------------------------------------------
# * Alias Methods
#--------------------------------------------------------------------------
alias nr_ibw_initialize initialize unless $@
alias nr_ibw_screen_y screen_y unless $@
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(*args)
@battle_active_y = 0
return nr_ibw_initialize(*args)
end
#--------------------------------------------------------------------------
# * Get Battle Screen X-Coordinate
#--------------------------------------------------------------------------
def screen_x
# Return after calculating x-coordinate by order of members in party
if self.index != nil
num_actors = $game_party.actors.size
ww = NR_IndividualBattlestatusWindows::WindowWidth
x = 320 - num_actors * ww / 2 + self.index * ww + ww / 2
return x
else
return 0
end
end
#--------------------------------------------------------------------------
# * Get Battle Screen Y-Coordinate
#--------------------------------------------------------------------------
def screen_y(*args)
return nr_ibw_screen_y(*args) + @battle_active_y
end
end
#==============================================================================
# ** Spriteset_Battle
#------------------------------------------------------------------------------
# Edited to allow a fullscreen backdrop.
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Make viewports
@viewport1 = Viewport.new(0, 0, 640, 480) #NREdit
@viewport2 = Viewport.new(0, 0, 640, 480)
@viewport3 = Viewport.new(0, 0, 640, 480)
@viewport4 = Viewport.new(0, 0, 640, 480)
@viewport2.z = 101
@viewport3.z = 200
@viewport4.z = 5000
# Make battleback sprite
@battleback_sprite = Sprite.new(@viewport1)
# Make enemy sprites
@enemy_sprites = []
for enemy in $game_troop.enemies.reverse
@enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
end
# Make actor sprites
@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))
# Make weather
@weather = RPG::Weather.new(@viewport1)
# Make picture sprites
@picture_sprites = []
for i in 51..100
@picture_sprites.push(Sprite_Picture.new(@viewport3,
$game_screen.pictures[i]))
end
# Make timer sprite
@timer_sprite = Sprite_Timer.new
# Frame update
update
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update actor sprite contents (corresponds with actor switching)
@actor_sprites[0].battler = $game_party.actors[0]
@actor_sprites[1].battler = $game_party.actors[1]
@actor_sprites[2].battler = $game_party.actors[2]
@actor_sprites[3].battler = $game_party.actors[3]
# If battleback file name is different from current one
if @battleback_name != $game_temp.battleback_name
@battleback_name = $game_temp.battleback_name
if @battleback_sprite.bitmap != nil
@battleback_sprite.bitmap.dispose
end
@battleback_sprite.bitmap = RPG::Cache.battleback(@battleback_name)
@battleback_sprite.src_rect.set(0, 0, 640, 480) #NREdit
end
# Update battler sprites
for sprite in @enemy_sprites + @actor_sprites
sprite.update
end
# Update weather graphic
@weather.type = $game_screen.weather_type
@weather.max = $game_screen.weather_max
@weather.update
# Update picture sprites
for sprite in @picture_sprites
sprite.update
end
# Update timer sprite
@timer_sprite.update
# Set screen color tone and shake position
@viewport1.tone = $game_screen.tone
@viewport1.ox = $game_screen.shake
# Set screen flash color
@viewport4.color = $game_screen.flash_color
# Update viewports
@viewport1.update
@viewport2.update
@viewport4.update
end
end
#==============================================================================
# ** Window_IndividualBattleStatus
#------------------------------------------------------------------------------
# This window displays the status of each party members on the battle screen.
#==============================================================================
class Window_IndividualBattleStatus < Window_Base
#--------------------------------------------------------------------------
# * Include Modules
#--------------------------------------------------------------------------
include NR_IndividualBattlestatusWindows
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :active_battler
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(actor_index)
@actor_index = actor_index
num_actors = $game_party.actors.size
x = 320 - num_actors * WindowWidth / 2 + @actor_index * WindowWidth
y = 480 - WindowHeight - WindowDistBottom
super(x, y, WindowWidth, WindowHeight)
self.contents = Bitmap.new(width - 32, height - 32)
@level_up_flags = false
@active_battler = false
refresh
end
#--------------------------------------------------------------------------
# * Set Level Up Flag
# actor_index : actor index
#--------------------------------------------------------------------------
def level_up
@level_up_flags = true
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
actor = $game_party.actors[@actor_index]
return if not actor.is_a?(Game_Actor)
width = self.contents.width
draw_actor_name(actor, 0, 0 * TextDY)
draw_actor_hp(actor, 0, 1 * TextDY, width)
draw_actor_sp(actor, 0, 2 * TextDY, width)
if @level_up_flags
self.contents.font.color = normal_color
self.contents.draw_text(0, 3 * TextDY, width, 32, "Level Up!")
else
draw_actor_state(actor, 0, 3 * TextDY, width)
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
# Slightly lower opacity level during main phase
if $game_temp.battle_main_phase
self.contents_opacity -= 4 if self.contents_opacity > 191
else
self.contents_opacity += 4 if self.contents_opacity < 255
end
# Move the window
upper_y = 480 - WindowDistBottom - WindowHeight
if @active_battler == true
self.y = [self.y - WindowMoveSpeed, upper_y - MoveUpDist].max
else
self.y = [self.y + WindowMoveSpeed, upper_y].min
end
$game_party.actors[@actor_index].battle_active_y = self.y - upper_y
end
end
#==============================================================================
# ** Window_BattleStatus
#------------------------------------------------------------------------------
# This array holds each battle window
#==============================================================================
class Window_BattleStatus
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Create an array of battlestatus windows
@battle_windows = []
# Populate the battlestatus windows
for i in 0...$game_party.actors.size
@battle_windows[i] = Window_IndividualBattleStatus.new(i)
end
end
#--------------------------------------------------------------------------
# * Level Up
#--------------------------------------------------------------------------
def level_up(actor_index)
# Make sure that the window exists
if not @battle_windows[actor_index].is_a?(Window_IndividualBattleStatus)
return
end
# Tell the appropriate window to run the level up algorithm
@battle_windows[actor_index].level_up
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
# For each window, refresh
@battle_windows.each { |window| window.refresh }
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# For each window, update
@battle_windows.each { |window| window.update }
end
#--------------------------------------------------------------------------
# * Active Actor Index
#--------------------------------------------------------------------------
def active_actor_index=(active_index)
# Loop through each window
for i in 0...@battle_windows.size
# Get the window for this loop
window = @battle_windows[i]
# If it is active, move up (to 300 pixels form the top)
window.active_battler = (i == active_index)
end
end
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
def dispose
# For each window, dispose
@battle_windows.each { |window| window.dispose }
end
end
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# Edited to tell the status window which actors are acitve
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# * Alias Methods
#--------------------------------------------------------------------------
alias nr_ibw_phase3_update update unless $@
alias nr_ibw_phase3_setup_command_window phase3_setup_command_window unless $@
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update(*args)
# Run the original update
nr_ibw_phase3_update(*args)
# If the active battler is an actor, tell the battlestatus windows array
# which actor is active
if @active_battler.is_a?(Game_Actor)
actor_index = $game_party.actors.index(@active_battler)
@status_window.active_actor_index = actor_index
# If an enemy is active, then set no window as active
else
@status_window.active_actor_index = -1
end
end
#--------------------------------------------------------------------------
# * Actor Command Window Setup
#--------------------------------------------------------------------------
def phase3_setup_command_window(*args)
# Run the original phase3_setup_command_window
nr_ibw_phase3_setup_command_window(*args)
# Get where to show the window
num_actors = $game_party.actors.size
ww = NR_IndividualBattlestatusWindows::WindowWidth
aw = @actor_command_window.width
x = 320 - num_actors * ww / 2 + @actor_index * ww + (ww - aw) / 2
wh = NR_IndividualBattlestatusWindows::WindowHeight
wdb = NR_IndividualBattlestatusWindows::WindowDistBottom
muh = NR_IndividualBattlestatusWindows::MoveUpDist
y = 480 - wh - wdb - muh - @actor_command_window.height
# Set actor command window position
@actor_command_window.x = x
@actor_command_window.y = y
end
end
#==============================================================================
# ** End of Script.
#==============================================================================
I forgot to put 1 digit in there, amazing how much something like that propagates...
I've gone back to your original topic asking for that script and fixed it, in case anyone else tries using it from there.
I've also got a working version of the elemental states scirpt working
CODE
# Elemental Effects as Icons
# Original Script by Ccoa
# Only works with Ryex's collapsing menu script
class Window_Base
def draw_elements(elements, x, y)
for i in 0...elements.length
if i < 7
# 24 is the width of the icons
ix = 26 * i
icon_name = elements[i]
draw_icon(icon_name, x + ix, y)
end
end
end
def draw_icon(icon_name, x, y)
bitmap = RPG::Cache.icon(icon_name)
self.contents.blt(x, y, bitmap, Rect.new(0, 0, 24, 24))
end
end
if $RyexCOLCMS == true
#==============================================================================
# ** Window_Item_Info
#------------------------------------------------------------------------------
# This Class makes a Window that displays an Items Statistics
#==============================================================================
class Window_Item_Info
alias nr_elementalIcons_refresh refresh unless $@
def refresh
if @item != nil
case @item
when RPG::Weapon
elems = @item.element_set.map { |id| $data_system.elements[id] }
when RPG::Armor
elems = @item.guard_element_set.map { |id| $data_system.elements[id] }
end
blank = Bitmap.new(200, 32)
self.contents.blt(123, 92, blank, blank.rect)
draw_elements(elems, 123, 92)
end
end
end
end
And the demo I've been using:
http://min.us/mi1z1Ro1A