Twine Version: Twine 2.6.0
Story Format: Sugarcube2
Hello! Its been about a week since i’ve started to use twine and while im doing well with my coding, i was wondering if there was a quick and easy way to view and test passages with already activated variables without having to go through the entire game?
Im rlly sorry if this sounds like a basic question. i’m still new to this whole thing + coding in general, and its been getting a bit exhausting going through the entire game just to check if a variable ive set up worked. I’ve tried looking it up too, but i dont think ive found anything abt this so any help is appreciated ;;
Ahh i do know that, but the thing thats been making me confused is how exactly can i view a passage with a past variable already set to true for the code to work, since it looks like it doesnt automatically do that for the passage im viewing when i test from there immediately
You might also want to check out Config.debug, which indicates whether the game is running in test mode. You can use it to set variables when the game is in test mode but not when running normally, like this:
<<if Config.debug>>
/* Any code here will only be executed in test mode */
<</if>>
You can also change variables on the fly by opening the browser console and typing SugarCube.State.variables['variable_name'] = true.
Another trick is to create a new dummy passage and in there set variables as you expec t them to be, then link from there to the passage you want to test (or the one before?). Then run the test from your dummy passage. You can delete it later, but even if you do not, there will be no links to it, so no effect on your game.
You could also keep notes in there, to track different combinations you know work and don’t.