Reference Error $game_map is not defined

Kyrom

Warper
Member
Joined
Oct 29, 2015
Messages
2
Reaction score
0
First Language
Portuguese
Guys please help me after I converted the game rpg maker vx ace for mv when I open of this error down there help me

 

 

 

ReferenceError: $game_map is not defined

    at Game_Interpreter.eval (eval at <anonymous> (file:///C:/Users/DANIELE/Documents/Games/Project1/js/rpg_objects.js:10436:10), <anonymous>:1:1)

    at Game_Interpreter.command355 (file:///C:/Users/DANIELE/Documents/Games/Project1/js/rpg_objects.js:10436:5)

    at Game_Interpreter.executeCommand (file:///C:/Users/DANIELE/Documents/Games/Project1/js/rpg_objects.js:8894:34)

    at Game_Interpreter.update (file:///C:/Users/DANIELE/Documents/Games/Project1/js/rpg_objects.js:8802:19)

    at Game_Event.updateParallel (file:///C:/Users/DANIELE/Documents/Games/Project1/js/rpg_objects.js:8713:27)

    at Game_Event.update (file:///C:/Users/DANIELE/Documents/Games/Project1/js/rpg_objects.js:8705:10)

    at file:///C:/Users/DANIELE/Documents/Games/Project1/js/rpg_objects.js:6031:15

    at Array.forEach (native)

    at Game_Map.updateEvents (file:///C:/Users/DANIELE/Documents/Games/Project1/js/rpg_objects.js:6030:19)

    at Game_Map.update (file:///C:/Users/DANIELE/Documents/Games/Project1/js/rpg_objects.js:5990:10)
 

Zalerinian

Jack of all Errors
Veteran
Joined
Dec 17, 2012
Messages
4,696
Reaction score
935
First Language
English
Primarily Uses
N/A
In a script call you used in ace, you were using the $game_map variable. In MV, in order to go along with the typical JS naming conventions, the variable name has been changed to $gameMap. Additionally, if you're calling a function, you now are required to include parenthesis at the end of the function name. In ruby they were optional if there were no arguments, however in JS they are required.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,111
Reaction score
13,715
First Language
English
Primarily Uses
RMMV
If you had turned on the option (I think it's on by default) the converter will give you a list of ALL the script calls in your game.  You need to go through that list, check every single one, and see if it needs to be modified for Javascript.

Any scripts you used in Ace will not work in MV, so it may be that you'll need to remove some of those script calls completely and find another way to achieve the same thing, or find (or request) an MV Plugin to do the same thing, in which case you'll still have to change the script call.
 

Sindaine

Tired Gamerz Studio
Veteran
Joined
Oct 15, 2012
Messages
202
Reaction score
19
First Language
English
Hey everyone,

I too am using a converted game file. I'm getting the same $game_map undefined error, but I'm not running any scripts from vx ace on that map. I'm specifically getting the error when I try to use a "jump to label" command. I have redone all the jump commands in MV just in case for some reason it sees them differently than VX Ace did, but still having the same result. Do I have to eliminate all old script calls on ALL maps to avoid this? I was just going to fix them as I went, but I may have to over-hall the whole thing earlier it seems.

Thanks for the help in advance,

Sindaine
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,111
Reaction score
13,715
First Language
English
Primarily Uses
RMMV
It's either an event on that map or in a common event. It could be a Script command, or a script box in a Control Variables, Conditional Branch or Set Move Route command.


If you're absolutely certain there are no events on the current map that do script calls, check your common events.


There is also a file produced that gives you a list of all the script calls that you have to look at. It'll be in your mv-data folder of the Ace project. You could do a search through it for $game_map.
 

Sindaine

Tired Gamerz Studio
Veteran
Joined
Oct 15, 2012
Messages
202
Reaction score
19
First Language
English
Hey Shaz, you were right. It was caused by a common event. Even though I wasn't using it! Weird. Anyways, thanks again for the help.

Sindaine
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,111
Reaction score
13,715
First Language
English
Primarily Uses
RMMV
It wouldn't have tried to run unless you were using it. It would have been through a Call Common Event command in one of your map events, or by turning on a switch and having the common event conditioned by the switch and set to parallel/autorun.
 

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

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,051
Messages
1,018,549
Members
137,837
Latest member
Dabi
Top