Ok, before I begin, I'll warn that I have only beginner levels of experience with twine, so you'll have to bear with me. I'm attempting to create a setting to toggle tutorial for a game that I am creating. Basically, I wish to display a separate dialog on certain pages through an <<if>> macro that would explain the stats and give the player some pointers on what's what. This I can do just fine with regular story variables and the <<if>> macro, and I can create the dialog. The problem I am facing is getting it to work with the Settings API. I want the player to be able to toggle tutorial and have it saved between sessions and save files. So I went and created a toggleable setting called "tutorial", but now, I don't know how to call it in the <<if>> macro. The API itself details how to do it with javascript, but I am crap at that so I sort of failed to adapt the code to my needs.
Here's a mock example of what I want:
<<if tutorial is on>>
<<load dialog through script>>
<<else do nothing>>
<</if>>
And here's the setting in question:
Setting.addToggle("tutorial", {
label : "Tutorial",
default : true,
});
I'd be glad if someone could help me do this or possibly provide an alternative method.
Comments
You could use a variable to designate whether or not to run the tutorial?
I don't know much about Twine 2, but I should think you can still use a link to return to the previous page. That means you can make a link to an 'options menu' at any point and then just click 'return' to go back. Or even just have a button to return you to the current page, but change the tutorial variable from 1 to 0. That way, you can have the Tutorial variable control which button is shown (IE, If 0, show 'turn to 1' button. Else show 'turn to 0' button)
I really hope that helps dude
Accessing the tutorial setting via TwineScript would be done like so: Notes, based on your mock example: