Good morning. I have a problem with my piece of codes. When I test them in-game, they seem to make the player stop and freeze, when x and y coordinates are inputted.
When that is set, the character will freeze and walk in place.
I can set the "StartMapId" just fine, but I cannot set the x and y coords without causing a softlock.
JavaScript:
//=============================================================================
// test.js
//=============================================================================
var Imported = Imported || {};
Imported.BNTKids_test = true;
var BNTKids = BNTKids || {};
BNTKids.test = BNTKids.test || {};
BNTKids.test.version = 1.00;
//-----------------------------------------------------------------------------
/*:
* @plugindesc Allows you to customize what commands appear in the title screen menu.
*
* @author BNTKids-Studios
*
* @param Spawn_Locations
* @desc The default title command list before the below Mod Condition is met
* @default 1,1,1|2,2,2
*
*/
(function(){
// coordinates
BNTKids.test.locs = [];
console.log(PluginManager._parameters.test.Spawn_Locations);
var txt = PluginManager._parameters.test.Spawn_Locations;
console.log (txt);
var locs = txt.split("|");
console.log (locs);
for (var i = 0; i < locs.length; i++) {
BNTKids.test.locs.push(locs[i].split(","));
};
//==============================
// * make Command List
//==============================
var BNTKids_test_makeCommandList = Window_TitleCommand.prototype.makeCommandList;
Window_TitleCommand.prototype.makeCommandList = function() {
BNTKids_test_makeCommandList.call(this);
this.makeCustomCoordinateList();
};
Scene_Title.prototype.createCommandWindow = function() {
this._commandWindow = new Window_TitleCommand();
this._commandWindow.setHandler('newGame', this.commandFirstGame.bind(this));
this._commandWindow.setHandler('continue', this.commandContinue.bind(this));
this._commandWindow.setHandler('options', this.commandOptions.bind(this));
this.addWindow(this._commandWindow);
};
Window_TitleCommand.prototype.makeCustomCoordinateList = function() {
var list = BNTKids.test.locs; // default list
$dataSystem.coordlist = [];
// Build coordinate list
for (var i = 0; i < list.length; i++) {
$dataSystem.coordlist[i] = [];
var id = list[i][0];
var x = list[i][1];
var y = list[i][2];
$dataSystem.coordlist[i] = {id,x,y};
// $dataSystem.coordlist[i] = {id};
};
};
Scene_Title.prototype.commandFirstGame = function() {
$dataSystem.startMapId = $dataSystem.coordlist[0].id;
$dataSystem.startX = $dataSystem.coordlist[0].x;
$dataSystem.startY = $dataSystem.coordlist[0].y;
DataManager.setupNewGame();
this._commandWindow.close();
this.fadeOutAll();
// Change start point.
SceneManager.goto(Scene_Map);
};
})();
When that is set, the character will freeze and walk in place.
I can set the "StartMapId" just fine, but I cannot set the x and y coords without causing a softlock.