How to pass a variable to another page?

+1 vote
asked Aug 10 by Charlie (620 points)

This is probably a really stupid question, but...how do I pass a variable to another page?

I want to <<set $armour to "leather">> and go to passage [[inventory]] in one click.

I cannot work out how to do it.  :-D

1 Answer

+1 vote
answered Aug 10 by Chapel (17,920 points)
edited Aug 10 by Chapel

You can use a setter link

[[inventory][$armour to 'leather']]

Or a <<link>> macro. 

<<link [[inventory]]>>
    <<set $armour to 'leather'>>
<</link>>

EDIT: FYI, passing has a specific meaning in programming and this isn't it. Not a huge deal, just want to alleviate potential future confusion. 

commented Aug 10 by Charlie (620 points)
Thank you very much.  :-)
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.
...