Help - Search - Members - Calendar
Full Version: Hanging script error
RPG RPG Revolution Forums > Scripting > Script Development and Support > RGSS
falloutboyfan182
I'm using these two scripts together, but it gives me a script hanging error. How to fix?

CODE
class Window_Score < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 64)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
cx = contents.text_size($data_system.words.gold).width
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120-cx-2, 32, $game_variables[1].to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(124-cx, 0, cx, 32, "score", 2)
end
end


CODE
class Interpreter
def show_score
@window = Window_Score.new
loop do
@window.refresh
end
if $game_variables[2] == 2
break
@window.dispose
end
end
end
Night5h4d3
the hanging error is because the script is not calling graphics.update. in loop do you're only calling @window.refresh with no way of breaking out, so once that code gets run, the interpreter is stuck in that loop endlessly, if you want to just throw a quick-fix in, add
CODE
Graphics.update

in the same loop.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.