Hi guys
So I'm fairly new to Twine, and completely noob with coding. I am currently making an interactive story meant for kids at a museum. In this story, the kids will have to help the character with some calculus. Now, I would like to use the dialog box that's enabled by the (prompt: " ") macro to help give the kids the ability to answer instead of making the far easier multiple choice.
I.e. "Peter has to earn money for a new pair of boots that costs 10 USD. How long will he have to save money for the boots when he earns 25 cents a week?
Since the (prompt:) can be used to set the value of a variable, I was wondering if it could also be used as a gateway in the sense that the kids have to put the correct pre-set value (40) into the dialog box, they will have to continue guessing until they get the correct value.
I have no idea whether its even possible, but this is what I got so far and it's not working:
(set: $value to 40) [(put: (prompt: "Hvad er svaret?") into $value)[(if: $value is 40)(set: $value to true)(goto: "correct answer")]
(else:)[(goto: "wrong answer|retry")]
Rolf (DK)
So I'm fairly new to Twine, and completely noob with coding. I am currently making an interactive story meant for kids at a museum. In this story, the kids will have to help the character with some calculus. Now, I would like to use the dialog box that's enabled by the (prompt: " ") macro to help give the kids the ability to answer instead of making the far easier multiple choice.
I.e. "Peter has to earn money for a new pair of boots that costs 10 USD. How long will he have to save money for the boots when he earns 25 cents a week?
Since the (prompt:) can be used to set the value of a variable, I was wondering if it could also be used as a gateway in the sense that the kids have to put the correct pre-set value (40) into the dialog box, they will have to continue guessing until they get the correct value.
I have no idea whether its even possible, but this is what I got so far and it's not working:
(set: $value to 40) [(put: (prompt: "Hvad er svaret?") into $value)[(if: $value is 40)(set: $value to true)(goto: "correct answer")]
(else:)[(goto: "wrong answer|retry")]
Rolf (DK)