Help with a script call, please?

Hello all,

I'm trying to make this script call transfer an event (a taxi cab) that has just driven off screen back to its point of origin on the same map, so that it can be recalled at will.

$game_map.events[id].moveto(new_x, new_y)

I've tried keeping the "new_" as well as deleting the words and only putting the actual numbers from the map that correspond with the tile. I've also tried using the Event ID and the map I in the brackets, as I'm just not sure what the correct format would otherwise be. Everything results in the game crashing with an error of "
Try $gameMap
you don't need a script call for this, just use Set Event Location.
you don't need a script call for this, just use Set Event Location.
Oh for crying out loud... I've never used that setting before and complexly lost sight of the fact it was there. I feel like and idiot.

Thanks for your help! (For the record, 100% solved the problem)
While I agree that you should just use the Set Event Location event command if possible, I'll go ahead and explain why your script call wasn't working, for future reference: your script call appears to be for VX Ace or XP, rather than MZ. Also, you wouldn't want to keep the 'new_' in the argument to the function.

The correct script call for MZ would be:
JavaScript:
$gameMap.event(4).locate(26, 12);

Dunno what source you used to find that other script call, but I recommend that you refer to this list in the future.

Also, It looks like you're setting a self switch and a variable in that event, via script call, when simple event commands could do the same thing. While you shouldn't be afraid to use script calls, I wouldn't recommend using them for no reason either.
Thank you for the advice and the links! I was at the mercy of Google. That list will help in the future, for sure.

Original thread: https://forums.rpgmakerweb.com/threads/help-with-a-script-call-please.162252/