Achievements?

I created an achievement list and the message appears, but there is no way I could watch them in an achievement button or something? Because if people can’t see them they are totally useless

@poison_mara
I’m assuming that’s done on CoG’s end. I don’t think it’d show up in anything but a packaged app.

Ah ok i was thinking i was doing something wrong with coding

@Samuel_H_Young @poison_mara

No, in the latest versions of Choicescript the achievement button should appear for you (though only if you have some UNhidden achievements). Remember to swap out index.html and style.css as well as the all the web folder files.

Thanks work now i just forgot change index last time :frowning:

@CJW
Oh, cool!

The more I think about it, the more I would love for achievements to work as permanent booleans, which they kinda technically do? It’s just that you can’t call them in an *if as far as I know. Think about it, unlocking other game modes on a second playthrough, ala New Game+, or maybe having a cheat menue appear. Or a gallery with pictures tied to the achievements! So many possibillities. Can it be done?

1 Like

Oops, forgot to tag. @dfabulich

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?