0 votes
by (120 points)
Hello! I'm rather new to twine, and to programming in general, so I'm sorry if this is a stupid question, but here goes:

I want my game to test for two variables before running a bit of text. I know how to make it test for one variable (ie: (if: $piratelove is 10)["I love you, my darling!]), but can I make it check that two conditions are met before it runs (ie: that $piratelove is 10 and $piratemarriage is true)?

I'm using harlowe 2.1.0, and I'd like to stick with it, but I'm also curious if it would be possible in sugarcube or snowman if not in harlowe. Thank you for reading!

1 Answer

0 votes
by (149k points)

The Boolean data section of the Harlowe manual explains about using the and operator to evaluate if multiple conditions are true.

eg. the following only shows the related text if both conditions evaluate to true. (untested)

(if: $piratelove is 10 and $piratemarriage)[Shown if Pirate Love is 10 and Pirate Marriage equals true]


Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.