- Joined
- Mar 20, 2022
- Messages
- 41
- Reaction score
- 6
- First Language
- German
- Primarily Uses
- RMMV
Hi,
from this line with //############
I get via
But if I want to access the data of
I get undefined.
I can not use DataManager instead of StorageManager because it must be happened before any gamedata is loaded.
The problem in general is that I am transfering from MV to MZ
and I need to adapt my plugin(s).
I am guessing, the issue is, that there is no waiting until the promise is fulfilled ?
But I don't know how to solve this - I tried everything I could think of.
Nafraju
[If the post is not done in the right place please move it.]
The features of those MV-Plugins are not available in any MZ-Plugins to buy or for free,
so I need to adapt mine.
Code:
Window_SaveInfo.prototype.refresh = function() {
this.contents.clear();
this.resetFontSettings();
var dy = 0;
dy = this.drawGameTitle(dy);
if (!this._valid) return this.drawInvalidText(dy);
const saveName = DataManager.makeSavename(this.savefileId());
this._saveContents = StorageManager.loadObject(saveName); //############
console.log(this._saveContents);///
this.drawContents(dy);
};
I get via
console.log(this._saveContents);
this
Code:
Promise {<pending>}__proto__: Promise
[[PromiseState]]: "fulfilled"
[[PromiseResult]]: Object
actors: Game_Actors {_data: Array(5), @: "Game_Actors"}
map: Game_Map {_interpreter: Game_Interpreter, _mapId: 3, _tilesetId: 12, _events: Array(15), _commonEvents: Array(8), …}
party: Game_Party {_inBattle: false, _gold: 1000000, _steps: 7, _lastItem: Game_Item, _menuActorId: 0, …}
player: Game_Player {_x: 12, _y: 3, _realX: 12, _realY: 3, _moveSpeed: 3, …}
screen: Game_Screen {_brightness: 255, _fadeOutDuration: 0, _fadeInDuration: 0, _tone: Array(4), _toneTarget: Array(4), …}
selfSwitches: Game_SelfSwitches {_data: {…}, @: "Game_SelfSwitches"}
switches: Game_Switches {_data: Array(27), @: "Game_Switches"}
system: Game_System {_saveEnabled: true, _menuEnabled: true, _encounterEnabled: true, _formationEnabled: true, _battleCount: 0, …}
timer: Game_Timer {_frames: 0, _working: false, @: "Game_Timer"}
variables: Game_Variables {_data: Array(1903), @: "Game_Variables"}
__proto__: Object
But if I want to access the data of
this._saveContens
in example ._saveCounts
I get undefined.
I can not use DataManager instead of StorageManager because it must be happened before any gamedata is loaded.
The problem in general is that I am transfering from MV to MZ
and I need to adapt my plugin(s).
I am guessing, the issue is, that there is no waiting until the promise is fulfilled ?
But I don't know how to solve this - I tried everything I could think of.
Nafraju
[If the post is not done in the right place please move it.]
The features of those MV-Plugins are not available in any MZ-Plugins to buy or for free,
so I need to adapt mine.
Last edited: