Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin
- - Common Event on Game Over
- Made by: Sixth
- Description:
- This script will redirect the game over feature to call a common event instead
- of showing the regular game over screen.
- NOTE:
- This script will NOT work in the engine's default battles, only on the map!
- Get Yanfly's Death Common Event script for that!
- Script Calls:
- You can change the death common event during the game with this script call:
- $game_system.game_over_data[:cm_event] = cm_event_id
- Just replace the cm_event_id with the ID of the common event you want to use
- after the script call. This change will be permanent, so until you change it
- again, it will remain the same common event!
- Installation:
- Put this script between Materials and Main!
- =end
- module GmOver
- # If this is set to true, the "Game Over" event command will automatically
- # disable this script, so it can proceed to the game over screen like it
- # would normally do.
- # I suppose if you call the game over screen with an event, you want to make
- # sure that the player ends up on that game over screen for real, so I made
- # this setting.
- # If you don't want to use this feature, set this to false.
- # Note that if this is false, whenever you use the "Game Over" event command,
- # your game over common event will run instead of going to the real game over
- # screen, and that means, that you will end up in a loop unless you revive
- # your party members in your event!
- # If you want to call the real game over screen within your event but this
- # fix is NOT enabled, you will first need to turn the disable switch for this
- # script ON and use the "Game Over" event command only AFTER you have done
- # that! If you don't do that, say hi to the loop you get! :P
- EvCmdFix = true
- # Set up the common event called on death and the disable switch here.
- # When that disable switch is turned ON, the game over stuffs will happen
- # like it would without this script (so, it will move the player to the real
- # game over screen if the party is dead).
- Settings = {
- :cm_event => 7, # Common Event ID.
- :d_switch => 170, # Disable Switch ID.
- }
- end
- class Game_System
- attr_accessor :game_over_data
- def game_over_data
- init_game_over_data if @game_over_data.nil?
- return @game_over_data
- end
- def init_game_over_data
- @game_over_data = Marshal.load(Marshal.dump(GmOver::Settings))
- end
- end
- class << SceneManager
- alias redirect_gmover8826 goto
- def goto(scene_class)
- if scene_class == Scene_Gameover && scene_is?(Scene_Map)
- $game_player.reset_action
- if !$game_switches[$game_system.game_over_data[:d_switch]]
- return if $game_map.interpreter.running? || $game_temp.common_event_reserved?
- $game_temp.reserve_common_event($game_system.game_over_data[:cm_event])
- else
- redirect_gmover8826(scene_class)
- end
- else
- redirect_gmover8826(scene_class)
- end
- end
- end
- if GmOver::EvCmdFix
- class Game_Interpreter
- alias fix_gmover_call8872 command_353
- def command_353
- $game_switches[$game_system.game_over_data[:d_switch]] = true
- fix_gmover_call8872
- end
- end
- end
- #==============================================================================
- # !!END OF SCRIPT - OHH, NOES!!
- #==============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement