0 votes
by (170 points)
Hi everybody,

I'm creating a game where, at the end, there is a table of failure/success of a player, depending on his behavior during the game (number of different items he or she collected etc). Is it possible to create that table, make twine check which conditions are met and then return result?

For example it looks something like this

food   equipment     valuables

2            2                      2

4           4                       4

6            6                       6

 

So it would check all the columns and return results from these "cells". If someone collected 4 food and equipment, but only 2 food, player would get "game over", but if player gets 4 of each resource, he gets "barely survived" title and so forth.

Thanks,

Uros

2 Answers

0 votes
by (6.2k points)
I'm not sure I really understand your question, but do you know how to use variables?
0 votes
by (560 points)

I think you're making this more complicated than it need be. Every variable needs to exceed a threshold in order to obtain the win-state of that threshold, am I correct? It doesn't matter if the player gets a perfect score in two of the columns; if they get a 1 in food, but 6's in the other two, they still get a game over?

Would this work for you?

(if: $food or $equipment or $valuables <= 2)["Game over."]
(else-if: $food or $equipment or $valuables <= 4)["You survived, but just barely."]
(else:)["Perfect score!"]

 

...