Gallery images not unlocking all seen images[Solved!]

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
DreadfulEnchanted
Newbie
Posts: 23
Joined: Tue Nov 05, 2019 8:27 pm
Projects: Slippery Kiss
Deviantart: dreadfulenchanted
Contact:

Gallery images not unlocking all seen images[Solved!]

#1 Post by DreadfulEnchanted »

Hello!
I'm having some issues with my gallery not unlocking all seen images. The code used is below. All the images are displayed exactly the same as in the quotes. As seen here https://i.imgur.com/ahGdnES.png(6th down, sorry for my confusing image names). The first few unlock perfectly, but numbers 6-10 won't unlock even after being seen for some reason. The 11th one also unlocks fine, so it's very confusing.
If I change them to g.image instead of g.unlock the images display in the gallery without a hitch, so I can't figure out what the issue is. I can just do that as a last resort, but I'd prefer to have them unlock when seen if anyone can help me. Let me know if there's any other code I should post!

Code: Select all

init python:
    g = Gallery()
    

Code: Select all

    g.button('cg5')
    g.unlock_image('bl_cr2_cg1 pt1')
    g.unlock_image('bl_cr2_cg1 pt12 m_pout')
    g.unlock_image('bl_cr2_cg1 pt9 b_sad e_f m_lipb')
    g.unlock_image('bl_cr2_cg1 pt11 b_sad e_h m_sad')
    g.unlock_image('bl_cr2_cg1 pt4 e_f m_smile b_neutral')
    g.unlock_image('bl_cr2_cg1 pt7 m_smile b_neutral e_f')
    g.unlock_image('bl_cr2_cg1 pt6 e_f b_sad m_pout')
    g.unlock_image('bl_cr2_cg1 pt8 m_smile e_f b_neutral')
    g.unlock_image('bl_cr2_cg1 pt12 e_h blush shiver m_lipb')
    g.unlock_image('bl_cr2_cg1 pt12 closed_b b_sad m_lick blush')
    g.unlock_image('bl_cr2_cg1 pt7 closed_b b_sad m_lipb blush')
Last edited by DreadfulEnchanted on Wed Oct 25, 2023 3:49 pm, edited 1 time in total.

User avatar
thelastsecret
Regular
Posts: 124
Joined: Tue Mar 01, 2022 1:32 pm
Completed: The Last Secret
Projects: Sweet Science – The Girls from Silversee Castle
itch: thelastsecret
Discord: TheLastSecret #5266
Contact:

Re: Gallery images not unlocking all seen images

#2 Post by thelastsecret »

Difficult to tell what goes wrong, but I have made the experience that it is working better if I define the images first. Something like:
image book big = "bg/book big.png"
Maybe that could solve the problem? At least since I do this, it works fine with me.
However, one thing I do differently is to use this for marking images as seen:
$renpy.mark_image_seen("book big")
For me it's a bit confusing what is going on exactly, but I hope these ideas can help to solve your issue.

DreadfulEnchanted
Newbie
Posts: 23
Joined: Tue Nov 05, 2019 8:27 pm
Projects: Slippery Kiss
Deviantart: dreadfulenchanted
Contact:

Re: Gallery images not unlocking all seen images

#3 Post by DreadfulEnchanted »

Ah! Thank you so much!!
$renpy.mark_image_seen("book big") is exactly what I needed. Im new at coding and none of the other images needed it so I had no idea. It worked perfectly! Thank you again!

Post Reply

Who is online

Users browsing this forum: bilmem, Bing [Bot]