I'm using Sugarcube and I'm trying to do a story with some questions mixed in it with answers. Each answer is worth different points and takes you to different points of the story. They are all normal links, and I am trying to work out either clicking on the link or when you visit the page the link takes you will assign you a some points. Then when you reach the end it keep tracks of all the points and show you. Not entirely sure how to go about doing this as a new twine user. Any help or point in the right direction will be much appreciated!
Comments
Anyway, it seems like all you really need is some variables and some settler links.
Create a new passage called StoryInit and put something like this in it:
This is called initializing a variable. We create a variable, which is a word (called an identifier), with a $ (called a sigil). The StoryInit special passage is specially designed for Twine authors to initialize their variables. It's a good practice to initialize all your variables before using them.
To use a setter link, you add a little bit of extra code to your normal links:
When the settler link is clicked, the variable will be changed.
is shorthand for
which would also work and have the same effect.
When you're ready to test the score, you can use an <<if>> macro:
I needed these settler links, didn't know they existed.... Maybe it should be mentioned on http://twinery.org/wiki/twine2:how_to_create_links ?
It is mentioned right in the next section.
As you are using SugarCube (1.x or 2.x ??) reading either the 1.x Markup Links section or the 2.x Markup Links section would of shown you how to do what you wanted.
That documentation is for the Twine 1.x application and is actually targeting the 'vanilia' story formats (Sugarcane, Johan, and Responsive) that came pre-installed with that product, although some information in that part of the Wiki can be used in conjunction with SugarCube.