Hey guys! I’m trying to have 4 buttons that set a variable to something different depending on which button is pressed. My current code is pasted below; right now, it is just outputting “Bricks” no matter what button is pressed. I do not know how to format this text, sorry!
<<timed 3s t8n>> She asks which one you want to watch.
<<button [[I can't decide!|Movie]]\
<<set $movie to either("Mass", "Bricks", "Morio")>>
<<set $indecision to true>>
<</button>>
<<button [[Let's watch Mass Massacre 4.|Movie]]\
<<set $movie="Mass">>
<<set $indecision to false>>
<</button>>
<<button [[That Morio movie seems pretty good...|Movie]]\
<<set $movie="Morio">>
<<set $indecision to false>>
<</button>>
<<button [[I haven't stared at enough walls lately. Lets watch Bricks!|Movie]]\
<<set $movie="Bricks">>
<<set $indecision to false>>
<</button>>
<</timed>>
`Preformatted text`
The syntax of each of your <<button>> macro calls is invalid. You have…
<<button [[I can't decide!|Movie]]\
<<set $movie to either("Mass", "Bricks", "Morio")>>
<<set $indecision to true>>
<</button>>
…when the correct syntax is…
<<button [[I can't decide!|Movie]]>>
<<set $movie to either("Mass", "Bricks", "Morio")>>
<<set $indecision to true>>
<</button>>
note: You’re currently using both the to keyword and the mathematical = symbol as an assignment operator in your <<set>> macro calls. For code consistency sake it’s better to use one or the other, not both.
I have wasted an hour and a half of my life because of >>
Thank you. I will keep your note on to and = in mind.
Edit 1: However, it seems sugarcube forces me to use to for strings and boolean and = for numbers
Edit 2: Edit 1 was incorrect. It forces me to use to for the either() function. to and = seem to be interchangeable otherwise.
Edit 3: I was completely wrong.