- Joined
- May 27, 2014
- Messages
- 1
- Reaction score
- 0
- First Language
- English
- Primarily Uses
I wanted to use a script where after the game over screen the player wouldn't be transported to the title but the last town they visited.
This script here works in VX but not in VXAce. I'm not very good with scripting here so I was wondering if anyone knew how to get this to work in VXAce?
It was written by GubiD I think.
This script here works in VX but not in VXAce. I'm not very good with scripting here so I was wondering if anyone knew how to get this to work in VXAce?
It was written by GubiD I think.
Code:
module DQ_Save #--------------------------------------------------------------------------- # Church Maps - An Array of all MAP_ID's that are 'churches' #--------------------------------------------------------------------------- Church_Maps = [1] #--------------------------------------------------------------------------- # Spawn Text - Text used to locate which event on map is the 'spawn' used # when reviving or teleporting to a church. #--------------------------------------------------------------------------- Spawn_Text = "CHURCH_SPAWN" #--------------------------------------------------------------------------- # Teleport Animation ID - Animation ID to be played when you 'Teleport' #--------------------------------------------------------------------------- Teleport_Animation_ID = 41 #--------------------------------------------------------------------------- # Poisen State - State ID from the Database that is 'poisen' #--------------------------------------------------------------------------- Poisen_State = 2 #--------------------------------------------------------------------------- # Curse State - State ID from the database that is 'curse' #--------------------------------------------------------------------------- Curse_State = 3end#---------------------------------------------------------------------------# Game Player - Edits for DQ Save system#---------------------------------------------------------------------------class Game_Player < Game_Character #-------------------------------------------------------------------------- # * Execute Player Transfer - edited to set 'last visited' and store 'visited' list. #-------------------------------------------------------------------------- alias gm_plyr_perf_transfer_DQ_Save perform_transfer unless $@ def perform_transfer if @transferring and DQ_Save::Church_Maps.include?(@new_map_id) @last_visited_church = @new_map_id visited_list(@new_map_id) end gm_plyr_perf_transfer_DQ_Save end #--------------------------------------------------------------------------- # Last Church - returns the last church that was visited #--------------------------------------------------------------------------- def last_church if @last_visited_church != nil return @last_visited_church end return nil end #--------------------------------------------------------------------------- # Visited List - Returns a list of all the visited churches #--------------------------------------------------------------------------- def visited_list(id=nil) @visit_list = [] if @visit_list == nil if id == nil return @visit_list else @visit_list << id unless @visit_list.include?(id) @visit_list.sort! return @visit_list end endend#---------------------------------------------------------------------------# Game Map - Edits for the DQ Save system#---------------------------------------------------------------------------class Game_Map #--------------------------------------------------------------------------- # Find DQ Spawn - sets the player position to the 'church spawn', used via # event comment of 'SPAWN_TEXT' defined in the DQ_Save module #--------------------------------------------------------------------------- def find_dq_spawn for event in @events.values for cmd in event.list if cmd.code ==108 and cmd.parameters[0].include?(DQ_Save::Spawn_Text) $game_player.moveto(event.x, event.y) end end end endend#---------------------------------------------------------------------------# Scene Gameover - Edits for the DQ Save system#---------------------------------------------------------------------------class Scene_Gameover < Scene_Base #-------------------------------------------------------------------------- # Update - Edited to restore play to 'last visited church' when available #-------------------------------------------------------------------------- alias scn_gm_ovr_DQ_Save_update update unless $@ def update if Input.trigger?(Input::C) if $game_player.last_church != nil $game_map.setup($game_player.last_church) $game_map.find_dq_spawn Graphics.fadeout(120) $game_map.autoplay $scene = Scene_Map.new return end end scn_gm_ovr_DQ_Save_update endend#---------------------------------------------------------------------------# Map Info Load - Loads the map data if it has not already been done. #---------------------------------------------------------------------------$map_info = load_data("Data/MapInfos.rvdata2")


