Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

if statements (plus AND/OR)

I am using Twine 2.0 Harlowe. I want to create an "if" statement that is essentially like this:

(if: $class is "warrior") and (if: $weapon = "sword")[Some text appears here].

However, I'm not sure how to do that in Twine, since as far as I can tell, Twine does not have an equivalent command to "and" in an "if" statement. Can someone point me in the right direction?


Comments

  • edited July 2015
    Twine does have and as well as or. You include it in the actual if statement:

    (if: $class is "warrior" and $weapon is "sword")[Some text appears here]


    BTW, never use "=" in if statements. It is an assignment operator, not a comparison.
  • Claretta wrote: »
    Twine does have and as well as or. You include it in the actual if statement:

    (if: $class is "warrior" and $weapon is "sword")[Some text appears here]

    BTW, never use "=" in if statements. It is an assignment operator, not a comparison.

    Thank you for your help. I thought already I tried writing the if statement exactly as you did. I must have been mistaken though.

    I didn't intend to use "=". I'm so used to other scripting languages. It's hard to keep them all sorted out sometimes.

Sign In or Register to comment.