Label Gallery not found

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
Morhighan
Miko-Class Veteran
Posts: 975
Joined: Sun Jun 27, 2010 12:54 pm
Completed: AIdol, When Our Journey Ends, Forgotten Not Lost
Organization: MysteryCorgi
Tumblr: MysteryCorgi
Deviantart: MysteryCorgi
Soundcloud: MysteryCorgi
itch: MysteryCorgi
Location: USA
Contact:

Label Gallery not found

#1 Post by Morhighan »

Hey there. So, it's been a while since I used Ren'Py and the new updates have thrown me, since the language seems to have gotten more sophisticated. Not that I mind the challenge.
My problem is that I can't seem to find what I'm looking for in the "documentation" part of the Ren'Py website, so I'm using the older methods that I find in various tutorials and wiki pages.
Anyway, the actual problem at hand is:

I'm trying to make a gallery. So I put in the new_gallery.rpy file and started to customize an imagemap for the main menu.
I have two problems:
My goal is to have the gallery appear once the story has been finished. However, the option is being shown on the menu before I trigger the unlock option, so I think I must have made a mistake somewhere.
The second issue is that once I click on the gallery button, I get this error:

Code: Select all

While running game code:
ScriptError: could not find label 'Gallery'.

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "C:\Users\Morgana\Documents\renpy-6.13.7\renpy\bootstrap.py", line 276, in bootstrap
  File "C:\Users\Morgana\Documents\renpy-6.13.7\renpy\main.py", line 354, in main
  File "C:\Users\Morgana\Documents\renpy-6.13.7\renpy\main.py", line 95, in run
  File "C:\Users\Morgana\Documents\renpy-6.13.7\renpy\execution.py", line 275, in run
  File "C:\Users\Morgana\Documents\renpy-6.13.7\renpy\script.py", line 485, in lookup
ScriptError: could not find label 'Gallery'.

Here's what I have as far as programming related to these issues:

Code: Select all

    #Gallery
label gallery:
    python hide:
        g = Gallery()
    
        g.transition = dissolve
        g.background = "#000000"
     
        g.grid_layout((3, 4), (10, 12), (160, 124))
    
        g.button("thumb_regret.png")
        g.display("regret.png")
    
        g.show()
    
    return

Code: Select all

    # Main Menu imagemap
init -2 python:
    
    layout.imagemap_main_menu(
        "titlemenubuttonsground.png",
        "titlemenubuttonshover.png",
        [ (90, 150, 310, 205, "Start Game"),
          (90, 220, 315, 270, "Load Game"), 
          (90, 290, 285, 340, "Preferences"),
          (90, 360, 225, 405, "Quit") ],
        variant = 'locked'
        )
    
    layout.imagemap_main_menu(
        "titlemenubuttonsgroundunlocked.png",
        "titlemenubuttonshoverunlocked.png" ,
        [
            (90, 150, 310, 205, "Start Game"),
            (90, 220, 315, 270, "Load Game"),
            (90, 290, 285, 340, "Preferences"),
            (90, 80, 250, 130, "Gallery"),
            (90, 360, 225, 405, "Quit"),
            ],
        variant = 'unlocked'
        )

label main_menu:

    if persistent.extra_unlocked:
        $ _main_menu_variant = 'unlocked'
    else:
        $ _main_menu_variant = 'locked'

    jump main_menu_screen
And at the end of the story, I have this to unlock the menu:

Code: Select all

    $ renpy.pause(2.0)


    
    $ persistent.extra_unlocked = 'unlocked'
    
    return
Even if I take that out, the gallery option still shows.

Help?

Thank you!

tuna_sushi
Veteran
Posts: 299
Joined: Thu Jul 07, 2011 9:33 am
Projects: BloomingBlossoms
Contact:

Re: Label Gallery not found

#2 Post by tuna_sushi »

I can only solve the second issue.

It said that it couldn't find 'Gallery'.
I see that the label is 'gallery' with a small 'G'.

If you write

Code: Select all

jump Gallery
or something like that, change it into:

Code: Select all

jump gallery
Hope I help :)

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Label Gallery not found

#3 Post by nyaatrap »

I don't know anything about layout things because I only know renpy 6.13, but the problem may be this line.

Code: Select all

$ persistent.extra_unlocked = 'unlocked'
Change it to

Code: Select all

$ persistent.extra_unlocked = True
[edit]if it couldn't solve the issue, then perhaps the following line is needed. (noticed you're using init -2)

Code: Select all

init -3 python:
     if persistent.extra_unlocked:
        _main_menu_variant = 'unlocked'
     else:
        _main_menu_variant = 'locked'

User avatar
Morhighan
Miko-Class Veteran
Posts: 975
Joined: Sun Jun 27, 2010 12:54 pm
Completed: AIdol, When Our Journey Ends, Forgotten Not Lost
Organization: MysteryCorgi
Tumblr: MysteryCorgi
Deviantart: MysteryCorgi
Soundcloud: MysteryCorgi
itch: MysteryCorgi
Location: USA
Contact:

Re: Label Gallery not found

#4 Post by Morhighan »

Thank you! I'm still having trouble with the imagemap, but I'm sure I'll be able to resolve it somehow. (Though, if anyone could help me, that'd be great.)

Anyway, I did what Tuna_Sushi suggested and it seems to have helped.
But of course, since nothing's too easy, apparently there's another error!

Code: Select all

While running game code:
  File "game/options.rpy", line 270, in script
        python hide:
  File "game/options.rpy", line 278, in python
            g.button("thumb_regret.png")
  File "game/new_gallery.rpy", line 186, in python
                self.page_.button.append(self.button_)
AttributeError: 'NoneType' object has no attribute 'button'

Post Reply

Who is online

Users browsing this forum: No registered users