# Harlowe - How to attribute points to a link so the user can accrue a score?

Hi everyone,

I'm really new to Twine and an amateur when it comes to coding but hopefully, someone can still help me.... I've tried searching for an answer and I have found similar questions/answers but not anything that is near enough the same, or simple enough for me to understand/implement!

I'm creating a 'Choose your own adventure' style game where the 'player' can accrue points through choices they have made. I want the user to accrue or lose points once they've clicked on a link which updates a score that sits on every page. Is this even possible?

I've played around with some solutions but not found anything that has worked. Any ideas?

I'm using Harlowe 2.1.3

Thank you!

+1 vote
by (560 points)
edited by

Let's say one of your attributes is strength, with a baseline of 10. You could put this in your "Startup" passage,

``(set: \$strength to 10)``

If you want the player's strength to change when clicking on links, you could do this,

``````(link: "You spend a couple hours doing heavy farm work.")[
(set: \$strength to it + 1)
(go-to: "Go back to town.")
]``````

With a resulting total of 11 strength. Then use an if-statement to check how much strength the player has for ability checks. I'm sure there are better ways of doing this, but this is what I make do with. Note that you might not get those neat little grey arrows that connects passages in the overhead story view. I certainly don't and I would love to know how to fix that if someone more experienced could chime in.

by (156k points)

A link that updates one or more variables before traversing to another Passage is commonly known as either a "Setter Link" or a "Link with Setter"

@Piply: Your solution is the easiest way to create a "Setter Link" within Harlowe 1.x or 2.x

...get those neat little grey arrows that connects passages...

Unfortunately the Twine 2 Passage Map's "Determine Links Between Passages" and Passage Editor's "Automatic Create Missing Passage(s)" features only support the standard forms of markup based links no matter which story format you have chosen to use.

There are a number of methods/hacks you can use to trick the above mentioned two features into supporting both advance markup based links (**) as well as macro based links but each method relies on unintended/undocumented behaviours of both the Passage Map and the Passage Editor components, and the main issue with using unintended / undocumented behaviours is that they can change or be removed without warning.

eg. Using a HTML comment element to fool the above mentioned components.

``````<!-- [[Next->Second]] -->