storyinit.tw


located: src/twee/meta/storyinit.tw

:: StoryInit [illumeIgnore]
...

Think of this like the *create variables section in startup.txt of ChoiceScript. It’s not as strict as in ChoiceScript, and in fact, you can create both global and temporary variables any time during the game, but it’s a good practice to keep variables you know will show up declared here.

<<set $hairlength = "long">>
<<set $haircolor = "black">>

You can set variable values one line at a time, or you can do multiple at a time, like:

<<set $hairlength = "long", $haircolor = "black">>

Eventually it will be up to your comfort level which style you prefer.

/% this is how you write SugarCube comments %/

/* this is how you write a Javascript and CSS comment */

<<set $text = "">> /% used in <<text>> widget %/
<<set $pronounplural = false>> /% used in vendor code "pronouns.js" %/

These variables are what I added to your project for different purposes. Keep them for now until you know how to replace/modify them.

Note that blank lines means nothing to the code in our situation, only for ease of reading. That’s because we set a configuration variable (in src/js/config.js)

Config.passages.nobr = true;

which strips out all blank lines. This is why we must now use <br> to explicitly create line breaks, just like *line_break or [n/] in ChoiceScript.

Get SugarCube code collection to emulate the look of ChoiceScript

Leave a comment

Log in with itch.io to leave a comment.