Twine version 2.1.0
Sugarcube 2.21.1
I'm currently writing a Twine game for my University assignment but I've got a few obstacles I can't overcome.
Within some of my passages, I've got descriptive passages which appear in multiple locations. I'm having trouble creating a "Back" link which returns to the previous passage.
The other query, I'm trying to create a passage which randomly generates a street of buildings using some basic parts.
StoryInit
<<set $Shops to either("Large grocery store","A small brothel")>>
<<set $House to either("A single room apartment","An unlit dormitory")>>
Streets
While walking through the alleys, you pass <<print $Houses,$Shops,$Houses>>
If someone could be kind enough to help, I'd really appreciate it.
Many thanks
Comments
You have a number of option available, three of them being: the previous() function, the <<return>> macro, and the <<back>> macro.
The either() function returns a randomly selected value from the list given, the above code is assigning that value to the $Shops variables and not a reference to the function itself.
When showing the random select values in the Streets passage, do you want each value shown to be unique or can the same value appear more than once?
eg. Is the following output ok? (using underscore to highlight point)
I will take the advice and go back to my story, see if it does what I need it to do.
^The return functions work perfectly, thank you very much.