I'm trying to get the width and height of a map using its id, while the player is in another map, with a different ID.
I've been able to do this with this code:
currentMapId = $game_map.map_id # Stores current map id to use later
$game_map.setup(mapId) # Changes map id to get properties
mapWidth = $game_map.width # Getting the properties
mapHeight = $game_map.height
$game_map.setup(currentMapId) # Reverting the map id to its original state (so that the player does not teleports)
But I feel this is a really dirty trick. Isn't there a simpler way to do this? Something like $game_map[mapId].width/height.
Edit: I would preferably not edit Game_Map or anything like that. If it is really necessary, how can I make the change in a new script page, instead of just editing the default file?
Hello.
I'm trying to get the width and height of a map using its id, while the player is in another map, with a different ID.
I've been able to do this with this code:
But I feel this is a really dirty trick. Isn't there a simpler way to do this? Something like $game_map[mapId].width/height.
Edit: I would preferably not edit Game_Map or anything like that. If it is really necessary, how can I make the change in a new script page, instead of just editing the default file?
Edited by HeathLockeShare this post
Link to post
Share on other sites