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.

[RGSS2] Game.exe has encountered a problem and has had to close...

I'm using RGSS2 in XP, as per the tutorial on these boards.

I have a simple scene, with some windows in it, that's all. If I open and close the scene a few times, I get "Game.exe has encountered a problem and has had to close". It doesn't point me to any lines.

This is the script:

Code:
class Scene_Stats

  def main
    @goldwin = Window_Gold.new
    @goldwin.x = 400
    @goldwin.y = 360
    @spr = Sprite.new
    @spr.bitmap = RPG::Cache.picture('hud')
    @spr.z = 9999
    @hud = Window_HUD.new
    @spriteset = Spriteset_Map.new
    @toolbar = Window_Toolbar.new
    @stats = Window_MenuStatus.new
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @stats.dispose
    @spr.dispose
    @spriteset.dispose
    @toolbar.dispose
    @hud.dispose
    @goldwin.dispose
  end
  
  def update
    @stats.update
    @goldwin.update
    @spriteset.update
    if Input.trigger?(Input::B) or Input.trigger?(Input::C)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Map.new
      return
    end
  end
end

Thanks for your help...




Important edit:

This now happens in pretty much every menu in the game that uses windows. Is there something new to RGSS2 I have missed or something?
 

poccil

Sponsor

The error message was given by the operating system, not by RGSS.  It was caused by a crash in the game system, not by the Ruby framework, unfortunately.  That's why no clues were given as to the script that caused the error  The only way to find the source of the problem is to determine which script was running when the game crashed.
 
not true... when ive been coding it sometimes errors like this when you are using a non-ruby based code or pointer... in this case its probably a compatability issue in RGSS2 -> RGSS... in my case it was incorrect Win32API usage...

but poccil is right... you'll need to find the source and fix it
 
I get the error when opening the following scenes:

-Default Scene_Menu
-Default Scene_Item
-Default Scene_Equip
-The scene I posted above

I am using a mouse input script, presumably meaning it uses WinAPI. BUT, I can use the mouse perfectly fine elsewhere, including other scenes that have windows in them, so I don't think it's the mouse causing the problems.

WinAPI is also used for keyboard input, though this works fine in the Netplay+ login screen, so that's not the problem.
 

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