0 votes
by (140 points)
I want to use a button to changes two veriables.

2 Answers

+2 votes
by (1.3k points)
edited by

ETA: This answer has the wrong version & story format for the question, my bad. It might still be useful to people using Twine 2 and Harlowe 1.2.4.

You can make a link that changes two variables like this. First, set the variables.

(set: $firstvariable to 1)
(set: $secondvariable to false)

Next, make your link where changes happen.

(link: "Soon your variables will change.")[(set: $firstvariable to it +1)
(set: $secondvariable to true)
(goto: "Passage where variable are different.")]

Admittedly this is a link not a button. I don't know how to make buttons. But I hope this helps.

I learned it all here -> https://twine2.neocities.org/

by (140 points)

Im using Twine 2 and sugercube 2.20

The button code look like this. 

<<button 'Sleep' home>><</button>>

 

by (1.3k points)
Cool, my apologies, I didn't see the tags on your question.
+1 vote
by (8.7k points)

Like this:

<<button 'Sleep' home>>
  <<set $lastThingEaten to "cheese", $dreams to "bad">>
<</button>>
by (140 points)
Thanks, it works  :D
...