How to pass a variable to another page?

+1 vote
asked Aug 10, 2017 by Charlie (7,900 points)

This is probably a really stupid question, 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, 2017 by Chapel (49,390 points)
selected Aug 24, 2017 by Charlie
Best answer

You can use a setter link

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

Or a <<link>> macro. 

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

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, 2017 by Charlie (7,900 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.

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