Hi, to understand how the interface in MV works I tried to recreate my own Game_Message but although I think I make everything right I only got the ReferenceError "$klrgMessage is not defined".
Here is a step by step what I did in the plugin:
1. Set up the PlugIn:
var Imported = Imported || {};Imported.FRO_Windows = true;var KLRG = KLRG || {};KLRG.FRO_Windows = KLRG.FRO_Windows || {};KLRG.Parameters = PluginManager.parameters('FRO_Windows');KLRG.Param = KLRG.Param || {};2. Set up $klrgMessage:
var $klrgMessage = null;DataManager.createGameObjects = function() { $gameTemp = new Game_Temp(); $gameSystem = new Game_System(); $gameScreen = new Game_Screen(); $gameTimer = new Game_Timer(); $gameMessage = new Game_Message(); $gameSwitches = new Game_Switches(); $gameVariables = new Game_Variables(); $gameSelfSwitches = new Game_SelfSwitches(); $gameActors = new Game_Actors(); $gameParty = new Game_Party(); $gameTroop = new Game_Troop(); $gameMap = new Game_Map(); $gamePlayer = new Game_Player(); $klrgMessage = new KLRGAME_Message(); };3. SetUp KLRG_message
function KLRGAME_Message() { this.initialize.apply(this, arguments);}KLRGAME_Message.prototype.initialize = function() { this.clear();};KLRGAME_Message.prototype.clear = function() { this._texts = []; //this._choices = []; this._faceName = ''; this._faceIndex = 0; this._background = 0; this._positionType = 2; //this._choiceDefaultType = 0; //this._choiceCancelType = 0; //this._choiceBackground = 0; //this._choicePositionType = 2; //this._numInputVariableId = 0; //this._numInputMaxDigits = 0; //this._itemChoiceVariableId = 0; //this._itemChoiceItypeId = 0; //this._scrollMode = false; //this._scrollSpeed = 2; //this._scrollNoFast = false; //this._choiceCallback = null;};KLRGAME_Message.prototype.add = function(text) { this._texts.push(text);};KLRGAME_Message.prototype.setFaceImage = function(faceName, faceIndex) { this._faceName = faceName; this._faceIndex = faceIndex;};KLRGAME_Message.prototype.setBackground = function(background) { this._background = background;};KLRGAME_Message.prototype.setPositionType = function(positionType) { this._positionType = positionType;5. Making an event with Script-Command:
$klrgMessage.setFaceImage('Actor1',0)$klrgMessage.setBackground(1)$klrgMessage.setPositionType(1)$klrgMessage.add("Show Text Script Call")6. Getting this damned Error ...
So why is this stuff not defined??? o,O
Here is a step by step what I did in the plugin:
1. Set up the PlugIn:
var Imported = Imported || {};Imported.FRO_Windows = true;var KLRG = KLRG || {};KLRG.FRO_Windows = KLRG.FRO_Windows || {};KLRG.Parameters = PluginManager.parameters('FRO_Windows');KLRG.Param = KLRG.Param || {};2. Set up $klrgMessage:
var $klrgMessage = null;DataManager.createGameObjects = function() { $gameTemp = new Game_Temp(); $gameSystem = new Game_System(); $gameScreen = new Game_Screen(); $gameTimer = new Game_Timer(); $gameMessage = new Game_Message(); $gameSwitches = new Game_Switches(); $gameVariables = new Game_Variables(); $gameSelfSwitches = new Game_SelfSwitches(); $gameActors = new Game_Actors(); $gameParty = new Game_Party(); $gameTroop = new Game_Troop(); $gameMap = new Game_Map(); $gamePlayer = new Game_Player(); $klrgMessage = new KLRGAME_Message(); };3. SetUp KLRG_message
- I copy/pasted the Window_Message-Code and replaced (Window_Message -> KLRG_Message) and ($gameMessage -> $klrgMessage).
function KLRGAME_Message() { this.initialize.apply(this, arguments);}KLRGAME_Message.prototype.initialize = function() { this.clear();};KLRGAME_Message.prototype.clear = function() { this._texts = []; //this._choices = []; this._faceName = ''; this._faceIndex = 0; this._background = 0; this._positionType = 2; //this._choiceDefaultType = 0; //this._choiceCancelType = 0; //this._choiceBackground = 0; //this._choicePositionType = 2; //this._numInputVariableId = 0; //this._numInputMaxDigits = 0; //this._itemChoiceVariableId = 0; //this._itemChoiceItypeId = 0; //this._scrollMode = false; //this._scrollSpeed = 2; //this._scrollNoFast = false; //this._choiceCallback = null;};KLRGAME_Message.prototype.add = function(text) { this._texts.push(text);};KLRGAME_Message.prototype.setFaceImage = function(faceName, faceIndex) { this._faceName = faceName; this._faceIndex = faceIndex;};KLRGAME_Message.prototype.setBackground = function(background) { this._background = background;};KLRGAME_Message.prototype.setPositionType = function(positionType) { this._positionType = positionType;5. Making an event with Script-Command:
$klrgMessage.setFaceImage('Actor1',0)$klrgMessage.setBackground(1)$klrgMessage.setPositionType(1)$klrgMessage.add("Show Text Script Call")6. Getting this damned Error ...
So why is this stuff not defined??? o,O