I'm working on my first Twine/Sugarcube based game, and looking at some tips for best practices. One of my major questions, is where the best place to store runtime variables would be?
I know there's the StoryInit passage, but that only runs when the story is first run, which means a new game must be started each time an update happens (as far as I can tell, at least.)
I'm looking at the gameTitle passage, though, as a possible solution, seeing as it runs everytime the page is first loaded. Would this be a good idea, or is there a better place for it?
Thanks.
Update:
I've done some testing, and it looks like 'Set it and forget it' variables can be placed in the gameTitle passage without any issue. Hoever, anything that needs to be run routinely, or has special values, needs to go into StoryInit.
Example - I have a simple array for the names of days, which I had moved to gameTitle. That wound up breaking my side panel. Once I moved the array back to storyInit, it was fixed.
I know there's the StoryInit passage, but that only runs when the story is first run, which means a new game must be started each time an update happens (as far as I can tell, at least.)
I'm looking at the gameTitle passage, though, as a possible solution, seeing as it runs everytime the page is first loaded. Would this be a good idea, or is there a better place for it?
Thanks.
Update:
I've done some testing, and it looks like 'Set it and forget it' variables can be placed in the gameTitle passage without any issue. Hoever, anything that needs to be run routinely, or has special values, needs to go into StoryInit.
Example - I have a simple array for the names of days, which I had moved to gameTitle. That wound up breaking my side panel. Once I moved the array back to storyInit, it was fixed.
Last edited: