Achievement Unlocked notification?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Giovedi
Regular
Posts: 147
Joined: Sun Sep 09, 2012 6:20 am
Contact:

Achievement Unlocked notification?

#1 Post by Giovedi »

I feel like this should be simple, and I'm just too inexperienced with images to make it happen on my own...

Anyway, how can I get a little 'achievement unlocked' banner to appear, then fade out, like they do on Steam etc? I've got a bonus gallery whose elements only unlock after picking certain choices throughout the game. When the player's unlocked something, I'd like to alert them via little banner in the corner so they know not to take that path again next playthrough.

pwisaguacate
Veteran
Posts: 356
Joined: Mon Mar 11, 2013 11:03 pm
Contact:

Re: Achievement Unlocked notification?

#2 Post by pwisaguacate »

This can done by using persistent data and showing the notification with a bit of ATL. For example:

Code: Select all

image achieve1 = "achieve1.png"

transform achieveanim:
    xalign 1.0  yalign 0.0 alpha 0.0
    easeout 0.5 alpha 1.0
    2.5 # Pause
    linear 3.0 alpha 0.0

label start:
    "DEMO: achievement notification with persistent data"

    if not persistent.achieve1:
        show achieve1 at achieveanim with hpunch

    "You will not see the image again until you clear persistent data."

    $ persistent.achieve1 = True

    return
NOTE: Persistent booleans go from False to True, so this if statement may look funny.

Giovedi
Regular
Posts: 147
Joined: Sun Sep 09, 2012 6:20 am
Contact:

Re: Achievement Unlocked notification?

#3 Post by Giovedi »

Whoa, thanks guy! Exactly what I needed.

Post Reply

Who is online

Users browsing this forum: barsunduk, Bing [Bot]