The thing you're asking is basically how to have a player overall score, not linked to the single playthrough.
Sond easy but in fact require a number of things.
The fist one is to use a SET() instead of a simple tally counter. A SET() can contain just a single copy of an element.
To have such set work on a global meaning, it should be a persistent.
When you want to deal a point, just add a keyword to the set. You can compute the overall score by counting the elements in the set.
This is a very silly example, but should work.
Code: Select all
label start:
python:
if persistent.score == None:
persistent.score = set()
e "Welcome to my proxy game!"
e "Now you'll get a bonus point..."
$ persistent.score.add("bonus")
e "If you play multiple times, anyway, your score doesn't increase!"
$ the_score = len(persistent.score)
e "Your score is [the_score]!"
e "Try to launch again the game and see it for yourself."
The trick is to use
$ persistent.score.add("x")
with an "x" keyword different all the time, so you don't have sums even after multiple playthrough.