Can check_achievement also check a variable?

Hi again! Ok, I’ve looked through all the threads I can find on achievements, and haven’t seen anything that points me in the right direction so I’m just going to ask. Sorry in advance if this has already been answered somewhere. Can you have the *check_achievement command also check a variable for awarding an achievement. For example:

*set charKill = 1
*check_achievements
*if not (choice_achieved_firstkill)
    *achieve firstkill
*check_achievements
*if not (choice_achieved_fivekills)
    *if (charKill = 5)
        *achieve fivekills
*check_achievements
*if not (choice_achieved_tenkills)
    *if (charKill = 10)
        *achieve tenkills

Is it possible for that to work? There are a few places where you can either fight something or avoid fighting it, depending on your choices (of course!) so I’d really have to check for each achievement at each possible encounter. This is just one example. Any suggestions?

Lessa

Yes, that works.

2 Likes

Thank you so much for your help!

I don’t think you need 3x check_achievements here though. Just the once is enough, unless of course you want to make a second achievement dependent on a first that might have just been achieved.

1 Like

Basically, which achievement is unlocked is dependent on the charKill variable. Since the encounters that would run this check can potentially be avoided (depending on player choices) I think I need to run the check at each encounter. Or do you mean that I should be able to check for each achievement with just one check_achievements? I don’t have it set up for any achievements to be unlocked based on having unlocked a different achievement (yet!)

Lessa

1 Like

This :slight_smile:

One run of the command will populate all the _achieved variables.

3 Likes

I used this to unlock extra options in replays of my game: you can only access some choices in a Kiss from Death if you’ve got certain achievements already.

2 Likes

Thank you both! This gives me a lot to think about, and a way to make my code neater :slight_smile: