11-25-2009, 02:11 AM
Ok, it was a division by zero. It is caused by your first actor that does not have SPs. Use this modified version of the refresh method for the Bar class:
EDIT: I'd suggest you to remove the link above, and to use PMs to send links.
Code:
#--------------------------------------------------------------------------
# ? Refresh
#--------------------------------------------------------------------------
def refresh(value,max)
@bar_bg=RPG::Cache.picture(@bar_background)
@bar_fg=RPG::Cache.picture(@bar)
@src_bg = Rect.new(0, 0, @bar_bg.width, @bar_bg.height)
@src_fg = Rect.new(0, 0, @bar_fg.width, @bar_fg.height)
value=[value,max].min
if value==max and @highlight_complete
@bar_fg=RPG::Cache.picture(@bar_complete)
end
x_ratio=@width/200.0
y_ratio=@height/32.0
bg_dest = Rect.new(@x, @y, @width, @height)
@bitmap.stretch_blt(bg_dest, @bar_bg, @src_bg, @back_opacity)
return if max==0
dest = Rect.new(@x+(4*x_ratio).ceil, @y+(4*y_ratio).ceil, ((@width-8*x_ratio)*value/max).ceil, (@height-8*y_ratio))
@bitmap.stretch_blt(dest, @bar_fg, @src_fg, @opacity)
end
EDIT: I'd suggest you to remove the link above, and to use PMs to send links.