[solved!]Coercing to Unicode Error when making gallery

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
neo-naughtager
Newbie
Posts: 4
Joined: Fri Jul 03, 2020 10:24 pm
Projects: Burn The Fence Down
itch: femboi-games
Contact:

[solved!]Coercing to Unicode Error when making gallery

#1 Post by neo-naughtager » Thu Jul 09, 2020 11:31 am

Hey, everyone! I've been fooling around with this tutorial: https://youtu.be/3EhdfEwhKXs (That's part 3, by the way.)
And it's been working fin up until I try and add navigation buttons, specifically the "next" button for some reason. I'm trying to use it when there is a set of images that are unlocked, to go back and forth between them.

The error I'm getting:

Code: Select all

 After initialization, but before game start.
  File "game/gallery.rpy", line 63, in prepare_screen
    screen gallerycloseup(images):
  File "game/gallery.rpy", line 63, in prepare
    screen gallerycloseup(images):
  File "game/gallery.rpy", line 74, in prepare
    if closeuppage < len(images) - 1:
  File "game/gallery.rpy", line 74, in prepare
    if closeuppage < len(images) - 1:
  File "game/gallery.rpy", line 75, in prepare
    textbutton _("Next"):
  File "game/gallery.rpy", line 75, in prepare
    textbutton _("Next"):
TypeError: coercing to Unicode: need string or buffer, int found
The piece of code I think it's yelling about:

Code: Select all

if closeuppage < len(images) - 1:
        textbutton _("Next"):
            action SetVariable("closeuppage" + 1)
            xalign 0.9
            yalign 0.97
            background "black"
Last edited by neo-naughtager on Thu Jul 09, 2020 12:01 pm, edited 1 time in total.

User avatar
neo-naughtager
Newbie
Posts: 4
Joined: Fri Jul 03, 2020 10:24 pm
Projects: Burn The Fence Down
itch: femboi-games
Contact:

Re: Coercing to Unicode Error when making gallery

#2 Post by neo-naughtager » Thu Jul 09, 2020 12:00 pm

Oop! I found out the issue.
I simply forgot a comma, and to name the variable
it should look like:

Code: Select all

action SetVariable("closeuppage", closeuppage + 1)

Post Reply

Who is online

Users browsing this forum: No registered users