My CG gallery isn't working?

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
Mammon
Miko-Class Veteran
Posts: 712
Joined: Sat Nov 07, 2015 3:09 pm
Completed: Pervert&Yandere, Stalker&Yandere
Projects: Roses Of The Thorn Prince
Contact:

My CG gallery isn't working?

#1 Post by Mammon »

Sorry if I'm supposed to be asking this in the original thread in the Ren'py Cookbook, but that thread's last reply was in March and the red bar above the title says not to post questions in that section of the forum too.

Argh, I've tried to make a CG gallery as described in this thread and I got as close as seeing my images once, even though they were larger than the screen itself. But I have no idea what I did to achieve that and I can't even remember everything I tried out since copying the OP's code. But when I try to open my CG gallery, I'm only seeing red words like in the screenshot below. I have added an image of 267x150 pixels called gallocked and there are no typos in the image names any more (are those supposed to be in script rather than screens btw?) What did I do wrong?

Code: Select all

#CG gallery
init:
    image accidental kiss= "images/GC/accidental kiss.png"
    image Alex slip up = "images/GC/Alex slip-up.png"
    image Alexs flashback nR = "images/GC/Alexs flashback nR.png"
    image Alexs flashback wR = "images/GC/Alexs flashback wR.png"
    image Bunnys run= "images/GC/Bunnys run.png"
    image concrete loitering= "images/GC/Concrete loitering.png"
    image concrete loitering2= "images/GC/Concrete loitering2.png"
    image Rachel pantyshot= "images/GC/Rachel pantyshot.png"
    image Vanessa pantyshot= "images/GC/Vanessa pantyshot.png"
    image Rachel chase= "images/GC/Rachel chase.png"
    image sensual encounter= "images/GC/sensual encounter.png"
    image yandere kiss= "images/GC/yandere kiss.png"
    image white= "images/GC/white.png"
    image red= "images/GC/red.png"
    image missing poster Charles= "images/GC/missing poster Charles.png"
    image title_screen= "images/GC/title screen.png"
    image yandere eyes= "images/GC/eyes-yandere.png"
    image breasts= "images/GC/breasts.png"
    image Yandere kiss= "images/GC/yandere kiss2.png"
    image Vanessa sleeping= "images/GC/Vanessa asleep.png"
    image Vanessa fondling= "images/GC/Vanessa fondling.png"
    image Vanessa falling= "images/GC/Vanessa falling.png"
    image Vanessa falling light= "images/GC/Vanessa falling light.png"
    image Vanessa rescue= "images/GC/Vanessa rescue.png"
    image RichardxBunny = "images/GC/RichardxBunny.png"
    image BunnyxRichard = "images/GC/BunnyxRichard.png"
    image bleeding out day = "images/GC/Bleeding out day.png"
    image Vanessa photo = "images/GC/Vanessa photo.png"
    image pre-murderer = "images/GC/pre-murderer.png"
    image Richard Guilt = "images/GC/Richard Guilt.png"
    image Vanessa_the_door = "images/GC/Vanessa_the_door.png"
    image Richard stabbed rain = "images/GC/Richard stabbed rain.png"
    image Richard stabbed fuzzy = "images/GC/Richard stabbed fuzzy.png"
    image Richard stabbed light = "images/GC/Richard stabbed light.png"
    image KimvsVanessa = "images/GC/KimvsVanessa.png"
    image Vanessa vs Kim = "images/GC/Vanessa vs Kim.png"
    image dramatic entrance = "images/GC/dramatic entrance.png"
    image survivor-end = "images/GC/survivor-end.png"
    image Murderer end = "images/GC/Murderer end.png"
    image Unknown end = "images/GC/unknown end.png"
    image Guilt end end = "images/GC/guilt end.png"
    image happy end = "images/GC/happy end.png"
    image logical end = "images/GC/logical end.png"
    image gallocked = "images/backgrounds/gallocked.png"    
    image waifu_route1 = 'images/GC groups/waifu_route1.png'
    image waifu_route2 = 'images/GC groups/waifu_route2.png'
    image waifu_route3 = 'images/GC groups/waifu_route3.png'
    image waifu_route4 = 'images/GC groups/waifu_route4.png'
    image waifu_route5 = 'images/GC groups/waifu_route5.png'
    image yandere_route1 ='images/GC groups/yandere_route1.png'
    image yandere_route2 ='images/GC groups/yandere_route2.png'
    image yandere_route3 ='images/GC groups/yandere_route3.png'
    image yandere_route4 ='images/GC groups/yandere_route4.png'
    image yandere_route5 ='images/GC groups/yandere_route5.png'
    image yandere_route6 ='images/GC groups/yandere_route6.png'

init python:
    gallery_cg_items = ["accidental kiss", "Alex slip up", "Alexs flashback nR", 
        "Bleeding out day", "breasts", "Bunnys run", "BunnyxRichard", 
        "Rachel chase", "concrete loitering", "dramatic entrance", "eyes-yandere", 
        "KimvsVanessa", "sensual encounter", "Vanessa sleeping", "Vanessa falling", 
        "Vanessa rescue", "Vanessa_the_door", "Vanessa photo", "Guilt end", 
        "happy end", "logical end", "murderer end", "survivor-end", 
        "unknown end", "pervect end", "ct1", "waifu_route1", "yandere_route1"]
    #how many rows and columns in the gallery screens?
    gal_rows = 3
    gal_cols = 3
    #thumbnail size in pixels:
    thumbnail_x = 267
    thumbnail_y = 150
    #the setting above (267x150) will work well with 16:9 screen ratio. Make sure to adjust it, if your are using 4:3 or something else.
    #Galleries settings - end
    
    gal_cells = gal_rows * gal_cols    
    g_cg = Gallery()
    for gal_item in gallery_cg_items:
        g_cg.button(gal_item + " butt")
        g_cg.image(gal_item)
        g_cg.unlock(gal_item)
        if gal_item == "accidental kiss":
            g_cg.image("Yandere kiss2")
            g_cg.unlock("Yandere kiss2")
        if gal_item == "Alexs flashback nR":
            g_cg.image("Alexs flashback wR")
            g_cg.unlock("Alexs flashback wR")
        if gal_item == "Bleeding out day":
            g_cg.image("Richard stabbed rain")
            g_cg.unlock("Richard stabbed rain")
            g_cg.image("Richard stabbed fuzzy")
            g_cg.unlock("Richard stabbed fuzzy")
            g_cg.image("Richard stabbed light")
            g_cg.unlock("Richard stabbed light")
        if gal_item == "BunnyxRichard":
            g_cg.image("RichardxBunny")
            g_cg.unlock("RichardxBunny")
        if gal_item == "concrete loitering":
            g_cg.image("concrete loitering2")
            g_cg.unlock("concrete loitering2")
            g_cg.image("concrete loitering3")
            g_cg.unlock("concrete loitering3")
        if gal_item == "KimvsVanessa":
            g_cg.image("Vanessa vs Kim")
            g_cg.unlock("Vanessa vs Kim")
        if gal_item == "Vanessa sleeping":
            g_cg.image("Vanessa fondling")
            g_cg.unlock("Vanessa fondling")
        if gal_item == "Vanessa falling":
            g_cg.image("Vanessa falling light")
            g_cg.unlock("Vanessa falling light")
        if gal_item == "Vanessa photo":
            g_cg.image("Vanessa pantyshot")
            g_cg.unlock("Vanessa pantyshot")
            g_cg.image("Rachel pantyshot")
            g_cg.unlock("Rachel pantyshot")
        if gal_item == "murderer end":
            g_cg.image("pre-murderer")
            g_cg.unlock("pre-murderer")
            g_cg.image("Richard Guilt")
            g_cg.unlock("Richard Guilt")
        if gal_item == "waifu_route1":
            g_cg.image("waifu_route2")
            g_cg.unlock("waifu_route2")
            g_cg.image("waifu_route3")
            g_cg.unlock("waifu_route3")
            g_cg.image("waifu_route4")
            g_cg.unlock("waifu_route4")
            g_cg.image("waifu_route5")
            g_cg.unlock("waifu_route5")
        if gal_item == "yandere_route1":
            g_cg.image("yandere_route2")
            g_cg.unlock("yandere_route2")
            g_cg.image("yandere_route3")
            g_cg.unlock("yandere_route3")
            g_cg.image("yandere_route4")
            g_cg.unlock("yandere_route4")
            g_cg.image("yandere_route5")
            g_cg.unlock("yandere_route5")
            g_cg.image("yandere_route6")
            g_cg.unlock("yandere_route6")
    g_cg.transition = fade
    cg_page=0
    
init +1 python:
    #Here we create the thumbnails. We create a grayscale thumbnail image for BGs, but we use a special "locked" image for CGs to prevent spoilers.
    for gal_item in gallery_cg_items:
        g_cg.image("image", " butt")
        
screen cg_gallery:
    tag menu
    use navigation
    frame background None xpos 10:
        grid gal_rows gal_cols:
            ypos 10
            $ i = 0
            $ next_cg_page = cg_page + 1            
            if next_cg_page > int(len(gallery_cg_items)/gal_cells):
                $ next_cg_page = 0
            for gal_item in gallery_cg_items:
                $ i += 1
                if i <= (cg_page+1)*gal_cells and i>cg_page*gal_cells:
                    add g_cg.make_button(gal_item + " butt", gal_item + " butt", im.Scale("images/backgrounds/gallocked.png", thumbnail_x, thumbnail_y), xalign=0.5, yalign=0.5, idle_border=None, background=None, bottom_margin=24)
            for j in range(i, (cg_page+1)*gal_cells): #we need this to fully fill the grid
                null
        frame:
            yalign 0.97
            vbox:
                if len(gallery_cg_items)>gal_cells:
                    textbutton _("Next Page") action [SetVariable('cg_page', next_cg_page), ShowMenu("cg_gallery")]
ImageImageImage

Want some CC sprites?

User avatar
firecat
Miko-Class Veteran
Posts: 540
Joined: Sat Oct 25, 2014 6:20 pm
Completed: The Unknowns Saga series
Projects: The Unknown Saga series
Tumblr: bigattck
Deviantart: bigattck
Skype: bigattck firecat
Soundcloud: bigattck-firecat
Contact:

Re: My CG gallery isn't working?

#2 Post by firecat »

You added one space on each butt like this " butt", try "butt". if this doesn work then it could be a bug in renpy 6.99.11 involving the gui.
Image


Image


special thanks to nantoka.main.jp and iichan_lolbot

User avatar
Mammon
Miko-Class Veteran
Posts: 712
Joined: Sat Nov 07, 2015 3:09 pm
Completed: Pervert&Yandere, Stalker&Yandere
Projects: Roses Of The Thorn Prince
Contact:

Re: My CG gallery isn't working?

#3 Post by Mammon »

I tried it both with " butt" as it was in the original code I copied and "butt". I also tried replacing it with other terms like 'gallocked'. Doesn't work I'm afraid
ImageImageImage

Want some CC sprites?

Post Reply

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot], piinkpuddiin, snotwurm