Quantcast
Channel: Help! with 2.0 - Twine Forum
Viewing all articles
Browse latest Browse all 1844

[Sugarcube 2.12.0] How to access settings through if macro (or any macro, for that matter)?

$
0
0
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.

Viewing all articles
Browse latest Browse all 1844

Trending Articles