Hello, I’m new to twine, I understand how twine mainly works however I’m wondering, is there a way to make achievements and then make it so some passages can be unlocked via them? Like, lets say, five endings in a game, you get an achievement for each and when you get them all you unlock a new passage, also how do you return to the starting passage? (like when you get each ending you can return to it).
Sorry if my explanation is bad, I have a hard time explaining things. Thank you!
For the record, I switched to SugarCube, where it is very easy. Harlowe doesn’t seem to have the capacity to record information in permanent storage that persists between runs. However, SugarCube does this very easily out-of-the-box. Unless you have some very good reason to run in Harlowe, I’d recommend switching. Harlowe frankly doesn’t feel ‘finished’. Anyway, in SugarCube you can do it like this:
At the point where the achievement is obtained, put this: <<run memorize("achievement name", true)>>
Then, wrap the link to your ‘optional’ passages like this: <<if recall("achievement name", false)>>[[Bonus Scene->Your Passage Name]]<<endif>>
Naturally you should replace “achievement name” with the name of your achievement.
Shouldn’t that be <<if recall("achievement name", true)>>, if the passage is supposed to appear once the achievement is obtained?
Anyway, I agree that if you want to do this, Sugarcube is really what you want to be using. In Harlowe you would have to fake it—instead of an actual reset, you’d have to just link back to the start of your story and manually reset all the variables except the achievement-related ones.
@E.Joyce the second parameter in ‘recall’ is the default; it gets used if the key doesn’t exist at all. If I pass ‘true’ to that parameter, it will appear as if you always have the achievement, even if you don’t.