Hello, everybody.
I am tryng to get the name of the map in which the game has been saved from the save file itself. I do not want to load the save file: I just need to know, within the current game session, the map in which the game was saved.
Looking on the web did not help.
Any idea?
Thank you in advance 🙂
I'm not sure where to move this exactly, so I'm going to start by putting in Ace Support. It might need to be moved to Script Requests, however.
From what I've seen so far...
Scene_Map is simply loaded. $game_map doesn't make any reference to a specific filename. However, it seems that $game_map is recorded on Save. My theory is that the current $game_map is saved.
So first, looking at $game_map, the map name is display_name, which is a method that returns @map.display_name.
@map_name_window.open is used when transferring to a new map, and if conditions work, it shows
$game_map.display_name.
Changing maps, though, starts in Scene_Map's perform_transfer which goes to $game_player's perform_transfer. However, that uses a @new_map_id that set up a new map, though from what I see in that setup method, the second line is
@map = load_data(sprintf("Data/Map%03d.rvdata2", @map_id))
---
So general point so far is that map doesn't use an array and doesn't have a need to record a separate map data for the safe. Hm, however, there was a tutorial about saving strings to the game variable so you can use them in your dialogues.
So anyway, the best bet (using snippets to overwrite instead of editing the methods themselves) is either to add a $game_variables[x] = $game_map.display_name in Game_System's on_before_save or DataManager's save_game_without_rescue (ideally before the marshal dump that writes data to the savefile).