Gameover To Inn é um script feito pelo SephirothSpawn, desenvolvido para o herói teleportar para uma localização salva, quando tem o Game Over, ao invés de ser transferido para a tela de título, em um jogo do RPG Maker XP.
Ele conta com funcionalidades embutidas que vão permitir o jogador a salvar a sua localização quando ele transferir com o evento de comando ou salvar. Também permite recuperar uma percentagem de HP ou SP e perder a percentagem de gold.
Você precisa do SDK (Standart Development Kit) para rodar este script. Adicione o código abaixo abaixo do SDK e acima do Main:
#============================================================================== # ** Gameover to Inn #------------------------------------------------------------------------------ # SephirothSpawn # Version 2 # 2006-03-04 #------------------------------------------------------------------------------ # * Description : # # This script was designed to all you to teleport to a saved location # when you get a game over, instead of being transfered to the title scene. # It has built in features to allow you to save your location when you # transfer with the event command or save. It also allows you to recover # HP or SP percent ad lose a percent of gold. #------------------------------------------------------------------------------ # * Instructions : # # Place The Script Below the SDK and Above Main. # To Customize your options, refer to the customization instructions. # Refer to Syntax for saving location instructions #------------------------------------------------------------------------------ # * Customization : # # GoInn_Save_When_Transfer = true (ON) or false (OFF) # - Description : Saves Teleported Location after transfer # GoInn_Save_When_Save = true # - Description : Saves Teleported Location after save # GoInn_HP_Recovery_Percent = 1.0 # - Description : Percent of max hp recovered by each character # GoInn_SP_Recovery_Percent = 0.75 # - Description : Percent of max sp recovered by each character # GoInn_Gold_Loss_Percent = 0.5 # - Description : Percent of gold to lose #------------------------------------------------------------------------------ # * Syntax : # # Auto-Save Player Location # Call Script: save_goinn_parameters # # Control Return Positons # - $game_system.gameover_return_parameters[0] = map_id # - $game_system.gameover_return_parameters[1] = player_x # - $game_system.gameover_return_parameters[2] = player_y # - $game_system.gameover_return_parameters[3] = direction #============================================================================== #------------------------------------------------------------------------------ # * SDK Log Script #------------------------------------------------------------------------------ SDK.log('Gameover to Inn', 'SephirothSpawn', 3, '2006-08-22') #------------------------------------------------------------------------------ # * Begin SDK Enable Test #------------------------------------------------------------------------------ if SDK.state('Gameover to Inn') #============================================================================== # ** Game_System #============================================================================== class Game_System #-------------------------------------------------------------------------- # * Options #-------------------------------------------------------------------------- GoInn_Save_When_Transfer = true GoInn_Save_When_Save = true GoInn_HP_Recovery_Percent = 1.0 GoInn_SP_Recovery_Percent = 0.75 GoInn_Gold_Loss_Percent = 0.5 #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_accessor :gameover_return_parameters #-------------------------------------------------------------------------- # * Alias Listings #-------------------------------------------------------------------------- alias seph_goinn_gmsys_init initialize #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize # Original Initialization seph_goinn_gmsys_init # Sets Up Gameover to Inn Variables @gameover_return_parameters = [nil, 0, 0, 2] end end #============================================================================== # ** Interpreter #============================================================================== class Interpreter #-------------------------------------------------------------------------- # * Transfer Player #-------------------------------------------------------------------------- alias seph_goinn_int_c201 command_201 def command_201 # Original Transfer Player seph_goinn_int_c201 # If Save Parameters When Transfer if Game_System::GoInn_Save_When_Transfer # Save Parameters $game_system.gameover_return_parameters[0] = $game_temp.player_new_map_id $game_system.gameover_return_parameters[1] = $game_temp.player_new_x $game_system.gameover_return_parameters[2] = $game_temp.player_new_y $game_system.gameover_return_parameters[3] = $game_temp.player_new_direction end # End return false end #-------------------------------------------------------------------------- # * Save Gameover To Inn Parameters #-------------------------------------------------------------------------- def save_goinn_parameters # Saves Map ID, Player Location & Direction $game_system.gameover_return_parameters[0] = $game_map.map_id $game_system.gameover_return_parameters[1] = $game_player.x $game_system.gameover_return_parameters[2] = $game_player.y $game_system.gameover_return_parameters[3] = $game_player.direction end end #============================================================================== # ** Scene_Save #============================================================================== class Scene_Save < Scene_File #-------------------------------------------------------------------------- # * Write Save Data #-------------------------------------------------------------------------- alias seph_goinn_scnsv_init initialize def initialize # If Save Parameters When Save Data if Game_System::GoInn_Save_When_Save $game_system.gameover_return_parameters[0] = $game_map.map_id $game_system.gameover_return_parameters[1] = $game_player.x $game_system.gameover_return_parameters[2] = $game_player.y $game_system.gameover_return_parameters[3] = $game_player.direction end # Original Initialization seph_goinn_scnsv_init end end #============================================================================== # ** Scene Gameover #============================================================================== class Scene_Gameover #-------------------------------------------------------------------------- # * Alias Listings #-------------------------------------------------------------------------- alias seph_goinn_scngo_update update #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # If C button is pressed if Input.trigger?(Input::C) # Checks for Defined Map ID unless $game_system.gameover_return_parameters[0].nil? # Actor HP / SP Recovery for actor in $game_party.actors amt = actor.maxhp * Game_System::GoInn_HP_Recovery_Percent actor.hp += amt amt = actor.maxsp * Game_System::GoInn_SP_Recovery_Percent actor.sp += amt end # Lose Gold amt = $game_party.gold * Game_System::GoInn_Gold_Loss_Percent $game_party.lose_gold(amt) # Clear Gameover Flag $game_temp.gameover = false # Clear Im Battle Flag $game_temp.in_battle = false # Collects Return Parameters parameters = $game_system.gameover_return_parameters # Sets Up Map $game_map.setup(parameters[0]) # Moves Player $game_player.moveto(parameters[1], parameters[2]) # Set player direction case parameters[3] when 2 ; $game_player.turn_down when 4 ; $game_player.turn_left when 6 ; $game_player.turn_right when 8 ; $game_player.turn_up end # Straighten player position $game_player.straighten # Update map (run parallel process event) $game_map.update # Changes to Map Scene $scene = Scene_Map.new return end end # Orignal Update seph_goinn_scngo_update end end #-------------------------------------------------------------------------- # * End SDK Enable Test #-------------------------------------------------------------------------- end
Observação: se você gostou deste post ou ele lhe foi útil de alguma forma, por favor considere apoiar financeiramente a Gaming Room. Fico feliz só de ajudar, mas a contribuição do visitante é muito importante para que este site continua existindo e para que eu possa continuar provendo este tipo de conteúdo e melhorar cada vez mais. Acesse aqui e saiba como. Obrigado!