Making an Achievements 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
User avatar
Pinecone
Newbie
Posts: 16
Joined: Fri Jan 01, 2016 4:57 am
Projects: Cloaked Knight
itch: iridiangrey
Contact:

Making an Achievements screen?

#1 Post by Pinecone »

So I recently integrated an achievements system into my game! (It's really working well :D)
So I wanted to make an achievements screen!
Buuuut I'm not exactly sure how?
Here's what the locked achievement looks like:
achlock.png
achlock.png (2.44 KiB) Viewed 1383 times
and here's what it looks like with an actual achievement:
achbadfriend.png
achbadfriend.png (3.47 KiB) Viewed 1383 times
and HERE's what I want the screen to look like? With one revealed achieve and the rest locked.
achmockup.png
I know I need to use padding but I'm not sure how to go about this??? Any help and advice would be appreciated (*゚∀゚*)
My game is 800x600 btw
ALSO should I make it a screen or label in the script.rpy???
(Also I know using imagemaps is less efficient than using imagebuttons so if anyone could maybe help with setting that up??? I'd be much much appreciated!!!!)

User avatar
Scribbles
Miko-Class Veteran
Posts: 636
Joined: Wed Sep 21, 2016 4:15 pm
Completed: Pinewood Island, As We Know It
Projects: In Blood
Organization: Jaime Scribbles Games
Deviantart: breakfastdoodles
itch: scribbles
Location: Ohio
Contact:

Re: Making an Achievements screen?

#2 Post by Scribbles »

You should make that a screen, and I also use an imagemap for my very similar achievement screen. I'm not sure if (in this case) image buttons would be easier or not... but I know how to do it with imagemaps

Code: Select all

imagemap:
        ground "the_locked_image.png"       #LOCKED
        idle "unlocked_image.png"  #UNLOCKED HOVER HOTSPOT IF PERSISTENT
        hover "unlocked_image_hover.png"
then define your hotspots and use persistent variables

Code: Select all

if persistent.achievement_01:
            hotspot (#, #, #, #) action ##if there is an action you want it to have, I show a message when it's clicked    
        else:
            pass
and so on.

The unlocked image will appear on top of the ground image, if it's unlocked, as an idle. I hope that helps > < if not I'm sorry!
Image - Image -Image

User avatar
Pinecone
Newbie
Posts: 16
Joined: Fri Jan 01, 2016 4:57 am
Projects: Cloaked Knight
itch: iridiangrey
Contact:

Re: Making an Achievements screen?

#3 Post by Pinecone »

This does help a bit, but I'm a bit confused on how to make a new screen? Like, how to label it and everything.
Also, for the hotspots, should I define each one under the imagemap?
I was slightly unsure at first, but this is getting much easier for me to understand!! :D

User avatar
Scribbles
Miko-Class Veteran
Posts: 636
Joined: Wed Sep 21, 2016 4:15 pm
Completed: Pinewood Island, As We Know It
Projects: In Blood
Organization: Jaime Scribbles Games
Deviantart: breakfastdoodles
itch: scribbles
Location: Ohio
Contact:

Re: Making an Achievements screen?

#4 Post by Scribbles »

screens are relatively easy to create once you start to understand screen language https://www.renpy.org/doc/html/screens.html

basically you want:

Code: Select all

screen my_screen:
    tag menu #tells the code that it's a menu and will replace another screen labeled as menu

        imagemap:
        ground "the_locked_image.png"       #LOCKED
        idle "unlocked_image.png"  #UNLOCKED HOVER HOTSPOT IF PERSISTENT
        hover "unlocked_image_hover.png"

        if persistent.achievement_01:
            hotspot (#, #, #, #) action ##if there is an action you want it to have, I show a message when it's clicked    
        else:
            pass
        if persistent.achievement_02:
            hotspot (#, #, #, #) action    
        else:
            pass
there are a ton of code stuff out there for imagemaps, and the documentation has it as well :) The hotspots are the area. Imagebuttons may be better suited but I'm just not sure how to work it off the top of my head. Try to poke around the forum cookbook and documentation and I'm really bad at explaining things > <
Image - Image -Image

User avatar
Pinecone
Newbie
Posts: 16
Joined: Fri Jan 01, 2016 4:57 am
Projects: Cloaked Knight
itch: iridiangrey
Contact:

Re: Making an Achievements screen?

#5 Post by Pinecone »

Nah I'm pretty good I think! I got a background all made up and such for it, thank you so much for your help!! <3

Post Reply

Who is online

Users browsing this forum: No registered users