- Joined
- Mar 26, 2019
- Messages
- 64
- Reaction score
- 29
- First Language
- English
- Primarily Uses
- RMMV
Howdy, folks-
I have the following code:
However, whenever I execute it, the following error occurs:
There seems to be no problem though if, after the error, I type $dataTemporary into the console window:
I am deducing that:
is executing before DataManager.loadDataFile is able to load said file into $dataTemporary?
What am I doing wrong?
As always, thank you in advance for any pointers / insights that you might be able to provide!
I have the following code:
Code:
let event_to_clone = (eventId_code) => {
let result = {};
switch (eventId_code === parseInt(eventId_code, 10)) {
case false:
let temporary = eventId_code.toString().split(`.`);
let mapId = temporary[0];
let eventId = Number(temporary[1]);
let filename = `Map` + (mapId.length === 1 ? `00` : (mapId.length === 2 ? `0` : ``)) + mapId + `.json`;
DataManager.loadDataFile(`$dataTemporary`, filename);
result = Object.assign({}, $dataTemporary.events[eventId]);
break;
case true:
result = Object.assign({}, $dataMap.events[eventId_code]);
break;
}
return result;
};
There seems to be no problem though if, after the error, I type $dataTemporary into the console window:
I am deducing that:
Code:
result = Object.assign({}, $dataTemporary.events[eventId]);
What am I doing wrong?
As always, thank you in advance for any pointers / insights that you might be able to provide!
Last edited:

