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.

help with gameover

Aran

Member

why is this acting so difficult?

Code:
class Scene_Gameover
  
  alias save_opt_upd update
  
  def update
    save_opt_upd
    if Input.trigger?(Input::C)
      $game_temp.player_transferring = true
      $game_temp.player_new_map_id = 7
      $game_temp.player_new_x = 4
      $game_temp.player_new_y = 5
      $game_temp.player_new_direction = 0
      $scene = Scene_Map.new
      $game_map.autoplay
    end
  end
    
end

when I hit enter on the Game Over screen it teleports me back to the event that I used to force the Game Over, and then it runs the code to transfer, but at the same time runs the game over again. What the fuk?
 
Hiya Aran!

Try this:
Code:
class Scene_Gameover
  
  alias save_opt_upd update
  
  def update
    if Input.trigger?(Input::C)
      $game_temp.player_transferring = true
      $game_temp.player_new_map_id = 7
      $game_temp.player_new_x = 4
      $game_temp.player_new_y = 5
      $game_temp.player_new_direction = 0
      $scene = Scene_Map.new
      $game_map.autoplay
    end
    save_opt_upd
  end
    
end
 
And this?
Code:
class Scene_Gameover
  
  alias save_opt_upd update
  
  def update
    if Input.trigger?(Input::C)
      $game_temp.player_transferring = true
      $game_temp.player_new_map_id = 7
      $game_temp.player_new_x = 4
      $game_temp.player_new_y = 5
      $game_temp.player_new_direction = 0
      $scene = Scene_Map.new
      $game_map.autoplay
    else
      save_opt_upd
    end
  end
    
end
It worked for me.
 

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