Ok so I am making a game, and it is kinda bugging me that when I die i'm getting game over. What I want to happen on death, is that the player will lose a certain percentage of the gold they are carrying, (hence giving them a reason to use the bank), and be taken back to the last inn they used to rest and save the game.
What do I do to make this happen instead of getting the game over screen?
Thanks in advance,
Rayth
changing what happens on death?
● ARCHIVED · READ-ONLY
-
-
Like in PMD? My guess would be that you add an event with battle processing and choose "Continue even when lose." then under the heading that says "If lose" call a common event that transfers you to your last saved Inn at the cost of some money. However, that removes random battles, and I'm new too, but that's my two cents.
-
You should use a death events script. What it does, instead of getting a game over screen, when you die, it will call the specified Common event.
Here's the one I use:
Spoiler#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=# ▼ Game Over Common Event
# Author: Kread-EX
# Version 1.02
# Release date: 17/12/2011
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#-------------------------------------------------------------------------------------------------
# ▼ UPDATES
#-------------------------------------------------------------------------------------------------
# # 19/12/2011. Added the option to replay Map BGM.
# # 18/12/2011. Fixed an infinite loop.
#-------------------------------------------------------------------------------------------------
# ▼ TERMS OF USAGE
#-------------------------------------------------------------------------------------------------
# # None. Made that in a few minutes.
#-------------------------------------------------------------------------------------------------
# ▼ INTRODUCTION
#-------------------------------------------------------------------------------------------------
# # Overrides the standard Game Over with a common event on the map.
#-------------------------------------------------------------------------------------------------
# ▼ INSTRUCTIONS
#-------------------------------------------------------------------------------------------------
# # By default, use the 1st common event as game over. You can change this with a
# # script call:
# # $game_system.game_over_event_id = x
# # To disable the replay of the map bgm:
# # $game_system.game_over_map_bgm = false
# #
# # Note: The Game Over event command will not trigger the common event.
#-------------------------------------------------------------------------------------------------
# ▼ COMPATIBILITY
# # I don't foresee any problems.
#-------------------------------------------------------------------------------------------------
puts 'Load: Game Over Common Event v1.02 by Kread-EX'
#===========================================================================
# ■ SceneManager
#===========================================================================
module SceneManager
#--------------------------------------------------------------------------
# ● Jump to a scene
#--------------------------------------------------------------------------
class << self; alias_method:)krx_goce_sm_goto, :goto); end
def self.goto(scene_class)
if scene_class == Scene_Gameover
unless $game_temp.no_game_over_ce || $game_system.game_over_event_id == -1
id = $game_system.game_over_event_id
$game_temp.reserve_common_event(id != nil ? id : 1)
$game_party.members.each do |mem|
mem.remove_state(1)
end
if @scene.is_a?(Scene_Battle) && $game_system.game_over_map_bgm
BattleManager.replay_bgm_and_bgs
end
scene_class = Scene_Map
end
end
$game_temp.no_game_over_ce = false
krx_goce_sm_goto(scene_class)
end
end
#===========================================================================
# ■ Game_Temp
#===========================================================================
class Game_Temp
#--------------------------------------------------------------------------
# ● Public instance variables
#--------------------------------------------------------------------------
attr_accessor :no_game_over_ce
end
#===========================================================================
# ■ Game_System
#===========================================================================
class Game_System
#--------------------------------------------------------------------------
# ● Public instance variables
#--------------------------------------------------------------------------
attr_accessor :game_over_event_id
attr_accessor :game_over_map_bgm
#--------------------------------------------------------------------------
# ● Object Initialize
#--------------------------------------------------------------------------
alias_method:)krx_goce_gs_init, :initialize)
def initialize
krx_goce_gs_init
@game_over_event_id = 1
@game_over_map_bgm = true
end
end
#===========================================================================
# ■ Game_Interpreter
#===========================================================================
class Game_Interpreter
#--------------------------------------------------------------------------
# ● Game Over
#--------------------------------------------------------------------------
alias_method:)krx_goce_gi_353, :command_353)
def command_353
$game_temp.no_game_over_ce = true
krx_goce_gi_353
end
end
It also allows you to change the common event tied to death, through the use of a script call -
so for using that, if I want to use common event 5, in the initialization of my game where the player creates their character I would do script call as
$game_system.game_over_event_id = 5 Assuming I am reading this correctly. -
Yea, that's correct.so for using that, if I want to use common event 5, in the initialization of my game where the player creates their character I would do script call as
$game_system.game_over_event_id = 5 Assuming I am reading this correctly.
After you do that, whenever you die for now on(unless you do another script call to change what common event to use), Common Event 5 will run. -
Thanks that makes things much easier
-
Hi, so I know this is older than dirt but uh, running into an issue? This is perfect for what I need so I'm rather upset that it isn't working.
This doesn't constrict to just one map. If I set this up the way it's intended to be, it happens on EVERY map.
I want there to be one specific map where this occurs. I can't seem to make that happen. -
Make the Common event check what map id you are in and then do whatever you want it to happen.