0 votes
asked by (120 points)

Hi there. I'm a Twine newbie. I have to submit an interactive narrative for an assignment. Near the end of my game, I have a quiz. It is set up like so:

(set: $quizEmpty to 10)
(set: $quizAnger to 10)
(set: $quizProblem to 10)
(set: $quizRelationships to 10)

And then for each question:

''"I experience a chronic feeling of emptiness."''
<li>(link: "Strongly agree")[(set: $quizEmpty to it + 2)(goto: "quiz (pg 2)")]</li><li>(link: "Agree")[(set: $quizEmpty to it + 1)(goto: "quiz (pg 2)")]</li><li>(link: "Disagree")[(set: $quizEmpty to it - 1)(goto: "quiz (pg 2)")]</li><li>(link: "Strongly disagree")[(set: $quizEmpty to it - 2)(goto: "quiz (pg 2)")]</li>

I'm stuck on the results page. It's fine if one variable is higher than the others, but if two or more are equal by the end of the quiz, nothing shows up. I've tried to fix this by adding extra "ifs", but then it shows up with the highest variable AND any other variables that are equal. 

(if: $quizProblem > $quizEmpty and it > $quizAnger and it > $quizRelationships)[Problem behaviours] (if: $quizEmpty > $quizProblem and it > $quizAnger and it > $quizRelationships)[Emptiness and dissociation] (if: $quizAnger > $quizEmpty and it > $quizProblem and it > $quizRelationships)[Anger and impulsivity] (if: $quizRelationships > $quizProblem and it > $quizEmpty and it > $quizAnger)[Unstable relationships](if: $quizRelationships is $quizProblem and it is $quizEmpty and it is $quizAnger)[boom] (if: $quizRelationships is $quizProblem)[boom1] (if: $quizRelationships is $quizProblem and it is $quizEmpty)[boom2] (if: $quizProblem is $quizEmpty)[boom3] (if: $quizProblem is $quizEmpty and it is $quizAnger)[boom4] (if: $quizProblem is $quizAnger)[boom5] (if: $quizRelationships is $quizAnger)[boom6] (if: $quizRelationships is $quizEmpty)[boom7]
[[Reaction]]

I just want to have it so the highest variable is the one displayed on the results page. If two or more are equal, but are of the highest value, how do I get that to display?

I also wanted to use these results as a basis for the choices the player makes next. For example, if their result is Anger, then moving forward they can only access an angry choice. If the result is both Anger and Emptiness, then they can only use an Anger and Emptiness based choice. I'm not sure if this makes sense--I think I'm way out of my league here, but I assume this is possible? Any help would be much appreciated.

1 Answer

0 votes
answered by (1k points)

Greyelf, I think, had a great answer for this. Way better than what I was going to suggest. Does this do what you want?

Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.
...