Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

persistent.seen_endings is a variable you make yourself, to track the unique endings the player has gone through (as described in the earlier message). You invent the name for that. I called the example persistent.seen_endings, assuming it was a collection of the endings the player has seen. You could call it persistent.secrets_learned or persistent.jokes_heard or persistent.clovers_found, whatever makes sense. It needs to be persistent to be tracked across all playthroughs.

I suggest you read up more on Python sets to understand what this variable does - it's really only a slightly simplified way of tracking unique occurrences of something such as tallying the number of unique endings the player has seen. If you find this confusing, it's perfectly fine to do a longer method, such as by having

default persistent.bad_end = False
default persistent.normal_end = False
default persistent.good_end = False

and then tallying them up yourself for the achievement check e.g.

label good_ending:
  $ persistent.good_end = True
  if persistent.good_end and persistent.bad_end and persistent.normal_end:
    # Saw all 3 ends
    $ ending_achievement.progress(3)
  elif persistent.bad_end or persistent.normal_end:
    # Saw the good end and either the bad or normal end
    $ ending_achievement.progress(2)
  else:
    # Only saw the good end (this one)
    $ ending_achievement.progress(1)

Longer code you understand is basically always better than shorter code you don't!

Thank you! I'll do some learning cause I do want to shorten code where I can. my game's long enough as it is T^T