[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: 7
Joined: Fri Jul 03, 2020 10:24 pm
Tumblr: neonaughtager
itch: naughtager
Discord: neonaughtager
Contact:

[solved!]Coercing to Unicode Error when making gallery

#1 Post by neo-naughtager »

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: 7
Joined: Fri Jul 03, 2020 10:24 pm
Tumblr: neonaughtager
itch: naughtager
Discord: neonaughtager
Contact:

Re: Coercing to Unicode Error when making gallery

#2 Post by neo-naughtager »

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: Amazon [Bot]