Game freezes after transport

Scene_Teleport.prototype.Teleport = function() {

SceneManager.goto(Scene_Map);

$gamePlayer.reservetransfer(1, 8, 9);

};

As it stands here it works but when i replace the numbers with there parameter versions

where '1' is replaced with Map1 it still works. However when replace 8 or 9 gamefreeze...

Scene_Teleport.prototype.Teleport = function() {

SceneManager.goto(Scene_Map);

$gamePlayer.reservetransfer(Map1, CoordsX1, CoordsY1);

};

the mapId seems to work but x and y just dont. have no idea why.
Where did you define CoordsX1 etc? There should be no difference as long as the variable contains a number.


Additionally, are you sure that the freeze is because of the script commands?


If there is an autorun event on the map that is not switched off (or a common event on autorun), then the game will freeze after the successfull transfer.
Still not completetly sure how i did but $gamePlayer.reserveTransfer(Map1, Number(CoordsX1), Number(CoordsY1)); fixed things.
That basically prooves that your coordinate variables where not defined as numbers - you need to search for the place where they are defined in your script and change their definition, then they will work without that override.

Original thread: https://forums.rpgmakerweb.com/threads/game-freezes-after-transport.54509/