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.

load game question...

I'd like to call the load game by events, and when I call this:

Code:
$scene = Scene_Load.new

it goes to the title screen when I press the cancel button

I'd like to know if there is a way to let it come back to the map when the cancel button is pressed...
 
That's one thing I hated EB doing. There's a few ways around this.

The basic way is just to go into Scene_Load and replace Scene_Title with Scene_Map, but don't do that.

Also, don't make an entirely new class that does that for a 1 line change as others have done. Pointles...

Instead, use this:

Code:
class Scene_Load
  alias seph_returnfix_scnld_init initialize
  alias seph_returnfix_scnld_oc on_cancel
  def initialize
    seph_returnfix_scnld_init
    @seph_returnfix_scene = $scene.class
  end
  def on_cancel
    seph_returnfix_scnld_oc
    $scene = @seph_returnfix_scene.new
  end
end

That will make it return to whatever scene it was previously called from.
 
Just put this in a new script window above main and it should work:
Code:
class Scene_Load < Scene_File
  
  alias raz_load_initialize initialize
  alias raz_load_on_cancel on_cancel
  
  def initialize
    @scene = $scene
    raz_load_initialize
  end
  
  def on_cancel
    raz_load_on_cancel
    $scene = @scene
  end
  
end

Edit:
Damn you Seph. XD
 

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