Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Hanging script error
falloutboyfan182
post May 31 2011, 06:36 PM
Post #1


Level 1
Group Icon

Group: Member
Posts: 13
Type: Artist
RM Skill: Undisclosed




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


__________________________
Go to the top of the page
 
+Quote Post
   
Night5h4d3
post May 31 2011, 06:45 PM
Post #2


The past tense
Group Icon

Group: +Gold Member
Posts: 1,199
Type: Scripter
RM Skill: Undisclosed




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.


__________________________
Got 30 minutes? Then you've enough time to play this awesome game:

- potentially promising project page
- thanks holder
My growing space of user-bars:

about me:







I made the following!





Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 21st May 2013 - 09:21 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker