Having NPC Chase Player to Another Map Error

Hello. I've encountered some error I can't identify. Basically, I'm trying to make an NPC follow the player from map to map. I got something set up, but I always get an error.

To elaborate, I set up these common events:

bandicam 2022-09-25 22-02-38-647.jpg

bandicam 2022-09-25 22-02-44-652.jpg


I then spawn the enemy by adding an auto run event to activate switches and variables.

bandicam 2022-09-25 22-04-11-962.jpg
bandicam 2022-09-25 22-04-17-026.jpg


Then I add two more events to try and get the enemy to spawn in another map while the chase is active.

bandicam 2022-09-25 21-58-04-495.jpg
bandicam 2022-09-25 21-57-53-670.jpg

And finally, when I playtest it and enter the next map, I get this error message.
bandicam 2022-09-25 21-59-15-116.jpg

I have no Idea what's wrong here. If anyone could help me, I'd be very grateful! If I need to provide more details, I can do so as well.
Thank you.
Syntax errors are typically related to script calls (or buggy plugins). I don't see any scripting in your screenshots, though. Ideas:
  1. Are you using any Script fields (including stuff like Conditional Branch -> Script)?
  2. What's in your "Player X and Y" common event?
  3. Are you using any plugins?

When you launch the game and see the error, press F8 (or, failing that, F12) to open up the dev tools window. Select the Console tab in that window: there should be an error message (red text) displayed there. You may be able to click the message to expand it for more details.

A screenshot of the error message from the console may be helpful. 👋
Sorry for replying so late. Here's a screenshot I took from the Console Tab. I hope it helps.bandicam 2022-09-27 22-50-12-947.jpg
Command122 is Control Variables, specifically when setting the variable with a script call.

I don't see that in any of the screenshots you've posted here, so it must be in another event or common event.

If that isn't enough for you to find it, you can go to your rpg_objects.js file and insert the following just before line 9444:
Code:
console.log(this._params[4]);
then play the game until it crashes, and check the Console again. It'll give you the exact script call that's failing, and that should help you find the event.
Letting me know Command122 was actually helped me find the problem! I was trying to set variables to detect the player's location when they entered the next map, but I was using the wrong command. Now that I have the variables set to the right Game Data Player X and Y detection, the crash doesn't happen anymore.

Thank you for your help, guys! I think I got it from here! 😀

Original thread: https://forums.rpgmakerweb.com/threads/having-npc-chase-player-to-another-map-error.151559/