Achievements?

Finally started playing around with achievements to see how they might work in Choice of Rebels, and of course I immediately got an error: “Invalid *achievement, ${} not permitted in achievement description.”

@dfabulich, out of curiosity, how much coding hassle would it be to make ${variable} work in achievement descriptions? I’ve got some genderflipping characters whose names change with their sex, and not being able to name them directly in an achievement description would be a mild annoyance.

File under non-urgent and non-essential.

1 Like

@Havenstone, I have the same issue with Blackraven. You could perhaps use their family name.

Apple and Steam only allow us to use pre-written strings as achievement descriptions.

Hmm, had forgotten about that question. What about making them work as permanent booleans that you can call on? (See above).

I think this could be the case for most platforms. I can’t remember any specific examples but I’m sure I’ve played some Xbox/Playstation games that cover similar situations by doing something like:

Become the Regent (50)
Be Crowned King or Queen of Awesome Land

I.e. Just expand on it in the description, and/or be careful about how you refer to a character, e.g. do it by title or position rather than name?

Another option is to actually have multiple sets (one for each gender), that might even encourage people to do multiple playthroughs.

That actually almost works today with the *check_achievements command. This command creates temp variables named “choice_achieved_dragonslayer”, which you can use to detect whether the player has previously reached an achievement. You can use this in a few different ways.

Repeated achievements: Each time you call *achieve, a banner will appear to indicate that the player has earned the achievement. If the player reaches the same achievement multiple times, the banner will display each time.

If you want to prevent the banner from appearing multiple times, then you can do it like this:

*check_achievements
*if not(choice_achieved_dragonslayer)
	*achieve dragonslayer

Meta achievements: These are achievements that you achieve by achieving other achievements. They’re annoying to code, but they do work:

*check_achievements
*if ((choice_achieved_dragonslayer and choice_achieved_lover) and choice_achieved_secret)
	*achieve dragonmaster

Free purchases: You can give the player free IAP for playing well by assigning the player an achievement.

*check_achievements
*check_purchases
*if choice_purchased_goggles or choice_achieved_goggles
	You have the goggles! They're super effective!

But there’s a big caveat. Part of the reason there isn’t more public documentation about ChoiceScript achievements is that there isn’t a very reliable way of making sure that they stick around. On iOS and Steam, Apple and Valve provide official mechanisms for registering achievements that stay achieved. On Android and Chrome Web Store, the user installs the app, so as long as the app remains installed, the achievement stays unlocked. But on the web, it’s very easy to lose your achievements (e.g. if you clear cookies and local storage).

If we host the game on choiceofgames.com, we can try to take care of this for you, but not just anybody can put a game up on their website and have reliable working achievements.

At some point, I’d like to set up some code and instructions allowing players to register their games with Google Play Game Services, in which case Google will store your players’ achievements (but they’d still have to login first).

For now, it’s not totally possible/reliable to create a truly “permanent” boolean.

13 Likes

Oh wow, cool, didn’t know any of that, I was prepared to make a gosub_scene for the meta achievement thing, that’s great that it’s already in there! Okay, so it’s not 100% reliable, but then again what is. Merry christmas btw!

These are my achievements from my wip game. Check this for other issues… Thanks!:

*achievement plotwise visible 20 Plotwise
Beat the game with original ending.
“You beat this game. But it’s more fun when you explore more.”
*achievement costed hidden 20 Costed by an Arm
hidden
“You beat this game, but something more different. So dramatic.”
*achievement pyrrhic hidden Pyrrhic Victory
hidden
“You are not ready to die but… oh well… You’ve come this far.”
*achievement pow visible 10 Ka-POW
Have a highest POW possible
“It’s a shame. I’ve got two fists, but you’ve only got one face.” -Vi, the Piltover Enforcer
*achievement str 10 STR-ong
Have a highest STR possible
“The heart is the strongest muscle” -Braum, the Heart of Freijord
*achievement agi visible AGI-le
Have a highest AGI possible
“Swiftly!” -Teemo, the Swift Scout
*achievement acc visible ACC-ustomed by Scope
Have a highest ACC possible
“(Caitlyn’s Taunt)”
*achievement eff visible The EFF
Have a highest EFF possible
“It’s Super Effective-Pokemon quote”
*achievement daisy visible 30 The Bear-faced Mom
Compliment about Daisy’s Mom.
“Those eyes? I love bears!”
*achievement steph 30 Sparkling Pink
Get dazzled by Stephany’s aircraft.
“WOAH! Da plane! Da plane! That’s hod!”

Mine (Notepad ++) says that achievement is only allowed in start-up. How do I activate it in game than?

1 Like

Sorry to wake up such an old thread, but I have a problem I couldn’t find a solution for anywhere
I have managed to successfully create an achievement but when I use the *achieve command an error pops up saying ‘alertify is not defined’

You probably used the wrong formatting. Otherwise, you might used a restricted keyword. Mind posting the list in your ‘startup.txt’ and the command used in the text?

*achievement a1 visible 40 Named
Have a name
You have been named

*achieve a1

Just a practice achievement for now.

Hm. This might just a guess, but try changing both a1 into something else, say, abc1.
Otherwise, follow the standard startup.txt setup:

*title
*author
*scene_list
   startup.txt
 
*create

*achievement

Text

still not working, also doesn’t work with a word without a number at the end and only a number comes up with it’s own error

*achievement a1 visible 40 Named
    Have a name
    You have been named

It’s formatted like this, right? And *achieve a1 Is indented inline with the text above it too?

yeah, indentation isn’t the issue

Hmm, I’m running out of ideas. Alertify is part of JS inner function, so it shouldn’t pop out as an error without something wild going on behind the scenes, or I’m missing something so simple.

Are you testing in dashingdon or locally?

Locally, I don’t want to upload it to dashindon while it has such a fundamental error
Did a test in dashingdon, works now, no idea why

How do you test it? Did you follow the steps mentioned in the CoG blog here?


Or did you go manual by “uploading” the folder for each page refresh?

Oh, and to narrow it down, does your game runs smoothly without all the achievement setups?