Howdy, Stranger!

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

How do you overwrite "True" "False" code statements?

There is a passage in my project that needs to have multiple True False choices.

<<if $rope eq "true">>

(This stuff happens.)

<<else>>

(If you didn't have the rope this happens)

<<endif>>


But what about attaching multiple functions such as

<<if $rope eq "true">> + harness

(Now the old text of True Rope is deleted and the action is replaced with True Rope and Harness which is a simple modulation of the activity)

How do you make this a possibility in code? Right now as it stands if you try and use multiple True's in a passage they will all activate instead of prioritizing or replacing.
Please advise.

Comments

  • I'm not entirely familiar with the if syntax for Twine yet, but by the sound of things you need to combine...so try something like this:
    <<set $rope = true>>
    <<set $harness = false>>

    <<if $rope eq true and $harness eq true>>
    boom
    <<elseif $rope eq true>>
    zing
    <<elseif $harness eq true>>
    bang
    <<endif>>
Sign In or Register to comment.