Hey everyone, I was wondering if there was a way to change the game over screen via events or scripting. I already have a custom game over screen but wanted to be able to change the screen depending on the area the player is in. Any ideas or help? 🙂 Thank you
How to change Game Over Screen
RGSSx Script SupportIt's a pity you didn't provide more information. How do you define "the area the player is in"? Is it certain maps that need a specific gameover image? Is it certain areas within a map?
All I can give you is the method to change it based on the condition. Because you didn't state what "depending on the area" means, you will have to figure out that condition yourself.
All I can give you is the method to change it based on the condition. Because you didn't state what "depending on the area" means, you will have to figure out that condition yourself.
Code:
class Scene_Gameover < Scene_Base def create_background @sprite = Sprite.new if <insert condition here> @sprite.bitmap = Cache.system("GameOver") else @sprite.bitmap = Cache.system("AlternateGameOver") end endend
Actually Shaz that's even better 🙂 , thank you! I was originally thinking about having it change for the map but conditions are better! 🙂
If you want it to change for the map, then put either of these as the condition:
if it's only one map:
$game_map.map_id == xwhere x is the map number (no leading zeros)
or if it's several maps that you want to show that image:
[1,2,3,4,5].include?($game_map.map_id)where that image will be shown for maps 1, 2, 3, 4 and 5
If you want to use a switch instead, turn it on when you reach the areas where you want the 'alternate' image to be shown, and use this condition:
That will show the default gameover when the switch is off, and the alternate one when it's on.
if it's only one map:
$game_map.map_id == xwhere x is the map number (no leading zeros)
or if it's several maps that you want to show that image:
[1,2,3,4,5].include?($game_map.map_id)where that image will be shown for maps 1, 2, 3, 4 and 5
If you want to use a switch instead, turn it on when you reach the areas where you want the 'alternate' image to be shown, and use this condition:
Code:
!$game_switches[id]
Shaz, you're the best! As always, thank you 🙂
oK Shaz it's working perfectly, thanks again 🙂
You could use if and elsif , or use a hash or an array to set which gameover screen is for which map ID, then just load that value instead of using an if
Code:
if condition1elsif condition2elsif condition3elseend
Code:
class Scene_Gameover < Scene_Base GO_SCREENS = [] GO_SCREENS[1] = "GameOver" GO_SCREENS[2] = "GameOverE" #and so on def create_background @sprite = Sprite.new @sprite.bitmap = Cache.system(GO_SCREENS[$game_map.map_id]) endend
Yeah I was thinking that, I just wasn't sure how exactly to execute it. I'm taking a programming class and we just recently started talking about if and else if statements. Thank you 🙂 Ima try it out
That would require one element for every map id though.
You could always do something like
Code:
class Scene_Gameover < Scene_Base GO_DEFAULT = "GameOver" GO_SCREENS = [] GO_SCREENS[1] = "GameOver" GO_SCREENS[2] = "GameOverE" #and so on def create_background @sprite = Sprite.new if GO_SCREENS[$game_map.map_id].nil? @sprite.bitmap = Cache.system(GO_DEFAULT) else @sprite.bitmap = Cache.system(GO_SCREENS[$game_map.map_id]) end endend
Ah man, you guys are good 🙂
Thank you to you all!
Thank you to you all!
Original thread: https://forums.rpgmakerweb.com/threads/how-to-change-game-over-screen.38056/