Achievement Unlocks

I know I’m making a LOT of posts with these specific tags, however, I have a lot of plans for this series. I need to know if there is a way to reference achievements. I have a code system implemented that allows the player to start the game with different circumstances(Genomes unlocked at the start, Better starting equipment, abilities they would not otherwise have etc.) I want these codes to be given to the player in the codes menu at the start of the game based on the number of achievements they have unlocked. is there a way to do this?

1 Like

There is no built in mechanism, but it’s easy to make. All you have to do is create a counter variable and increment it every time the player unlocks an achievement.

If you have scenes that repeat that might accidentaly increment the counter after the player already has the achievement, you can use the *check_achievements command to prevent unwanted side effects.

On top of this, Is there a way to use *check_achievements inside of an if statement for this? One code in particular I want to unlock once the player gets all of the endings.

Haven’t tried it personaly, but based on the documentation, I think you should put the if statement inside check_achievements. I might be wrong. Best way to find out is to test it with a simple scene.

Alright, Thanks for the help. I’ll message back here later on whether or not it works.

1 Like

It works. If you use *check_achievements before an *if statement, you can set up the statement based on the achievement status. I set up this choice and it works perfectly.

*label codes
What code do you want to use?
*check_achievements
*choice
  *if (choice_achieved_fae) and not(fae)
    #Enable Fae Genome
      *set fae true
      *goto codes
  *elseif (choice_achieved_fae) and (fae)
    #Disable Fae Genome
      *set fae false
      *goto codes
3 Likes

Wow. I wasn’t aware ChoiceScript let you do that!?!

Thanks buddy!

No problem! Was just testing a theory.