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

Making a 'shop' menu, or dynamically populating a list and reading what the player clicked back

$
0
0
Hello all.

So, I am having a good time with Twine 2. Using the default Harlowe 2.0.1 format.

Here is what I have run up against. I want to make a clickable menu of choices for the player to purchase from a shop. I have a passage where I populate a dm with weapons, in the format "weapon name", "damage" for a bunch of weapons.

While I have no issue putting them onto the screen, all linked up and clickable using a for loop and the (click:) command, I cannot figure out how to read back what the player chose later. Obviously if I try to read back temp variable, it doesn't work as the variable went out of scope long before the player clicked.

It would be fine if I could read back the text of the clicked link, but I don't know how.

Anyway, to make it short: I want to populate a shop with links to buy items, find out what item the player chose, and then move on with that info (deducting gold from their inventory, etc.), and for whatever reason this has me stumped.

Viewing all articles
Browse latest Browse all 1844

Trending Articles