I'm trying to make a story that branches depending on whether the player has accumulated a certain number of points. I've got it set up currently so that if the player visits specific passages, they get a point. After a series of yes/no decisions, I want their points to be evaluated, and then give them a link to one branch or the other depending on if they have enough points.
This is how I've done it so far:
In Passage 1:
(set: $points to 0)
In a passage where they earn points (but not in passages where they don't earn points):
(set: $points to it + 1)
I know this part works because I included
(print: $points)
in each passage to check.
Then, in the passage where the points are evaluated, I have:
(if: $points is >= 2)[This gets printed and there's a [[Storyline X]] link.]
(else-if: $points is < 2)[This gets printed and there's a [[Storyline Y]] link.]
However, nothing is getting printed, so the link to the next branch of the story doesn't show. I think this might be because (if:) only works with true/false? In which case, should I be using a different method? Or is there a more elegant way to use this method?
Harlowe in Twine 2.0.10.
Thanks!
ETA: In the same context, is it possible to have different links leading to the same passage, but for points to be assigned depending on which link is clicked? For example:
You can choose to [[fight with magic->Win Fight]] or to [[fight with your sword->Win Fight]].
Then, when the player arrives in the passage "Win Fight", they get points if they used magic, but they don't get points if they used a sword. Is that possible? What would it look like?
Comments
Change the "fight with magic" link to something like the following: