+1 vote
by (8.8k 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
by (62.7k points)
selected by
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. 

by (8.8k 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.