Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

"Script Hanging"

Hi, I know I've been requesting a lot lately, but here's my request:

Is there any way of changing what it says when it says "Script Hanging"?
 
You can't change the actual text, but there may be a way around it. Ruby throws errors, so if you find out what kind of error it throws for that, you can rescue it and print a different text message. So look for the Exception subclass and go rescue it!
 
Sadly this message doesn't seem to be a ruby exception, but an hard coded message in C, so you can't change it, unless you want to modify the dll.
Proof :

Code:
begin

  while true
  end

rescue
p "should show but doesn't"
end



However, you can prevent it from happening by throwing some Graphics.update distant of less than 10 seconds.
 
Actually, rataime, the message is cause by a Ruby exception. The text is, however hardcoded. An easy workaround to change it.
So, here it is, just replace your Main with it. Then add your font stuff, as usual.
Code:
#==============================================================================
# ** Main
#------------------------------------------------------------------------------
#  After defining each class, actual processing begins here.
#==============================================================================

begin
  # Prepare for transition
  Graphics.freeze
  # Make scene object (title screen)
  $scene = Scene_Title.new
  # Call main method as long as $scene is effective
  while $scene != nil
    $scene.main
  end
  # Fade out
  Graphics.transition(20)
rescue Errno::ENOENT, Hangup
  if $!.is_a?(Errno::ENOENT)
    # Supplement Errno::ENOENT exception
    # If unable to open file, display message and end
    filename = $!.message.sub("No such file or directory - ", "")
    print "Unable to find file #{filename}."
  elsif $!.is_a?(Hangup)
    # CHANGE MESSAGE BELOW
    print 'Oh dear. This script is compleatly crap so it froze up.
Tough luck, eh?'
  end
end
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top