"If", "Variables" and madness

64 views
Skip to first unread message

AsgharD

unread,
Sep 14, 2014, 5:52:35 PM9/14/14
to twee...@googlegroups.com
Hi to all. I was wondering, for my next adventure game, to use a mental sanity sistem structured with the "if" and "variables" aspects of Twine.
Something like this:

START WITH MENTAL STABILITY AT 0 > VISITING CERTAIN TEXTS ADD OR REMOVE STABILITY > WHEN STABILITY IS UNDER CERTAIN NUMBERS, SOME "IF" ARE TRIGGERED

I was thinking something like this, how do you think i can obtain something similar in twine?

Thank you.

Tory H

unread,
Sep 29, 2014, 1:09:15 PM9/29/14
to twee...@googlegroups.com
Hi Asghar! Thank you for your interest in Twine! 

Here's how I would go about it.

: Start

<<set $mentalStability = 0>>

There is a book of arcane studies.

Read the [[book][$mentalStability -= 10]]
Touch the [[book][$mentalStability -= 5]]
Absolutely don't touch the [[book]]

: book

<<if $mentalStability < -5>>
You are stark raving mad.
<<else if $mentalStability < 0>>
You are going mad.
<<else>>
You are fine.
<<endif>>


OR
You can link to different passages, too, change the variable within the passage, and join up after. I prefer changing the variable in the link because the connection to the action is more clear.

Note that <<else if>> is appropriate for the Sugarcane/Jonah story formats, but <<elseif>> is necessary for Sugarcube.


More information about if/else is available on the Twine wiki here: http://twinery.org/wiki/if
More information about expressions is available on the Twine wiki here: http://twinery.org/wiki/expression

I hope this helps. Happy Twining!
Reply all
Reply to author
Forward
0 new messages