Quantcast
Channel: Help! with 2.0 - Twine Forum
Viewing all articles
Browse latest Browse all 1844

How to store strings and vars inside another var

$
0
0
Sorry if I wasn't clear, maybe I don't know how to explain, only showing.
Let's suppose I have this:
You've found a shield!(click:"shield")[(set: $inventory to it + (a: $shield))]

So when the player clicks "shield", the item (set in another place) will be stored in my "items" array.
But write all this code all time where there is an item can bloat the code a bit. How can I, if possible, do something like:
You've found a $itemshield

where $itemshield is (link-reveal:"shield")[(set: $inventory to it + (a: $shield))]?

Viewing all articles
Browse latest Browse all 1844

Trending Articles