I could only UNDO one time before receiving an error concerning the nonexistence of game.timeSaveAttribute.
I added this to settings.setup to modify the game.postLoad function. Instead of deleting the attribute, this sets it to an empty string, and UNDO works properly (so far).
//Fix UNDO!!
//UNDO only works once in this game using Quest 6 version 0.2 without this fix.
//It throws 'missing game.timeSaveAttribute' error without this fix. (Probably because I use turnscripts?)
game.postLoad = function(){
game.timerEvents = [];
const arr = game.timeSaveAttribute.split(' ');
for (let el of arr) {
const params = el.split('/');
const interval = params[2] === '-' ? undefined : parseInt(params[2]);
game.timerEvents.push({eventName:params[0], triggerTime:parseInt(params[1]), interval:interval});
}
//delete game.timeSaveAtrribute; /*KV commented this line out*/
//KV added the next line of code.
game.timeSaveAttribute = '';
};
Hello!
I could only UNDO one time before receiving an error concerning the nonexistence of
game.timeSaveAttribute
.I added this to
settings.setup
to modify thegame.postLoad
function. Instead of deleting the attribute, this sets it to an empty string, and UNDO works properly (so far).