Howdy, Stranger!

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

Riddle game not working

Hi everyone,

New Twine user here. I've got a little bit of coding experience under my belt, but I'd say pretty novice level. Anyway, I've been messing around with Sugarcube 2.14.0, trying to make some very small, modular games that I intend to incorporate into a larger one.

The current one I'm working on is a riddle game - providing a riddle and then a text box for the player to input an answer. The text box is intended to set a variable and take the player to the next passage. Using a conditional, I then want the next passage to either present the next riddle if the previous one was answered correctly, or else send the player to the "you lose" screen. However the variable setting and/or checking doesn't seem to be working the way I intend. Instead, the player is able to advance through every passage no matter what they type. The "else" is never triggered, and they cannot lose.

I've been looking through the forums and trying to figure out where I'm going wrong, but no success so far. Would be much obliged for any help!

Passage 1:
A Voice speaks from the darkness:

"More powerful than the Lord.
More evil than the Betrayer.
The beggar has it.
The rich man needs it.
Consume it and perish."

What do you answer?

<<textbox "$nothing" "" "Riddle2" autofocus>>
Passage 2:
<<if $nothing is "nothing" or "Nothing">>

A soft chuckle echos all around you. The Voice continues.

"Though I be softer than a feather,
My bite may be sharper than the keenest blade.
Fiery and hot, I am at my most seductive.
Even short myself, with kindness I may go a long way. 
Mighty am I.

What am I?"

<<textbox "$word" "" "Riddle3" autofocus>>

<<else>>

"You sense that you are now alone. The darkness overwhelms you."
[[You lose]]

<</if>>

Thanks in advance!

Comments

Sign In or Register to comment.