Get the display name of a map that is not the currently opened/loaded map?

ACECORP

Founder & Entrepreneur
Veteran
Joined
Apr 6, 2016
Messages
257
Reaction score
40
First Language
English
Primarily Uses
RMMV
Quick question... is it possible to get the display name of a map that is not the currently opened/loaded map?

For example, I'd like get the display name of map# 165 and save that name to a variable, while I am on map # 003.

I found some good info on the following thread where it it shows how to get the display name of the current map that's opened, and save that to a variable. https://forums.rpgmakerweb.com/index.php?threads/storing-map-names-into-variables.56838/

However, my use case is that I need to get the display map of a map that is not currently loaded.

//Game Map Prototype

Game_Map.prototype.displayName = function() {

return $dataMap.displayName;

};

$gameVariables.setVariable(6, $dataMap.displayName);


I found $gamemap.mapId but if I get the value of that using $gamemap.mapId-165 that doesn't seem to work right, so I am obviously doing something wrong.

If it is possible to do what I am seeking to do, any help or insight would be greatly appreciated.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,640
Reaction score
15,726
First Language
English
Primarily Uses
RMMV
You would need to load the map, making sure it doesn't affect the currently-loaded map, wait for it to load, and then grab the display name.

If it's something you will want to do often with different maps, you could either load them all right at the start of the game and put the names into an array, or just hardcode the names in a plugin so you won't need to load them at all.
 

ACECORP

Founder & Entrepreneur
Veteran
Joined
Apr 6, 2016
Messages
257
Reaction score
40
First Language
English
Primarily Uses
RMMV
Thanks. Not what I was hoping for, but its a way forward. Thanks for the info. Appreciate it.
 

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,852
Reaction score
1,798
First Language
English
Primarily Uses
RMMV
Is $dataMapInfos[id].name what you're looking for? Replace ID with the map's ID number (shown at the top-left corner of the map's properties)
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,640
Reaction score
15,726
First Language
English
Primarily Uses
RMMV
That is the name you see in the editor. The display name is saved in the map data itself.
 

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,852
Reaction score
1,798
First Language
English
Primarily Uses
RMMV
Yeah, that's the only drawback. The OP could still use it if both name and display name had the same entries though. I find myself putting the same text into both fields just so I know exactly which map I'm working with.
 

ACECORP

Founder & Entrepreneur
Veteran
Joined
Apr 6, 2016
Messages
257
Reaction score
40
First Language
English
Primarily Uses
RMMV
Is $dataMapInfos[id].name what you're looking for? Replace ID with the map's ID number (shown at the top-left corner of the map's properties)

That's EXACTLY what I am looking for. Nice! Is there some kind of reference guide with all that or did you glean it from the scripts that are included with the RMMV tool?

Thanks so much.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,640
Reaction score
15,726
First Language
English
Primarily Uses
RMMV
@ACECORP did you see the rest of the conversation? If your display name is not the same as the name you give it in the editor (in the map list), this might not be what you want. MapInfos contains the internal names, not the display names.
 

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,852
Reaction score
1,798
First Language
English
Primarily Uses
RMMV
That's EXACTLY what I am looking for. Nice! Is there some kind of reference guide with all that or did you glean it from the scripts that are included with the RMMV tool?

Thanks so much.
I know there's a google spreadsheet floating around somewhere, but I just used the debug console's* quasi-autocomplete to see what would show up when I started typing $dataMap. Since you can also explore object properties in the debug console, expanding one of the objects in the $dataMapInfos array to see which properties it has is pretty trivial.

* Yanfly's CoreEngine has an option to show the debug console when launching the game. It's extremely useful

Anyway, as pointed out by Shaz, note that it only lists the map's "name" as opposed to the "display name" players actually see. If you want to use it to list your maps, you're going to want to make sure the name and display name are exactly the same.
 

ACECORP

Founder & Entrepreneur
Veteran
Joined
Apr 6, 2016
Messages
257
Reaction score
40
First Language
English
Primarily Uses
RMMV
@ACECORP did you see the rest of the conversation? If your display name is not the same as the name you give it in the editor (in the map list), this might not be what you want. MapInfos contains the internal names, not the display names.

Yup. My display name matches so it’s all good. Thanks for highlighting this important distinction though. I can see how it could be a problem if the names were different.
 

CynicSyndrome

Veteran
Veteran
Joined
May 4, 2017
Messages
57
Reaction score
40
First Language
English
Primarily Uses
RMMV
What would you change to get the display name?
 

Latest Threads

Latest Posts

Latest Profile Posts

Hi everyone! Enjoying this nice long weekend. How are you all doing? :)
I just successfully tested having events check if specific actors are in a particular party slot and then changing image to match. This will let me make scenes take into account who is in the party at the time and arrange them accordingly - this is important since I'll have extra actors beyond current party. The script used is the same from MV and is compatible with my current core plugin setup in MZ. Thank goodness.
That awkward moment when you're talking about thinking about writing a limited shop stock plugin for MZ and then find out you already wrote one...last May. My memory is so bad.
When I open my project and I'm like, hell yeah.
Some drawings I made in Lapis, one day I intend to involve them in some RPG Maker project.
* maybe two wall frames
*or some sprite flower tiara, or maybe it inspires someone to do something.
bdd19b62e539d17b3b00cc3d63034f7d.jpg

fcca5c8471b34483da8e032cfe579275.jpg

Forum statistics

Threads
118,426
Messages
1,115,862
Members
155,378
Latest member
TrashWizard
Top