Grid overfull? (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
User avatar
Hijiri
Eileen-Class Veteran
Posts: 1516
Joined: Sun Mar 25, 2012 6:35 pm
Completed: Death Rule:lost code Overdrive Edition, Where the White Doves Rest-Tsumihanseishi
Projects: Death Rule: Killing System
Organization: MESI Games
IRC Nick: Hizi
Tumblr: mesigames
Skype: kurotezuka
itch: hijiri
Location: Los Angeles
Contact:

Grid overfull? (SOLVED)

#1 Post by Hijiri » Fri Aug 22, 2014 10:53 pm

Well, I'm making my CG gallery, adn I keep getting this error:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
Exception: Grid overfull.

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

Full traceback:
  File "renpy/common/_layout/screen_main_menu.rpym", line 29, in script
    $ ui.interact()
  File "C:\Users\Mojica\Downloads\renpy-6.15.0-sdk\renpy\ast.py", line 756, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "C:\Users\Mojica\Downloads\renpy-6.15.0-sdk\renpy\python.py", line 1382, in py_exec_bytecode
    exec bytecode in globals, locals
  File "renpy/common/_layout/screen_main_menu.rpym", line 29, in <module>
    $ ui.interact()
  File "C:\Users\Mojica\Downloads\renpy-6.15.0-sdk\renpy\ui.py", line 264, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "C:\Users\Mojica\Downloads\renpy-6.15.0-sdk\renpy\display\core.py", line 2065, in interact
    repeat, rv = self.interact_core(preloads=preloads, **kwargs)
  File "C:\Users\Mojica\Downloads\renpy-6.15.0-sdk\renpy\display\core.py", line 2390, in interact_core
    self.draw_screen(root_widget, fullscreen_video, (not fullscreen_video) or video_frame_drawn)
  File "C:\Users\Mojica\Downloads\renpy-6.15.0-sdk\renpy\display\core.py", line 1591, in draw_screen
    renpy.config.screen_height,
  File "render.pyx", line 362, in renpy.display.render.render_screen (gen\renpy.display.render.c:5303)
  File "render.pyx", line 166, in renpy.display.render.render (gen\renpy.display.render.c:2494)
  File "C:\Users\Mojica\Downloads\renpy-6.15.0-sdk\renpy\display\layout.py", line 549, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 95, in renpy.display.render.render (gen\renpy.display.render.c:2767)
  File "render.pyx", line 166, in renpy.display.render.render (gen\renpy.display.render.c:2494)
  File "C:\Users\Mojica\Downloads\renpy-6.15.0-sdk\renpy\display\transition.py", line 362, in render
    top = render(self.new_widget, width, height, st, at)
  File "render.pyx", line 95, in renpy.display.render.render (gen\renpy.display.render.c:2767)
  File "render.pyx", line 166, in renpy.display.render.render (gen\renpy.display.render.c:2494)
  File "C:\Users\Mojica\Downloads\renpy-6.15.0-sdk\renpy\display\layout.py", line 549, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 95, in renpy.display.render.render (gen\renpy.display.render.c:2767)
  File "render.pyx", line 166, in renpy.display.render.render (gen\renpy.display.render.c:2494)
  File "C:\Users\Mojica\Downloads\renpy-6.15.0-sdk\renpy\display\layout.py", line 549, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 95, in renpy.display.render.render (gen\renpy.display.render.c:2767)
  File "render.pyx", line 166, in renpy.display.render.render (gen\renpy.display.render.c:2494)
  File "C:\Users\Mojica\Downloads\renpy-6.15.0-sdk\renpy\display\screen.py", line 321, in render
    child = renpy.display.render.render(self.child, w, h, st, at)
  File "render.pyx", line 95, in renpy.display.render.render (gen\renpy.display.render.c:2767)
  File "render.pyx", line 166, in renpy.display.render.render (gen\renpy.display.render.c:2494)
  File "C:\Users\Mojica\Downloads\renpy-6.15.0-sdk\renpy\display\layout.py", line 549, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 95, in renpy.display.render.render (gen\renpy.display.render.c:2767)
  File "render.pyx", line 166, in renpy.display.render.render (gen\renpy.display.render.c:2494)
  File "C:\Users\Mojica\Downloads\renpy-6.15.0-sdk\renpy\display\layout.py", line 354, in render
    raise Exception("Grid overfull.")
Exception: Grid overfull.

Windows-7-6.1.7601-SP1
Ren'Py 6.17.7.521
Death Rule:lost_code 0.9
And here's that grid:

Code: Select all

screen gallery:

    # Ensure this replaces the main menu.
    tag menu

    # The background.
    imagemap:
        ground "cg_ground.png"
        hover "cg_hover.png"
        alpha False
        
        hotspot (131, 539, 203, 25) action ShowMenu('gallery1')
        hotspot (412, 539, 203, 25) action ShowMenu('gallery2')
        hotspot (692, 539, 203, 25) action ShowMenu('extras')

    # A grid of buttons.
    grid 3 5:

        # Call make_button to show a particular button.
        add g.make_button("1", "cg/1.png", xalign=0.5, yalign=0.5)
        add g.make_button("2", "cg/2.png", xalign=0.5, yalign=0.5)
        add g.make_button("3", "cg/3.png", xalign=0.5, yalign=0.5)
        add g.make_button("4", "cg/4.png", xalign=0.5, yalign=0.5)
        add g.make_button("5", "cg/5.png", xalign=0.5, yalign=0.5)
        add g.make_button("6", "cg/6.png", xalign=0.5, yalign=0.5)
        add g.make_button("7", "cg/7.png", xalign=0.5, yalign=0.5)
        add g.make_button("8", "cg/8.png", xalign=0.5, yalign=0.5)
        add g.make_button("9", "cg/9.png", xalign=0.5, yalign=0.5)
        add g.make_button("10", "cg/10.png", xalign=0.5, yalign=0.5)
        add g.make_button("11", "cg/11.png", xalign=0.5, yalign=0.5)
        add g.make_button("12", "cg/12.png", xalign=0.5, yalign=0.5)
        add g.make_button("13", "cg/13.png", xalign=0.5, yalign=0.5)
        add g.make_button("14", "cg/14.png", xalign=0.5, yalign=0.5)
        add g.make_button("15", "cg/15.png", xalign=0.5, yalign=0.5)
Will I have to put their positions in manually?
Last edited by Hijiri on Sun Aug 24, 2014 1:07 am, edited 1 time in total.
Image Image
"Perfection goal that always changes. Can pursue, cannot obtain."

User avatar
Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: Grid overfull?

#2 Post by Asceai » Sat Aug 23, 2014 6:02 am

You sure the code ends there?

User avatar
Hijiri
Eileen-Class Veteran
Posts: 1516
Joined: Sun Mar 25, 2012 6:35 pm
Completed: Death Rule:lost code Overdrive Edition, Where the White Doves Rest-Tsumihanseishi
Projects: Death Rule: Killing System
Organization: MESI Games
IRC Nick: Hizi
Tumblr: mesigames
Skype: kurotezuka
itch: hijiri
Location: Los Angeles
Contact:

Re: Grid overfull?

#3 Post by Hijiri » Sat Aug 23, 2014 4:44 pm

Yep:
Image
Image Image
"Perfection goal that always changes. Can pursue, cannot obtain."

User avatar
Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: Grid overfull?

#4 Post by Asceai » Sat Aug 23, 2014 9:37 pm

This is utterly mystifying as that exception is only raised if the number of children to the grid displayable is greater than the rows * columns of the grid displayable, which is not the case here. So I have no clue; your code is clearly infected with demons and you'll have to flush them out.

1) Try removing the grid and all the buttons in it entirely. Confirm that it makes the error disappear.
2) Try commenting out individual 'add g.make_button' lines until the error disappears / changes to "Grid not completely full." to work out what Ren'Py thinks are the dimensions of the grid.

That's all I've got, sorry.

User avatar
Hijiri
Eileen-Class Veteran
Posts: 1516
Joined: Sun Mar 25, 2012 6:35 pm
Completed: Death Rule:lost code Overdrive Edition, Where the White Doves Rest-Tsumihanseishi
Projects: Death Rule: Killing System
Organization: MESI Games
IRC Nick: Hizi
Tumblr: mesigames
Skype: kurotezuka
itch: hijiri
Location: Los Angeles
Contact:

Re: Grid overfull?

#5 Post by Hijiri » Sat Aug 23, 2014 10:21 pm

IDK if you'll believe me, but it started to spontaneously start working for some reason after I commented out one line and put it back in.
Now my only question is: how do I put some space between them?
Image Image
"Perfection goal that always changes. Can pursue, cannot obtain."

User avatar
Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: Grid overfull?

#6 Post by Asceai » Sun Aug 24, 2014 12:11 am

the 'spacing' style property.

Unfortunately you can't set differing x and y spacings with this, so if you want that you'll have to use a vbox of hboxes or something similar.

User avatar
Hijiri
Eileen-Class Veteran
Posts: 1516
Joined: Sun Mar 25, 2012 6:35 pm
Completed: Death Rule:lost code Overdrive Edition, Where the White Doves Rest-Tsumihanseishi
Projects: Death Rule: Killing System
Organization: MESI Games
IRC Nick: Hizi
Tumblr: mesigames
Skype: kurotezuka
itch: hijiri
Location: Los Angeles
Contact:

Re: Grid overfull?

#7 Post by Hijiri » Sun Aug 24, 2014 12:42 am

Ok, got that down. Now the only real issue I'm having is the hover border. ANy way to position that?

Nevermind, figured it out. Thanks for the help!
Image Image
"Perfection goal that always changes. Can pursue, cannot obtain."

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Imperf3kt