Storing Map Name as Variable?

Status
Not open for further replies.

JtheDuelist

Your Friendly Nieghborhood Stygian Zinogre
Veteran
Joined
Dec 9, 2017
Messages
1,186
Reaction score
1,440
First Language
English
Primarily Uses
Other
I was wanting to store a map's name as a variable via the script call $game_map.name, but I keep getting this error:
Code:
undefined method `name` for # < Game_Map: 0xf849018>
How do I fix this?
 

Palin

Veteran
Veteran
Joined
Mar 17, 2016
Messages
79
Reaction score
36
First Language
English
Primarily Uses
N/A
That isn't a script call is why you're getting an error. You can get the display name with $gameMap.displayName()

I don't think there's a function to return the name (I can't check right now).

This should do it:

Code:
var mapId = $gameMap.mapId();
var name = $dataMapInfos[mapId].name;
Hopefully someone else can interject if there's a better way to get that. I can't remember right now:)
 
  • Like
Reactions: Bex

JtheDuelist

Your Friendly Nieghborhood Stygian Zinogre
Veteran
Joined
Dec 9, 2017
Messages
1,186
Reaction score
1,440
First Language
English
Primarily Uses
Other
@Palin I am not using a display name on my maps as my actor HUD is blocking where it would be displayed. I just want the map's database name to show.
 

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
599
First Language
Italian
Primarily Uses
RMVXA
This should do it:

Code:
var mapId = $gameMap.mapId();
var name = $dataMapInfos[mapId].name;
Hopefully someone else can interject if there's a better way to get that. I can't remember right now:)
The problem is not doing in a better way, that is how MV hadnles things but this is a thread for VX Ace (unless this has been posted in the wrong place). XD

The correct call for VX Ace is
Code:
$game_map.display_name
 
  • Like
Reactions: Bex

JtheDuelist

Your Friendly Nieghborhood Stygian Zinogre
Veteran
Joined
Dec 9, 2017
Messages
1,186
Reaction score
1,440
First Language
English
Primarily Uses
Other
No, this is the right place, as my 29th Birthday Event project is VX Ace.
That worked:
upload_2019-3-29_13-40-35.png

EDIT: Nevermind- I figured out how to disable display names.

Thanks again, Heirukichi.
 

hiddenone

Lurker Extraordinaire
Global Mod
Joined
Feb 19, 2014
Messages
2,506
Reaction score
5,367
First Language
english
Primarily Uses
RMMZ

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.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

When the Map Generator throws in the assets in the most dumbest way possible - your path is blocked :D

I went to sleep at 3 am because of my anxiety. Set up my alarm for 7 am so that I could have sasagues for breakfast and do morning routine before lessons starts at 8 am. I knew I wouldn't be able to sleep even after my lessons finished because I have to visit my grandparents today I was sad bc I was really tired. Thats when I realised. My lesson starts at 9 am. I could get one extra hour of sleep if I didnt forget it

Forum statistics

Threads
107,557
Messages
1,030,532
Members
139,672
Latest member
WDRS
Top