Hey, I'm new to Twine and I'm having an issue with Either and If.
Earlier in the code I use an Either:
<<set $friendThree to either("Dog", "Bear", "Frog")>>
And that works fine.
Then later on the same page I want to have it be where the verb of the animal's dialogue changes depending on what was selected randomly. So right now I have it like:
"Hello" <<print $friendThree>><<if $friendThree is "Dog">>woofs.<<elseif $friendThree is "Bear">>growls.<<elseif $friendThree is "Frog">>ribbits.<</endif>>
But it can't find the matching tag for the If macro so clearly something is wrong. The elseif ones appear to go through but it's hard to tell.
Can I not set a name in this way? And if not, could someone explain if there is a way to achieve what I'm trying to do?
Sorry if I'm missing something obvious.
Comments
i think there is no slash before endif.
You also want to add a space before the verb for clarity otherwise it will print "Dogwoofs" or "Beargrowls" or "Frogribbits".
Corrected code below:
Thanks again.