VPGRID PROBLEM

JOJO7777

Newbie
Sep 6, 2017
31
57
Hi guys,

I have a problem with this code and I can't solve it. I would like the empty cells to be filled by the "baglot style" box. Before I upgraded renpy to version 7.5 the game gave no error and automatically reduced the number of baglots to show (so as to avoid the vpgrid overfull error). I wonder if there is any code to write in "for i in range(______)" that would let renpy know that it should only fill empty ones with baglots.

Thanks for your help!

Code:
    vpgrid:
        cols 5
        rows 20
        xpos 961 ypos 338 spacing 8
        draggable True
        mousewheel False
        ysize 423
        yinitial 0
        scrollbars "vertical"
        side_spacing 20


        if d1_stats == True:
            imagebutton auto ("images/pict/d1_%s.png") selected_idle ("images/pict/d1_hover.png") focus_mask True action Show("d1_stats")
        if d2_stats == True:
            imagebutton auto ("images/pict/d2_%s.png") selected_idle ("images/pict/d2_hover.png") focus_mask True action Show(d2_stats")

        for i in range(100):
            frame:
                style "bagslot"
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,318
15,208
Before I upgraded renpy to version 7.5 the game gave no error and automatically reduced the number of baglots to show (so as to avoid the vpgrid overfull error).
It's because vpgrid changed:
Having an overfull vpgrid - when both rows and cols are specified - is now disallowed.

Having an underfull vpgrid now raises an error unless the warning is opted-out using either the allow_underfull property or , the former taking precedence on the latter.

A vpgrid with both cols and rows specified is underfull if and when it has less than rows * cols children. A vpgrid with either cols or rows specified is underfull if and when its number of children is not a multiple of the specified value.
Be noted that anyway there's also an error in your code:
Python:
    vpgrid:
        # 5 x 20 = 100 cells
        cols 5
        rows 20
        [...]

        # One optional cell
        if d1_stats == True:
            [...]
        # A second optional cell
        if d2_stats == True:
            [...]

        # 100 mandatory cells.
        for i in range(100):
            [...]
The two optional imagebutton have nothing to do in the vpgrid.

Your screen should looks like:
Python:
screen whatever():

    if d1_stats == True:
        imagebutton:
            xpos 100 ypos 100
            [...]
    if d2_stats == True:
        imagebutton:
            xpos 100 ypos 100
            [...]

    vpgrid:
        cols 5
        #rows 20
        [...]

        for i in range(100):
            [...]
 
  • Like
Reactions: osanaiko

JOJO7777

Newbie
Sep 6, 2017
31
57
It's because vpgrid changed:


Be noted that anyway there's also an error in your code:
Python:
    vpgrid:
        # 5 x 20 = 100 cells
        cols 5
        rows 20
        [...]

        # One optional cell
        if d1_stats == True:
            [...]
        # A second optional cell
        if d2_stats == True:
            [...]

        # 100 mandatory cells.
        for i in range(100):
            [...]
The two optional imagebutton have nothing to do in the vpgrid.

Your screen should looks like:
Python:
screen whatever():

    if d1_stats == True:
        imagebutton:
            xpos 100 ypos 100
            [...]
    if d2_stats == True:
        imagebutton:
            xpos 100 ypos 100
            [...]

    vpgrid:
        cols 5
        #rows 20
        [...]

        for i in range(100):
            [...]
Oh i didn't know about this change... i still managed to find a way around the problem.
Thanks for the info!
 
  • Like
Reactions: osanaiko