Howdy, Stranger!

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

How To Use Set And If?

I'm very new to twine and I'm trying to create a system based on if and set. But whenever I use something like
(If: $Math Is "True")
I get an error (When I start the game)
True Is Not Defined
Same With set
(Set: $Math To False)
False Is Not Defined
Thank You In Advance.

Comments

  • You need to state which story format you are using, as answers can be different for each one. Based on the syntax of your example I am going to assume you are using Harlowe.
    When you include code examples in your post please use the C button above the comment field to wrap the example in code tags.

    Harlowe is built using Javascript which is a case-sensitive programming language, so the case of both true and false are important. On the other hand Harlowe macro names and keywords (like to) are not case-sensitive.

    Try the following:
    (set: $Math to true)
    (if: $Math)[Math is true]
    
    (set: $Math to false)
    (if: !$Math)[Math is false]
    
Sign In or Register to comment.