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:
    (dm:
    "name","Perk 1",
    "desc","The amazing first perk."
    ),
    (dm:
    "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]

Question

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
etc...

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

Thank you!

Please log in or register to answer this question.

...