0 votes
by (160 points)

Using Harlowe 2.1.

I'm trying to create a perks system, so the player will get into situations and their decision can provide a new perk. Not sure if it's a good approach, but this is how I'm doing (and failing):

• First, I want to declare all possible perks, so I put it inside an array of datamaps (in startup):

(set: $g_perks to (a:
    "name","Perk 1",
    "desc","The amazing first perk."
    "name","Perk 2",
    "desc","Fantastic perk #2."

• Second, I need to give the player a perk, storing it inside his var "$p_perks". Simple as:

(set: $p_perks to it + (a:"Perk 1"))

Now I want to list all perks the player unlocked:

(for: each _pperk, ...$p_perks)[_pperk]


How can I list all possible perks, like in a table? Something like:

Perk 1: The amazing first perk (unlocked)
Perk 2: Fantastic perk #2

Or: is there a better way to do such system?

Thank you!

Please log in or register to answer this question.

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.