Hanging Script Help (RMXP)

Started by WalktoCeres, October 13, 2013, 12:34:57 pm

Previous topic - Next topic

WalktoCeres

Hello,

I'm in pretty dire need for an expert to overlook my scripts for lag prone areas that may inflict the dreaded hanging script hiccup. I've released a game but unfortunately some players are stopped by the script error whereas others are not(probably on the basis of their computer's speed). Is there anyone I can PM my script base for help?

All the best and thank you,

:ninja:

ForeverZer0

A demo project, upload of your Scripts.rxdata, or at the very least a list of scripts would be helpful.
A hanging script just means that Graphics.update has not been called in a reasonable amount of time, usually when a script is caught in a loop that it can't escape from.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

WalktoCeres

A choir of singing thanks for your reply. Here's a link to my scripts: http://www.filedropper.com/scripts_1

From what I've heard the hanging script typically takes place in battle. I have no way of verifying this because my computer has no troubles running the game.

KK20

It'd help more if the players reported a bit more information than "It happened during a battle." I'm quickly scanning through all the loops in the scripts and see nothing yet.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

WalktoCeres

That's my issue aswell. My guess is that the game's hp bar script is calculating the change in hp too slowly in some cases, but this seems unlikely at the same time because the script is so tiny. Is there anywhere that looks liable enough to create problems to stick a 'graphics update' under just as a safeguard? 

ForeverZer0

All the Graphics.update will do is keep the game from crashing, it would just be frozen instead if you place it where the problem is found.  The "Script is hanging" error is meant to be there, and built-in to prevent the game from freezing for eternity.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

KK20

It can't be computer performance. Your players must be doing something unique that's causing this. Where's your game anyways?

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

WalktoCeres


Heretic86

I'll try to explain as best as I can.

Updates are cheap timewise, mostly.

Refreshes draw the Graphics and are Time Consuming.

Infinite hangs:

update until 1 == 0
  #do something
end

This will cause an Infinite loop.

You can try putting "print" inside the script you are using in either its Update or Refresh methods and might be able to find for yourself where your script is hanging.

NOTE:  If the script you are using is calling Refresh every Frame, you'll get a LOT of lag.  Refresh should really only be used when something needs to be completely redrawn, like you change a character Graphic from one graphic to a completely different Graphic.  So what could be causing Hanging is something like this:

def update
  # Redraw the Graphic
  graphic.refresh
  # Other Stuff
end

def refresh
   self.contents.clear
   bar.draw(some arguments)
end

I do suspect you have something that is causing an infinite loop however.

while 1 == 1
  # do stuff
end
graphic.refresh

That will never get to graphic.refresh because 1 is always equal to 1, and will cause the game to spit out the error "Script is hanging".
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)