config.js


located: src/js/config.js

It’s like a configuration file for programs, if you have ever needed to make changes to .ini files in Windows. Regardless, you can change a few things here to fit your project.

Config.history.maxStates = 2;
This means the engine will try to keep at most 2 copies of $ type variables (not temporary variables that starts with underscore, or setup variables, settings variables, etc.), one for current passage, one for the previous passage. Never set this to 0 or the engine won’t save any variables between passages. ChoiceScript does not allow any undo, but I like to have one undo in case of mis-click of a choice. During testing stage, however, you might want to increase this value to something like 10 or 20. Just be aware that the more states the engine has to keep track of, the more storage space it is using.

setup.imgPath = "images/";
You can change this to any name you want the folder that contains images to be. Otherwise keep this value.

If in the future you are curious about other configuration options, full documentation here: https://www.motoslave.net/sugarcube/2/docs/#config-api

Get SugarCube code collection to emulate the look of ChoiceScript

Leave a comment

Log in with itch.io to leave a comment.