I draw for a living, so this whole coding-thing is extremely new for me. For that reason, I've started compiling a concise list of handy commands I use a lot in Twine and which were far from immediately apparent to me when I started. For the sake of other noobtards like me, I'll be sharing those extreme beginner tips here, and urge you others to do the same if you have anything you want to add (corrections, improvements and optimizations for my own stuff is extremely welcome as well). I'll be adding to the list as I discover new things and trying to keep it up to date if people add something awesome.
To add to a Variable: <<set $variable +=20>>
To subtract from a Variable: <<set $variable -=20>>
Putting several Variables in one String: <<if $variable gte 1 or $variable lte 7>>
Checking if a Passage has been visited previously: <<if visited ("passage title")>>
Make the User type in a Variable name: <<set $variable to prompt("query","default input")>> example: <<set $name to prompt("What's your name?","Alyssa P. Hacker")>>
Change a Variable through a Link: [[link name|passage title][$variable = expression]] example: [[Return|3_cliffsStart][$mana +=1]]
Change several Variables through a Link: [[link name|passage title][$variable = expression]] example: [[Return|3_cliffsStart][$mana +=1;$ammo +=1]]
Print global turncount: <<turns()>>
Generate a random number: <<set $variable = (Math.floor(Math.random()*range))+1>> example: <<set $diceRollOne = (Math.floor(Math.random()*5))+1>>
Comments
Print global turncount: <<turns()>>
You'd do that a bit differently in SugarCube:
[quote]
Generate a random number: <<set $variable = (Math.floor(Math.random()*range))+1>> example: <<set $diceRollOne = (Math.floor(Math.random()*5))+1>>
While that works in SugarCube, there's a better way: For example:
<<passageName>> Displays a passage.
<<$variableName>> Prints a variable.
More about Twine's Functions:
http://twinery.org/wiki/function
Here is the official Twine FAQ, mandatory reading for all newbies:
http://twinery.org/wiki/frequently_asked_questions
@MadExile: Been hearing Sugarcube mentioned all over, but have yet to try it for myself. I've been assuming it is another Story Format like Jonah or Responsive, but more powerful, and figured I'd start out by sticking to the simple starter Formats included with Twine. Currently using Sugarcane with a custom CSS on top of it. Am I being completely stupid by not using Sugarcube?
If you're looking for an unbiased answer, then I'm not really the person to ask (you'd be better off asking SugarCube users). That said, let me try to give you a fair answer.
If you were using one of the old vanilla headers, then I'd say yes, no questions asked. Since you're using one of the new vanilla headers, however, the answer is more complicated.
If you definitely plan on using SugarCube at some point because it has some feature(s) you want, then I'd probably have to say yes, you're not doing yourself any favors by waiting. In fact, you're probably hurting yourself, since SugarCube and the new vanilla headers are not 100% compatible.
On the other hand, if SugarCube has no must have feature(s) for you, then there's no pressing need to switch, the new vanilla headers are serviceable enough.
Another thing I like about SugarCube is that it has good documentation.