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

[Twine2, Harlowe] Basic question: How do I say "(if: one of these is true)"?

$
0
0
Hey ya'all, just writing my first Twine thing and as I am generally not a master of coding (and to be honest, a bit logically impaired) I have some very simple things breaking every now and then.

Anyway, in my program I have five variables that represent "slots" for mercenaries, and they are not in an array or anything fancy like that, just Boolean values in variables. Now I have a passage where you buy a new mercenary, and it's supposed to check if a slot is free before you can sign the contract, ...
(if:$credits>=$price)[(if:$slot1,$slot2,$slot3,$slot4,$slot5 is false))[- [[Sign contract|Hire]]]]

This piece right here doesn't work since it checks if *all* of these are false.
Using "either" doesn't work because it randomly checks if one of these is false.
What I want is something like:
(if:$credits>=$price)[(if:$slot1 OR $slot2 OR $slot3 OR $slot4 OR $slot5 is false))[- [[Sign contract|Hire]]]]

... but that's obviously not correct Syntax (or did I miss something?).
I would prefer array-less solutions since it would require a bit of rewriting and I'm going to break stuff if I do that.


Viewing all articles
Browse latest Browse all 1844

Trending Articles