Reference Error $game_map is not defined

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)
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.
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.
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
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.
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
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.

Original thread: https://forums.rpgmakerweb.com/threads/reference-error-game_map-is-not-defined.48072/