I have some problems with my plugin. I have a global object, that is a parameter from the plugin: Eli.HelpWindows.Param.menuHelp.text > This return to me various objects with string values.
I have an option that can change this string values via script calls or plugin commands. I was using this: Eli.HelpWindows.Param.menuHelp.text["object"] = "anything".
But this saves globally and if another new Game is chosen, the value will be from the other game.
So to avoid this, I alias the Game_System.prototype.initialize and create a new object that carries the parameters of the plugin:
When I go to the title(via menu>game end) and start a new game, the value remains the one that I have changed via script call in the other save slot.
BUT!
If I go to game Title pressing F5 and start a new game, the value returns to its default. And in the save file, the value is as changed in the script call.
I make the same test with a game variable value, and when I start a new game it is immediately and automatically set to 0.
I take a look at the Rpg_managers and I see that the game objects are created in DataManager.setupNewGame() that I think that is called in Start New game command.
The DataManager.setupNewGame() create both Game_System Objects and Game_Variables objects. So why is the Game_System the value is not reset automatically at a New Game Start and in Game_Variables, the value is reset?
JavaScript:
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();
};
DataManager.setupNewGame = function() {
this.createGameObjects();
this.selectSavefileForNewGame();
$gameParty.setupStartingMembers();
$gamePlayer.reserveTransfer($dataSystem.startMapId,
$dataSystem.startX, $dataSystem.startY);
Graphics.frameCount = 0;
DataManager.makeSaveContents = function() {
// A save data does not contain $gameTemp, $gameMessage, and $gameTroop.
var contents = {};
contents.system = $gameSystem;
contents.screen = $gameScreen;
contents.timer = $gameTimer;
contents.switches = $gameSwitches;
contents.variables = $gameVariables;
contents.selfSwitches = $gameSelfSwitches;
contents.actors = $gameActors;
contents.party = $gameParty;
contents.map = $gameMap;
contents.player = $gamePlayer;
return contents;
};
};
What I'm missing?
[EDIT] I have tried to use:
this._menuHelp.text = Eli.HelpWindows.Param.menuHelp.text;
this._menuHelp.text = {...Eli.HelpWindows.Param.menuHelp.text};
this._menuHelp.text = Object.assign({}, Eli.HelpWindows.Param.menuHelp.text};
But no work.
The only method that is working is this one:
this._menuHelp.text = JSON.parse(JSON.stringify(Eli.HelpWindows.Param.menuHelp))(made a deep copy).
Now it works properly. But I still don't get it why Mv behave like that.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.