This is the Map_Count class I created. It checks to see up to which map# exists so that I don't get a file can not load error later on.
It also tells my other script using variable[01] how many maps are in the game.
class Map_Count
def initialize
for i in 1..999
@map_id=i
if @map_id <10
@map_id="00#{i}"
end
@exist=FileTest.exist?("Data/Map#{@map_id}.rxdata")
if @exist
$game_variables[1]=i
end
end
end
end
This is my class for retrieving the name of the map and storing it into an actor name.
class Getmapnames
attr_accessor :map_id
attr_accessor :map_name
attr_accessor :map_number
def initialize(map_number)
@map_id=map_number
@map = load_data(sprintf("Data/Map%03d.rxdata", @map_id))
map_name=@map.data.name
@map_name=map_name
return @map_name
end
end
And this is my common event which is triggered when the switch "Init" is turned on.
Now the problem I'm having is that it seems like you can only use $game_map.name as a call to the map the player is currently on.
Even if I try to load a DIFFERENT map file... and get the name for it, it doesn't work.
What I want to do is get the name of a map file before a player transfer event.
So here's my question.
How do I load a map, and get it's name, put the name in a variable and then close the map file, without changing the map the player is currently on??
The only thing I can think of is to do a sequenced transfer player, and store the map name of the current map into an array index with the same value as the loop number. :/
But that means I'd have to do that for EVERY map in the game and that would make the entire game slow at startup.
This is the Map_Count class I created. It checks to see up to which map# exists so that I don't get a file can not load error later on.
It also tells my other script using variable[01] how many maps are in the game.
This is my class for retrieving the name of the map and storing it into an actor name.
And this is my common event which is triggered when the switch "Init" is turned on.
Now the problem I'm having is that it seems like you can only use $game_map.name as a call to the map the player is currently on.
Even if I try to load a DIFFERENT map file... and get the name for it, it doesn't work.
What I want to do is get the name of a map file before a player transfer event.
So here's my question.
How do I load a map, and get it's name, put the name in a variable and then close the map file, without changing the map the player is currently on??
The only thing I can think of is to do a sequenced transfer player, and store the map name of the current map into an array index with the same value as the loop number. :/
But that means I'd have to do that for EVERY map in the game and that would make the entire game slow at startup.
Share this post
Link to post
Share on other sites