Hi there,
I am trying to build a game where the player can explore a world in three different time periods: past, present and future. So the player can switch, at any time, from one period to another, while investigating the world.
I am using Twine 2.2.1 and harlowe 2.1.0.
Each passage would consist of a description of the place and, below, an area with three links to navigate time. Check here for a preview:
https://www.dropbox.com/s/dtv5zl7ksp19der/Twine-SpaceTime.png?dl=0
If the player clicks one of the "time" links, he will be transported to that same passage in that new period: past, present or future.
I am trying to implement it like this:
1. I gave each place in the world three different passages. For instance:
room 211 - past
room 211 - present
room 211 - future
2. I created a passage called "Navigation", that I call in each world passage via the (display: ) to create the navigation area with three columns, centered. Its contents are:
=><=
|==
(link: "Past")[]
==|==
(link: "Present")[]
==|
(link: "Future")[]
So now, comes the trick part. How can I make the links "Past", "Present", "Future", move the player to the correct new passage, i.e. If the player is in room 211 in the past and he clicks the "Future" link, he should go to the passage "room 211 - future". How can I create a dynamic linking system for the navigation area?
I thought of doing it like this:
1. I could grab the current passage name with (set: $currentpassageName to (passage:)'s name), which would give a variable with the value, for instance, "room 211 - past"
2. Strip it of the text after the dash, which contains the time information. In this example, it would be "past". I would then have a variable name called "room 211 -".
3. Finally, I could complete the (link: ) macro like this:
(link: "Future")[(go-to: (passage:)'s name + " future")]
The problem is that I don't know how to do step 2. Can anyone help me? Is it possible to do it with regular harlowe operations?
Thanks!
José