Map Name Storage? [SOLVED]

Is it possible to store the name (not ID) of the map you're on in a variable or something?

Context: I've implemented a system where you can record the current location you're on and warp back to it later, but I've realized that eventually you'll forget where said location was if it doesn't tell you before teleporting back again.
I think it is possible to store letters into an array, but I don't know how. Look up Tutorials on variable arrays
yes, strings can be stored in variables by simply assigning them as a scriptline in the control variable command.

however I think it would be easier to make a miniscript in the script editor that creates a new array where the names are manually stored, similar to the vocab script, and then access that data.
this would require manually entering the names into that script, but would be easier to handle the access.
you'll probably be better off by storing the ID and using it to bring up the map name in whatever selection you want to show up.
allow the player the possibility to save the current location, store the ID, and when requesting a teleport bring up the collection of names.
pull up the menu, recall the array of IDs, and use those to find the name to show in the command button.

you still need the ID to tell the teleport where to go, so might as well build everything around that.
It works like this in MV, but I don't know how well it translates to VXA:

screenshot1.png
screenshot2.png
It works like this in MV, but I don't know how well it translates to VXA:

View attachment 223783View attachment 223784

So in VX Ace I can't put all of the information into the variable's script box.

I tried to do: $game_map.display_name($game_variables[x]) but the script box cuts it off before I can put it all in. That, and Map ID only applies to the map you're currently on. Not any you're not on. So this might not work, unfortunately.

THAT SAID I did just remember a script that kinda does what I'm intending. Yanfly Save Engine has a function on it where it records the area you've saved in.

It does something with preserving the header of the map you saved in, but I can't make heads or tails of it to repurpose it for the teleport system.

you still need the ID to tell the teleport where to go, so might as well build everything around that.

I've already done the teleport system first. It stores the Map ID as well as the X and Y coordinates of where you recorded the spot exactly, so when you go back it takes you back there immediately.
So in VX Ace I can't put all of the information into the variable's script box.

I tried to do: $game_map.display_name($game_variables[x]) but the script box cuts it off before I can put it all in.
Aw, that sucks 🙁
That, and Map ID only applies to the map you're currently on. Not any you're not on. So this might not work, unfortunately.
That part, however, was to set the current map when you want the map ID recorded. You wouldn't use both commands one after the other like that in practice 😛
THAT SAID I did just remember a script that kinda does what I'm intending. Yanfly Save Engine has a function on it where it records the area you've saved in.

It does something with preserving the header of the map you saved in, but I can't make heads or tails of it to repurpose it for the teleport system.
Oh, man! I hope you're able to figure it out. If not I can try to see if I can make any heads or tails of it tomorrow if you link it. No promises though, haha. I'm understanding a lot more about how JS works lately (like enough that I've been writing a moderately-complex plugin), but still just a beginner. Also VXA doesn't use JS, right? But I could still try to help if I stare at it long enough, maybe, lol~

But ideally just crossing fingers that a real expert comes along haha 😀
I tried to do: $game_map.display_name($game_variables[x]) but the script box cuts it off before I can put it all in.
script call, in box:

Code:
v=$game_variables;m=$game_map;
v[A]=m.display_name(v[X])

two lines.
script call, in box:

Code:
v=$game_variables;m=$game_map;
v[A]=m.display_name(v[X])

two lines.

When I tried that, it shot me an error message saying "argument 1 out of 0".
A - needs to be replaced with the Number of the Variable you want to use to store/put the name into.

X - needs to be replaced with the id number of the variable that contains the id of the map of which you want to know the name.
OR
v[X] needs to be replaced with the id number of the map of which you want to know the name.
When I tried that, it shot me an error message saying "argument 1 out of 0".
probably because display_name requires no arguments.

I was thinking that'd be the case, but I wanted to show you how to shrink the instruction.
I assumed you knew what you were doing.

the solution to this is a little more complicated than that, because in order to pull the name of a map that is not the current one, you need to load it first from disk.
it's doable, but it requires a few more lines and I don't know how much complexity you can handle.

if you want to pull them up to show them as buttons in a menu, you'll probably be better off with a plugin.
doing this with variables will be a mess.
probably because display_name requires no arguments.

I was thinking that'd be the case, but I wanted to show you how to shrink the instruction.
I assumed you knew what you were doing.

the solution to this is a little more complicated than that, because in order to pull the name of a map that is not the current one, you need to load it first from disk.
it's doable, but it requires a few more lines and I don't know how much complexity you can handle.

if you want to pull them up to show them as buttons in a menu, you'll probably be better off with a plugin.
doing this with variables will be a mess.
That actually isn't the case as long as you don't mind using the map's editor name rather than display name, as you can get those from the $data_mapinfos object which has an RPG::MapInfo for each map, each of which has a @ name property.
probably because display_name requires no arguments.

I was thinking that'd be the case, but I wanted to show you how to shrink the instruction.
I assumed you knew what you were doing.

the solution to this is a little more complicated than that, because in order to pull the name of a map that is not the current one, you need to load it first from disk.
it's doable, but it requires a few more lines and I don't know how much complexity you can handle.

if you want to pull them up to show them as buttons in a menu, you'll probably be better off with a plugin.
doing this with variables will be a mess.

Actually, all you had to do was point out that display name didn't need an argument and that was it. Abominable bedside manner on your part. 😛

That little scriptlet does in fact do what I wanted once that was squared off, as proven by testing the record-teleport on one map and then doing it on another.

That actually isn't the case as long as you don't mind using the map's editor name rather than display name, as you can get those from the $data_mapinfos object which has an RPG::MapInfo for each map, each of which has a @ name property.

Interesting. This is just as valid to me because I don't really care if it's the display name or the actual editor name, just that it is in fact the name of the map you recorded.

In fact it's preferable that it be based on the editor map name because I leave most map display names blank for a good reason.
UPDATE: I have figured out how to do it on my own, though partly thanks to @Trihan bringing it up.

Ruby:
v=$game_variables;
v[870]= $data_mapinfos[map_id].name

This allows me to store the name of a map when the record-teleport is triggered. Example:

mrHkqwV.png


I save a spot in Debug Map A, then go to Debug Map B to see if the name sticks when I transfer over. It did, and it will only change if that teleport is deleted and replaced with another record.

Safe to say this topic is solved, since I've managed to do exactly what I wanted. 👋

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/map-name-storage-solved.146940/