Creating a list of Fast Travel Locations

Yeah I though that may be the case so I deleted it and am now getting an Unexpected Token c

This seems to correlate to the first letter of the plugin command coolCity (from your test) as I changed this to TestCity and it changed the error to Unexpected Token T so something's up there, what though I can't figure out
Hmm maybe plugin commands can't accept strings, never used them, it does work however with just numbers and can generate a list of mapIds and x and y, you could just make the name the same as the map name.

Code:
(function(){Game_Party.prototype._fastTravelLocations = {};Game_Party.prototype.addLocation = function(name, mapId, x, y){	$gameParty._fastTravelLocations[name] = [mapId, x, y];};var addLocationsToList_pluginCommand = Game_Interpreter.prototype.pluginCommand;Game_Interpreter.prototype.pluginCommand = function(command, args) {	addLocationsToList_pluginCommand.call(this, command, args);	if (command === "addFastTravelLocation") {		console.log(JSON.parse(args[0]));		var arg1 = JSON.parse(args[0]);		var arg2 = JSON.parse(args[1]);		var arg3 = JSON.parse(args[2]);		var arg4 = JSON.parse(args[3]);		Game_Party.prototype.addLocation(arg1, arg2, arg3, arg4)	};};})();
I changed the city name to a number, and the plugin command doesn't error but when logging it to console gives cant read '_fastTravelLocations' property of null, which I think means that the the plugin command didn't actually add to _fastTravelLocations becauses it's empty, not that it's undefined.
That's odd, it works for me and puts the info into the object array. This is the code I used:

Code:
(function(){Game_Party.prototype._fastTravelLocations = {};Game_Party.prototype.addLocation = function(name, mapId, x, y){	$gameParty._fastTravelLocations[name] = [mapId, x, y];};var addLocationsToList_pluginCommand = Game_Interpreter.prototype.pluginCommand;Game_Interpreter.prototype.pluginCommand = function(command, args) {	addLocationsToList_pluginCommand.call(this, command, args);	if (command === "addFastTravelLocation") {		console.log(JSON.parse(args[0]));		var arg1 = JSON.parse(args[0]);		var arg2 = JSON.parse(args[1]);		var arg3 = JSON.parse(args[2]);		var arg4 = JSON.parse(args[3]);		Game_Party.prototype.addLocation(arg1, arg2, arg3, arg4)	};};})();
Ah sorry I meant if you log this $gameParty._fastTravelLocations[name][0] it gives the error???
On a side note, the script below is what I came up with using Plugin Parameters to define Fast Travel locations, so a Map ID, X, Y, and a Filename to load a picture associated with location. I used alot of the enemybook plugin to do this and tried to adapt it from there. The only issue I seem to have is that the picture is only loaded the second time the cursor is over the location. I.e. It starts of at location 1, doesn't load a picture, moved the cursor down and then back up and it loads the picture. I'm missing something here but not sure what. If anyone has any idea that would be great.

Spoiler
//=============================================================================

// Fast Travel

// by Beenbaba

// Date: 10/11/2015 (english) 

//=============================================================================

 

 

/*:

 * @plugindesc Fast Travel

 * @author beenbaba

 *

 * @param Location Name 1

 * @desc Name to appear in menu

 *

 * @param Map ID 1

 * @desc Map ID Location 1

 * 

 * @param X Location 1

 * @desc Map X Co-ordinate

 *

 * @param Y Location 1

 * @desc Map Y Co-ordinate

 *

 * @param Picture Name 1

 * @desc Name of Picture to load

 *

 * 

 * @param Location Name 2

 * @desc Name to appear in menu

 *

 * @param Map ID 2

 * @desc Map ID Location 2

 * 

 * @param X Location 2

 * @desc Map X Co-ordinate

 *

 * @param Y Location 2

 * @desc Map Y Co-ordinate

 *

 * @param Picture Name 2

 * @desc Name of Picture to load

 *

 * @param Location Name 3

 * @desc Name to appear in menu

 *

 * @param Map ID 3

 * @desc Map ID Location 2

 * 

 * @param X Location 3

 * @desc Map X Co-ordinate

 *

 * @param Y Location 3

 * @desc Map Y Co-ordinate

 *

 * @param Picture Name 3

 * @desc Name of Picture to load

 *

 *

 * @help

 * This Plugin allows you to set up fast travel locations and transfer the player

 * to that location

 *

 * Plugin Commands

 * 

 * FastTravel open

 *

 */

 

 

  

//=============================================================================   

// Declare function

//=============================================================================

 

    (function() {

 

    var parameters = PluginManager.parameters('BabaFastTravel');

    var locName1 = String(parameters['Location Name 1'])

    var Map1 = Number(parameters['Map ID 1']);

    var Xloc1 = Number(parameters['X Location 1']);

    var Yloc1 = Number(parameters['Y Location 1']);

    var Pic1 = String(parameters['Picture Name 1']);

    var locName2 = String(parameters['Location Name 2']);

    var Map2 = Number(parameters['Map ID 2']);

    var Xloc2 = Number(parameters['X Location 2']);

    var Yloc2 = Number(parameters['Y Location 2']);

    var Pic2 = String(parameters['Picture Name 2']);

    var locName3 = String(parameters['Location Name 3']);

    var Map3 = Number(parameters['Map ID 3']);

    var Xloc3 = Number(parameters['X Location 3']);

    var Yloc3 = Number(parameters['Y Location 3']);

    var Pic3 = String(parameters['Picture Name 3']);

    

 

 

    var travelList = [];

 

    travelList.push([locName1, Map1, Xloc1, Yloc1, Pic1]);

    travelList.push([locName2, Map2, Xloc2, Yloc2, Pic2]);

    travelList.push([locName3, Map3, Xloc3, Yloc3, Pic3]);

 

    console.log(travelList);

 

    var _Game_Interpreter_pluginCommand =

            Game_Interpreter.prototype.pluginCommand;

    Game_Interpreter.prototype.pluginCommand = function(command, args) {

        _Game_Interpreter_pluginCommand.call(this, command, args);

        if (command === 'FastTravel') {

            switch (args[0]) {

            case 'open':

                SceneManager.push(Scene_FastTravel);

                break;

            }            

        }

    };

 

 

 

    function Scene_FastTravel() {

        this.initialize.apply(this, arguments);

    }

 

    Scene_FastTravel.prototype = Object.create(Scene_MenuBase.prototype);

    Scene_FastTravel.prototype.constructor = Scene_FastTravel;

 

    Scene_FastTravel.prototype.initialize = function() {

        Scene_MenuBase.prototype.initialize.call(this);

    };

 

    Scene_FastTravel.prototype.create = function() {

        Scene_MenuBase.prototype.create.call(this);

        this._indexWindow = new Window_FastTravelIndex(0, 0);

        this._indexWindow.setHandler('cancel', this.popScene.bind(this));

        this._indexWindow.setHandler('ok', this.OnFT.bind(this));

        var wh = Graphics.boxHeight;

        var ww = Graphics.boxWidth - this._indexWindow.width;

        var wx = this._indexWindow.width;

        this._statusWindow = new Window_FastTravelPicture(wx, 0, ww, wh);

        this.addWindow(this._indexWindow);

        this.addWindow(this._statusWindow);

        this._indexWindow.setStatusWindow(this._statusWindow)

    };

 

    Scene_FastTravel.prototype.OnFT = function() {

        var item = this._indexWindow.index();

        console.log(item);

        $gamePlayer.reserveTransfer(travelList[item][1], travelList[item][2], travelList[item][3]);

        SceneManager.goto(Scene_Map);

    };

 

 

 

 

    function Window_FastTravelIndex() {

        this.initialize.apply(this, arguments);

    };

 

    Window_FastTravelIndex.prototype = Object.create(Window_Selectable.prototype);

    Window_FastTravelIndex.prototype.constructor = Window_FastTravelIndex;

 

    Window_FastTravelIndex.lastTopRow = 0;

    Window_FastTravelIndex.lastIndex  = 0;

 

    Window_FastTravelIndex.prototype.initialize = function(x, y) {

        var width = Graphics.boxWidth / 3;

        var height = Graphics.boxHeight;

        Window_Selectable.prototype.initialize.call(this, x, y, width, height);

        this.refresh();

        this.setTopRow(Window_FastTravelIndex.lastTopRow);

        this.select(Window_FastTravelIndex.lastIndex);

        this.activate();

    };

 

    Window_FastTravelIndex.prototype.maxCols = function() {

        return 1;

    };

 

    Window_FastTravelIndex.prototype.maxItems = function() {

        return this._list ? this._list.length : 0;

    };

 

 

    Window_FastTravelIndex.prototype.setStatusWindow = function(statusWindow) {

        this._statusWindow = statusWindow;

        this.updateStatus();

    };

 

    Window_FastTravelIndex.prototype.update = function() {

        Window_Selectable.prototype.update.call(this);

        this.updateStatus();

    };

 

    Window_FastTravelIndex.prototype.updateStatus = function() {

        if (this._statusWindow) {

            var itemIndex = this._list[this.index()];

            var item = this._list.indexOf(itemIndex);

 

            this._statusWindow.setItem(item);

            console.log(item);

        }

    };

 

 

    Window_FastTravelIndex.prototype.refresh = function() {

        this._list = [];

        for (var i = 0; i < travelList.length; i++) {

            var loc = travelList[0];

           

            console.log(loc);

                this._list.push(loc);

        }

            

        

        this.createContents();

        this.drawAllItems();

    };

 

 

    Window_FastTravelIndex.prototype.drawItem = function(index) {

        var loc = this._list[index];

        var rect = this.itemRectForText(index);

        this.drawText(loc, rect.x, rect.y, rect.width);

        console.log(loc);

    };

 

    Window_FastTravelIndex.prototype.processCancel = function() {

        Window_Selectable.prototype.processCancel.call(this);

        Window_FastTravelIndex.lastTopRow = this.topRow();

        Window_FastTravelIndex.lastIndex = this.index();

    };

 

 

 

 

    function Window_FastTravelPicture() {

        this.initialize.apply(this, arguments);

    }

 

    Window_FastTravelPicture.prototype = Object.create(Window_Base.prototype);

    Window_FastTravelPicture.prototype.constructor = Window_FastTravelPicture;

 

 

    Window_FastTravelPicture.prototype.initialize = function(x, y, width, height) {

        Window_Base.prototype.initialize.call(this, x, y, width, height);

 

    };

 

 

 

 

    Window_FastTravelPicture.prototype.setItem = function(item) {

        if (this._item !== item) {

            this._item = item;

            this.refresh();

            console.log(item);

        }

    };

 

 

 

    Window_FastTravelPicture.prototype.refresh = function() {

        this.contents.clear();

        var item = this._item;

        console.log(item);

        this.drawPicture(travelList[item][4], 0, 0);

    

    };

        

 

    Window_FastTravelPicture.prototype.drawPicture = function(filename, x, y) {

        var bitmap = ImageManager.loadPicture(filename);

        this.contents.blt(bitmap, 0, 0, bitmap._canvas.width, bitmap._canvas.height, x, y);

    };

 

 

 

 

 

 

 

 

 

 

  

})();  // dont touch this.

  

//=============================================================================

// END PLUGIN

//=============================================================================

Original thread: https://forums.rpgmakerweb.com/threads/creating-a-list-of-fast-travel-locations.50215/