So I'm making a health tracker for a game I play and I need it to start with 20 health and have a button to add 1 and subtract 1 health but I want them both to change separately. How can I make the [[+]] and [[-]] to show a plus and minus but be called something else? so they both go to seperate passages but wtill both say the same thing? Here's the code so far:
<<set $health1 to 20>>
<<set $health2 to 20>>
Player 1: [[-]] <<print $health1>> [[+]]
Player 2: [[-]] <<print $health2>> [[+]]
Comments
See http://twinery.org/wiki/link for details if this is the case. The general syntax is [[displayed text|title of passage][$variable = expression]]
so
Player 1: [[-|player1passage][$health1 -=1 ]] <<print $health1>> [+|player1positivepassage][$health1 +=1 ]]
Player 2: [[-|player2passage][$health2 -=1 ]] <<print $health1>> [+|player2positivepassage][$health2 +=1 ]]
If you'd like to stay on the same passage, and have the scores change, the <<replace>> macro might be what you're after- see http://www.glorioustrainwrecks.com/node/5462
It's a little tricky for new users (like me) but the example at http://www.glorioustrainwrecks.com/files/TwineMacro-ReplaceTest.html#2.1 shows what an excellent macro it is an d how valuable it is.