For some reason, SugarCube executes my importScript back-to-front then front-to-back:
setup.twee:
:: StoryScript [script]
console.log("StoryScript started");
importScripts("js/init.js",
[..., "js/game/references.js", ...]
)
:: StoryInit
/* Used to set up all SugarCube-dependants*/
<<script>>
console.log("StoryInit started");
window.c.alias.setup(Engine, State);
<</script>>
js/init.js:
...
console.log("Init");
window.game = window.game || {}
js/game/references.js:
window.game = window.game || {}
console.log("References");
window.game.references = {};
Browser console log:
References VM2298:62
Init VM2298:196
StoryScript started VM2298:303
StoryInit started VM2299:2
Init init.js:12
References references.js:2
The @importScripts documentation in SugarCube2 states that js files defined not within the same array are loaded sequentially. Yet Iāve seen upon multiple refreshes that the order of print does not change at all, meaning the order is probably deterministic. What am I doing wrong?