Game Over Screen Change

Is there a way to change the file used for the Game Over Screen with a script command?


Also, is there a way to change its music?


Please reply ASAP.
Are these global changes that you want, or do you want screens and music which are for specific maps/battles?
Global changes.
Open your game file, then Graphics folder, then System.  Drop in the image you would like.  It must be called GameOver.


On the Systems tab of the Editor, left column, 4th box, click on the ... and select which track you want from the music you've installed in BGM folder.
I already know that, I was asking for a script command that could change the file used mid-game.


(also, small note: the music used for the Game Over screen is a ME, not a BGM.)
That is why I asked if it was global or specific, and when you said global I assume that that was what you meant.


First you need a snippet like this (credit Shaz)



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


  end


end

The <insert condition here> is the line where a variety of possibilities can go. 


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 == x

where 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
However, if it's going to be for the rest of the game, then a switch would probably be much easier than listing all the (many) maps remaining. 


Turn it on when you reach the areas where you want the 'alternate' image to be shown, and use this condition:



!$game_switches[id]

That will show the default gameover when the switch is off, and the alternate one when it's on. As far as I am aware, it is either map or switch, it can't be both.


I haven't seen a method for changing the music.  You will need to start a fresh thread in Script requests, specifying that it is to change the music partway through the game, as that cannot be done by pure eventing.
What is [SIZE=10pt]@sprite[/SIZE][SIZE=10pt].[/SIZE][SIZE=10pt]bitmap [/SIZE][SIZE=10pt]=[/SIZE][SIZE=10pt] [/SIZE][SIZE=10pt]Cache[/SIZE][SIZE=10pt].[/SIZE][SIZE=10pt]system[/SIZE][SIZE=10pt]([/SIZE][SIZE=10pt]"GameOver"[/SIZE][SIZE=10pt])[/SIZE] supposed to be?
That is how it calls up the Game Over image.  It therefore follows that AlternateGameOver is the new one.
After using the code and activating the switch, the screen just fades black and nothing happens...


what to do?
No idea.  Have you dropped an image into Graphics/System called AlternateGameOver?  That's the only thing I can think of.


If you have, then I think the best course of action is for this thread to be moved to Script Support and see if any of the scripters there can come up with a solution.
Will do.
Moving this to RSGGx Script Support.
oh. originally read it as "make a new thread" instead of "wait for the thread to be moved".


well, this is a request for a sprite that lets you change the image and ME files used for the game over screen mid-game, with switches.


EDIT: i messed up.


i inserted the code in a event and not in the script editor.


once i realized that, it worked.


this is not cancelling the request for the script, because i still need a way to change the ME file used, and a way to have multiple options.

Original thread: https://forums.rpgmakerweb.com/threads/game-over-screen-change.72066/