Quantcast
Channel: Help! with 2.0 - Twine Forum
Viewing all articles
Browse latest Browse all 1844

Complicated if-else statement

$
0
0
Hey there, I'm pretty new to twine and I had a question on whether or not it's possible to create an if-else statement that takes into account some rather complicated variables or if I should find a workaround.

From what I can tell it's not possible to include multiple if's or else's within the same if-else statement, so I thought I'd try making two different ones. At it's most basic, it looks like this:

<<if $seen_2 eq "yes">>Text description if you've seen passage 2
<<else>>Text description if you haven't seen passage 2
<<endif>>

However, I'd like to make it so that if you haven't seen passage two but have seen at least one of two other passages that it will display different text. So I tried inserting another if-else statement, but I can't seem to get any sort of 'unless' statements to work. It looks like this:

<<if $seen_4 or $seen_5 eq "yes" unless $seen_2 eq "yes">>Text description if you've read 4 or 5 but not passage 2
<<else>>Text description if you haven't read passage 2 but have seen 4 or 5
<<endif>>

If anyone knows the correct syntax to get this all to work in one passage then I would be very grateful. Otherwise I might see about getting it to lead to one other passage so I can do what I want.

Viewing all articles
Browse latest Browse all 1844

Trending Articles