Winkio's Custom Gameover Script
Authors: winkio
Version: 1.0
Type: Custom Gameover Script
Key Term: Title / Save / Load / GameOver Add-on
IntroductionThis script will allow you to have a custom gameover, so that when your party dies, it respawns in the map of your choice. This script does not reload data, but rather continues data, so progress is not lost at a gameover. You can add in EXP or Gold loss at gameover too.
Features
- Respawn in the map of your choice upon gameover.
- No need to setup events
- Choose whether or not to subtract gold or xp upon death
Script
#==============================================================================
# Winkio's Custom Gameover Script
# version 1.0
# ** Scene_Gameover
#------------------------------------------------------------------------------
# This class performs game over screen processing.
#==============================================================================
# Instructions
# This Script replaces Scene_Gameover.
# All the customization of this script appears in Frame_update
class Scene_Gameover
#--------------------------------------------------------------------------
# * Main Processing
# This part is the same as in the original
#--------------------------------------------------------------------------
def main
# Make game over graphic
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.gameover($data_system.gameover_name)
# Stop BGM and BGS
$game_system.bgm_play(nil)
$game_system.bgs_play(nil)
# Play game over ME
$game_system.me_play($data_system.gameover_me)
# Execute transition
Graphics.transition(120)
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of game over graphic
@sprite.bitmap.dispose
@sprite.dispose
# Execute transition
Graphics.transition(40)
# Prepare for transition
Graphics.freeze
# If battle test
if $BTEST
$scene = nil
end
end
#--------------------------------------------------------------------------
# * Frame Update
# This part is the part that has been changed.
#--------------------------------------------------------------------------
def update
# If C button was pressed
if Input.trigger?(Input::C)
# Remove State Death for all party members
for actor in $game_party.actors
actor.remove_state(1)
end
# Setup Map ID:005 Change this to the id of whatever map you want.
# Right click and select properties on a map to display the Map ID in the Title bar.
$game_map.setup(5)
# Move the player to position (9,2) Change this to the location that you
# want the player to respawn at.
$game_player.moveto(9, 2)
# Add in any decrease in Gold or XP here.
$game_player.refresh
$game_map.autoplay
$game_map.update
$scene = Scene_Map.new
end
end
end
InstructionsName This Script Scene_Gameover, as it will replace the original Scene_Gameover.
Other instructions are in the script.
CompatibilityNo known issues
Credits and Thanks
- Me. There might be other people out there who have made similar scripts, but I came up with this one myself.
Author's NotesThis may cause more problems in your game if there is a gameover in the middle of a minigame or unorthodox event system, so be sure to account for extra items or variables that need to be dumped.