Hi,
Currently I am looking for a certain tag in passages and counting the number of passes. What I am looking for is a way to set
somehow the tag as a code, so that I can set multiple tags for different passages.
1st tag - do not count
2nd tag - count
For example if I come from A passage with 1st tag, into passage B i get standard message, but if I come from A with 2nd tag I get different one. Is that possible? Basically I want to add additional if/else for history of passages but according to tags and mix them with passages.
Comments
I am going to assume you are using the default story format which is Harlowe, although without knowing which version of Twine 2 you are using I don't know if it is Harlowe v1.2.2 or v1.2.3 but the following should work in both versions.
You can use the 'last' property of the (history:) macro to obtain the name of the previous passage, and the 'tags' property of the (passage:) macro to obtain an Array containing a list of the tags assigned to a particular passage.
The following example consists of three passages:
1. First passage: assign a forest to this passage. 2. Second passage: assign a desert to this passage. 3. Result passage.
NOTES:
a. If you are using the Harlowe 2.x story format you can change the $tags variable into a new temporary variable instead by replacing the dollar sign $ character with an underscore _ character, which will result in that Array not being saved in history.
b. The above example could also be implemented in SugarCube but the code would be different.