[SOLVED] Premade gallery broken with switch to Ren'Py 8.0+

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
veravee__
Newbie
Posts: 4
Joined: Tue Sep 13, 2022 5:34 pm
itch: veravee
Contact:

[SOLVED] Premade gallery broken with switch to Ren'Py 8.0+

#1 Post by veravee__ » Tue Sep 13, 2022 5:41 pm

I'm using a premade GUI kit from NovelKit - I already posted a question on their itch.io page, but thought I'd cross-post here since their last reply to a comment there was almost a year ago.

While I was working in Ren'Py 7.4.6, the gallery was functioning just fine. However, when I switched to Ren'Py 8.0.2 in order to utilize other plugins, it seems to have broken the functionality. Attempting to launch the gallery or music player results in a crash with traceback. I'm attaching the traceback here, as well as the gallery code. I cannot switch back to an earlier version of Ren'Py, as the other plugins are entirely essential to the game.

It looks like the Rounded GUI kit utilized Leon's code from this forum as a base, but I'm not proficient enough to understand exactly what's wrong with the syntax or how to fix it. Any help here would be appreciated! Thank you in advance. 🙇‍♀️
Attachments
gallery.rpy
(4.92 KiB) Downloaded 3 times
gallery-traceback.txt
(5.09 KiB) Downloaded 3 times
Last edited by veravee__ on Tue Sep 13, 2022 8:08 pm, edited 1 time in total.

User avatar
laure44
Regular
Posts: 60
Joined: Mon Mar 08, 2021 10:55 pm
Projects: Arkan'sTower, Gemshine Lorelei!
Location: France
Contact:

Re: Premade gallery broken with switch to Ren'Py 8.0+

#2 Post by laure44 » Tue Sep 13, 2022 7:11 pm

Code: Select all

for num in range(pages):
Your variable 'pages' is probably a float, hence the error. Make sure it is an integer first. Or if needed, you can convert it to an integer like this:

Code: Select all

init python:
    import math

    math.floor(pages) # rounds down
    math.ceil(pages) # rounds up

    # OR

    int(pages) # is also an option but less predictable, does not need the import math line

veravee__
Newbie
Posts: 4
Joined: Tue Sep 13, 2022 5:34 pm
itch: veravee
Contact:

Re: Premade gallery broken with switch to Ren'Py 8.0+

#3 Post by veravee__ » Tue Sep 13, 2022 8:08 pm

That fixed it! I tried the int(pages) option, and that did the trick. Thank you for the help!

Post Reply

Who is online

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