0 votes
by (2.4k points)
Hey there,

Back to using Twine, and I am wondering why sometimes you need to replace your $variables by _variables ?
Thanks a lot

1 Answer

0 votes
by (8.9k points)
edited by
Best answer
$variable is remembered through the whole game.

_variable is forgotten when you leave the passage.

Use _variables for throwaway things that you don't need to refer back to later. Using a _variable when you can prevents your game from getting clogged up with useless $variables.
by (2.4k points)
Thanks for your answer !

But for instance, I <<set>> up a $force variable, in my "StoryInit" file, yet, when I want to modify it by doing <<set $force++>> it doesn't recognize $force. It won't work until I write <<set _force++>>
Why is that ? What did I do wrong ?
by (2.4k points)
Nevermind, the _force change doesn't even make it work. Uhm.
Yet, when I start the game, it *is* written that $force is set. I don't get why I can't make it work in a passage.
by (68.6k points)

You mean the StoryInit special passage, which must be spelled exactly like that (incl. capitalization), not file.

How exactly are you initializing it within StoryInit?  Why don't you think it's working (i.e. what problem are you seeing)?

by (2.4k points)
I am sorry, it started working now. I'm guessing I did it wrong the first time and didn't notice. Thanks a lot for your help anyway, I'm glad that every time I come back on this Q&A, you guys are always here to help. Great community. You rock.