• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Script: Game Over

FL

Pokémon Island Creator
2,444
Posts
13
Years
  • Seen Apr 22, 2024
gif.gif
screen.jpg

When a switch is on, its activates a game over when the player lose.

Link

Tested on Essentials v19.1 and v20.1. More versions (v12-18.1) on link. If this script isn't working on latest Essentials version, please inform on this thread.
 
Last edited by a moderator:

Dylanrockin

That guy
276
Posts
12
Years
  • Age 28
  • Seen Jun 9, 2016
Where would I put: pbLoadRpgxpScene(Scene_Gameover.new) if $game_switches[GAMEOVERSWITCH]

Would I put it after line 1736, or on line 1736? Also I want to play a song when the game over screen is displayed, how would I go about putting that in?
 
Last edited:

Nickalooose

--------------------
1,309
Posts
16
Years
  • Seen Dec 28, 2023
The English is not the best but.

# To this script works, put it above main and, in PokemonField script
# section before line
# 'if $PokemonGlobal.pokecenterMapId && $PokemonGlobal.pokecenterMapId>=0' add
# line 'pbLoadRpgxpScene(Scene_Gameover.new) if $game_switches[GAMEOVERSWITCH]'

Translated

# For this script to work, put it above main script section... After that, in PokemonField script
# section before line
# 'if $PokemonGlobal.pokecenterMapId && $PokemonGlobal.pokecenterMapId>=0' add
# line 'pbLoadRpgxpScene(Scene_Gameover.new) if $game_switches[GAMEOVERSWITCH]'
 

FL

Pokémon Island Creator
2,444
Posts
13
Years
  • Seen Apr 22, 2024
The English is not the best but.

# To this script works, put it above main and, in PokemonField script
# section before line
# 'if $PokemonGlobal.pokecenterMapId && $PokemonGlobal.pokecenterMapId>=0' add
# line 'pbLoadRpgxpScene(Scene_Gameover.new) if $game_switches[GAMEOVERSWITCH]'

Translated

# For this script to work, put it above main script section... After that, in PokemonField script
# section before line
# 'if $PokemonGlobal.pokecenterMapId && $PokemonGlobal.pokecenterMapId>=0' add
# line 'pbLoadRpgxpScene(Scene_Gameover.new) if $game_switches[GAMEOVERSWITCH]'
I updated the topic with your description. Thanks for your help!
 

Nickalooose

--------------------
1,309
Posts
16
Years
  • Seen Dec 28, 2023
No problem at all glad to give you help since you've gave me help in the past :)
 
8
Posts
4
Years
  • Age 29
  • Seen Oct 7, 2022
Hello,

I'm using version 17.2 with Elite Battle System.
I can't find the PokemonField script in the script editor.
Can someone help me?

(Sorry for my bad English i'm French)
 

FL

Pokémon Island Creator
2,444
Posts
13
Years
  • Seen Apr 22, 2024
Hello,

I'm using version 17.2 with Elite Battle System.
I can't find the PokemonField script in the script editor.
Can someone help me?

(Sorry for my bad English i'm French)
PokemonField changed name to PField_Field
 
8
Posts
4
Years
  • Age 29
  • Seen Oct 7, 2022
Thanks FL !

But I still have a problem. the line 'if $PokemonGlobal.pokecenterMapId && $PokemonGlobal.pokecenterMapId>=0' is not in the PField_Field.
I tried to add the line 'pbLoadRpgxpScene(Scene_Gameover.new) if $game_switches[GAMEOVERSWITCH]' before this line '$PokemonGlobal.pokecenterMapId = $game_map.map_id'
But it doesn't work...
 
Last edited:

FL

Pokémon Island Creator
2,444
Posts
13
Years
  • Seen Apr 22, 2024
Thanks FL !

But I still have a problem. the line 'if $PokemonGlobal.pokecenterMapId && $PokemonGlobal.pokecenterMapId>=0' is not in the PField_Field.
I tried to add the line 'pbLoadRpgxpScene(Scene_Gameover.new) if $game_switches[GAMEOVERSWITCH]' before this line '$PokemonGlobal.pokecenterMapId = $game_map.map_id'
But it doesn't work...
The correct script section is PField_Visuals. Thread edited.
 
15
Posts
5
Years
  • Age 23
  • Seen Sep 24, 2020
I still have problems with this script. Im also using Essentials 17.2
I added the script above main as instructed and then added the all the lines mentioned, see attachment images.
To be sure I also added a gameover screen and ME in System with F9
I then turned the according switch on and lost a battle on purpose, however the script still doesn't work for me and the game still sends me back to the last pokecenter.
Did I do somehting wrong or is there somehting else I may have skipped?
 

Attachments

  • Pfield_Visuals.png
    Pfield_Visuals.png
    24.4 KB · Views: 14
  • PokeBattle_Battle.png
    PokeBattle_Battle.png
    25.1 KB · Views: 13
  • scene gameover.JPG
    scene gameover.JPG
    111.9 KB · Views: 12

FL

Pokémon Island Creator
2,444
Posts
13
Years
  • Seen Apr 22, 2024
I still have problems with this script. Im also using Essentials 17.2
I added the script above main as instructed and then added the all the lines mentioned, see attachment images.
To be sure I also added a gameover screen and ME in System with F9
I then turned the according switch on and lost a battle on purpose, however the script still doesn't work for me and the game still sends me back to the last pokecenter.
Did I do somehting wrong or is there somehting else I may have skipped?
Everything looks right.

Did the right switch is turned on when you lose?
Maybe is another script interfering. Try with Vanilla Essentials.
 
12
Posts
5
Years
  • Age 32
  • Seen Aug 8, 2022
hey this works perfect thanks! where do I put my custom image and sound I didnt find the section in debug? can i just be given the naming convention and folder I can manually place them please, thanks!
 
12
Posts
5
Years
  • Age 32
  • Seen Aug 8, 2022
nvermind I found it in the actual system settings, I was looking in debug mode...
but the issue now is the music event does not end when it goes back to main menu, it carries on?
 
21
Posts
11
Years
  • Seen yesterday
this would be very cool for a nuzlocke based game, is there a way to make it delete the save if you black out?
 

FL

Pokémon Island Creator
2,444
Posts
13
Years
  • Seen Apr 22, 2024
nvermind I found it in the actual system settings, I was looking in debug mode...
but the issue now is the music event does not end when it goes back to main menu, it carries on?
Fixed!

this would be very cool for a nuzlocke based game, is there a way to make it delete the save if you black out?
Before line 'raise Reset.new' add
Code:
        savefile = RTP.getSaveFileName("Game.rxdata")
        begin; File.delete(savefile); rescue; end
        begin; File.delete(savefile+".bak"); rescue; end
 
2
Posts
2
Years
  • Age 33
  • Seen Jun 6, 2022
Hello, I'm struggling making a game over function. I tried to do it my myself, but it does not work.

I copied the script from a fresh project Scene_Gameover and added a line at the end to call the title screen.

210805123947925544.png


The game over screen show as intended and I'm getting back to the title screen, BUT when I choose to load the game, it does not work. I'm getting back at the end of the battle I just lost and going to Pokémon center. And finally, the game crashes.

2108051239472925.png


I'm using the latest version of Essentials : 19.1

I just want a true game over for dungeons in my game.

Thanks in advance for the help.
 
Back
Top