Lunawolfcomics

The Omega
Veteran
Joined
Feb 18, 2014
Messages
662
Reaction score
192
First Language
English
Primarily Uses
RMMV
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
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,647
Reaction score
15,740
First Language
English
Primarily Uses
RMMV
It'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.

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
 

Lunawolfcomics

The Omega
Veteran
Joined
Feb 18, 2014
Messages
662
Reaction score
192
First Language
English
Primarily Uses
RMMV
Actually Shaz that's even better :) , thank you! I was originally thinking about having it change for the map but conditions are better! :)
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,647
Reaction score
15,740
First Language
English
Primarily Uses
RMMV
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:

Code:
!$game_switches[id]
That will show the default gameover when the switch is off, and the alternate one when it's on.
 

Lunawolfcomics

The Omega
Veteran
Joined
Feb 18, 2014
Messages
662
Reaction score
192
First Language
English
Primarily Uses
RMMV
Shaz, you're the best! As always, thank you :)
 

Lunawolfcomics

The Omega
Veteran
Joined
Feb 18, 2014
Messages
662
Reaction score
192
First Language
English
Primarily Uses
RMMV
oK Shaz it's working perfectly, thanks again :)
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,693
Reaction score
3,023
First Language
Tagalog
Primarily Uses
RMVXA
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
 

Lunawolfcomics

The Omega
Veteran
Joined
Feb 18, 2014
Messages
662
Reaction score
192
First Language
English
Primarily Uses
RMMV
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
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,647
Reaction score
15,740
First Language
English
Primarily Uses
RMMV
That would require one element for every map id though.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,693
Reaction score
3,023
First Language
Tagalog
Primarily Uses
RMVXA
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
 

Lunawolfcomics

The Omega
Veteran
Joined
Feb 18, 2014
Messages
662
Reaction score
192
First Language
English
Primarily Uses
RMMV
Ah man, you guys are good :)

Thank you to you all!
 

Latest Threads

Latest Profile Posts

I just realized two of My series are beginning to look virtually identical to one another in mechanics and general themes, I never had this problem before.

This is Stifling! Must resolve this!
Lord's Reincarnation III (LR3) MOBILE is coming!!!
iu_534706_7630675.png
ScreenShot_1_20_2022_2_19_41.png
Juice FX is amazing... the portal in the middle is actually animated and moves thanks to Juice FX. so I edited part of a map I have and then drew the portal around it. threw it into Juice FX and now it's lively instead of static.
Another thumb update. The nail is beginning to break away, along with the aforementioned hard and blackened dead skin. The final join has regained some of its flexibility, tho it's a bit stiff after being held still for so long. The very tip of my thumb has a strange dry and somewhat tingly feeling to it when I touch it to something, but at least it isn't numb. I am so ready for this to be over. :o

Forum statistics

Threads
118,711
Messages
1,118,082
Members
155,844
Latest member
Feikolon
Top