I know you can set a variable to the Map ID, my request is that a designated variable will ALWAYS carry the current Map ID value. So it's always updated and reflects the current Map ID that the player is in.
I do this to save me some effort, as I will have a common event called on every map that checks the Map ID, and I figured it'd be easier if it's already in a variable so it's automatic.
Set variable to current Map ID
● ARCHIVED · READ-ONLY
-
-
class Game_Map alias nap_map_var_setup setup def setup(map_id) nap_map_var_setup(map_id) $game_variables[1] = @map_id # <<<<<<<<<<< change [1] to the variable that you like to have set. endendUpdate:
Here is a better one (sets the variable even before the events are created):
VARIABLE_INDEX = 1class Game_Map alias nap_map_var_setup_events setup_events def setup_events $game_variables[VARIABLE_INDEX] = @map_id nap_map_var_setup_events endendTerms: public domain or CC0 -
Dang, Nap beat me to it. :)
-
Thanks a lot Napoleon, works exactly as needed!
Closed.