How to Achievement Menu screen?

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
h0tWalker
Newbie
Posts: 7
Joined: Fri Jun 13, 2014 3:02 pm
Contact:

How to Achievement Menu screen?

#1 Post by h0tWalker »

Heya again :)

I am working on a Achievement Menu, but so far, everything I've tried has been for naught, and i looked up and got some clues, so i know I was never close to it...
I've added a menu button at the Main Menu and the In-game menu to open up a window for the achievement menu, and i try to add the Achievement menu within the "Screens.rpy" file.

Now, i have no idea how to do it, as stated, and i managed to test around with the "Preferences" options on my Achievement Screen, however, it wasn't quite how i wanted it, and i couldn't remove the stuff once you hit the "Achievements" button.

So i was wondering if anyone could eventually help me with starting on a achievement script, and eventually explain the mechanics of how to successfully make an achievement screen displaying locked achievements and how to unlock them in the game. I also wonder how you can potentially have a pop up window like steam when you unlock achievements up in the right corner maybe...

I don't want to push my work over at others, but I'm a new scripter, and I just need to get started. I hate it when i have to ask for help, but yeah, sometimes you just have to... :/

So to sum it up:

1. Create an achievement screen
2. Display images on the screen (locked / unlocked)
3. Pop up for achieve

One last thing, i was wondering if it was any possibility setting it up like the save menu screen, with the frames there (but images instead of the save file window), but not all the pages. I really want to go for the approach for the Scrolling layout on the achievements, but I guess I have to use that on the save / load menu as well? Not that it matters that much, and if it becomes like that, then I'd prefer the basic save / load menu layout.
Scrolling Load / Save Layout

I also came across this code, but didn't know how to get it attached to the main menu, but i didn't quite understand it, but hopefully it can be of some use as well i guess...

Code: Select all

screen a_scr:
    grid 2 3:
        if achievement_1:
            add "Top-Left.png"
        else:
            null
        if achievement_2:
            add "Top-Right.png"
        else:
            null

        if achievement_3:
            add "Center-Left.png"
        else:
            null
        if achievement_4:
            add "Center-Right.png"
        else:
            null

        if achievement_5:
            add "Bottom-Left.png"
        else:
            null
        if achievement_6:
            add "Bottom-Right.png"
        else:
            null

label start:
    $ achievement_1 = False
    $ achievement_2 = False
    $ achievement_3 = False
    $ achievement_4 = False
    $ achievement_5 = False
    $ achievement_6 = False

    show screen a_scr

    "No achievments"
    $ achievement_1 = True
    "Got one"
    hide screen a_scr
    $ achievement_6 = True
    "Got another one"
    show screen a_scr
    "..."
and as for pop up with steam, i saw something like this...

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
Thanks in advanced, and i really hope it's not too much of a bother :x

-Sincerely, Walker

Post Reply

Who is online

Users browsing this forum: Google [Bot]