I don't understand this error

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
Lucy081
Newbie
Posts: 3
Joined: Tue Sep 10, 2019 12:59 pm
Contact:

I don't understand this error

#1 Post by Lucy081 »

I was writing some dialogue and I wrote the phrase "¡Eso espero! ¡Gracias!" ("I hope so! Thank you!" in Spanish). When I launched the game, this appeared:

File "game/script.rpy", line 33, in script
S "¡Eso espero! ¡Gracias"
ValueError: invalid literal for int() with base 16: 'gr'


What does it mean? I don't know how to fix it

User avatar
namastaii
Eileen-Class Veteran
Posts: 1350
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: I don't understand this error

#2 Post by namastaii »

I believe there is something else in your script creating this error. Could you show me the code before and after that line? Sometimes, the error will show a line of code close to the actual error

User avatar
Donmai
Eileen-Class Veteran
Posts: 1958
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: I don't understand this error

#3 Post by Donmai »

Check any hexadecimal strings in your scripts (like color RGB values) for typing errors.
That's usually what the "invalid literal for int() with base 16" error points to.
Usually, you will get an "invalid literal for int() with base 16:'#'" message.
'gr' is a novelty to me.
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

Lucy081
Newbie
Posts: 3
Joined: Tue Sep 10, 2019 12:59 pm
Contact:

Re: I don't understand this error

#4 Post by Lucy081 »

namastaii wrote: Wed Sep 11, 2019 10:20 am I believe there is something else in your script creating this error. Could you show me the code before and after that line? Sometimes, the error will show a line of code close to the actual error
Before what I wrote, it says:

While processing the color property of anonymous style:

And after what I wrote it shows the full traceback

rames44
Veteran
Posts: 233
Joined: Sun May 29, 2016 4:38 pm
Contact:

Re: I don't understand this error

#5 Post by rames44 »

When asking for the code before and after, it was not meant from the error screen, it was meant from your script. Sometimes the line number reported as causing the error isn’t really the line that caused the error - it could be something just before or after. So, if you can give us a bit more of your script, it might help.

User avatar
Donmai
Eileen-Class Veteran
Posts: 1958
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: I don't understand this error

#6 Post by Donmai »

While processing the color property of anonymous style:
I think I've already told you what's the problem.
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

User avatar
isobellesophia
Miko-Class Veteran
Posts: 979
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao
Contact:

Re: I don't understand this error

#7 Post by isobellesophia »

Show us the code a bit and the traceback about it, its kinda more confusing to understand the error you've been encountering.
I am a friendly user, please respect and have a good day.


Image

Image


Lucy081
Newbie
Posts: 3
Joined: Tue Sep 10, 2019 12:59 pm
Contact:

Re: I don't understand this error

#8 Post by Lucy081 »

rames44 wrote: Sat Sep 14, 2019 2:05 pm When asking for the code before and after, it was not meant from the error screen, it was meant from your script. Sometimes the line number reported as causing the error isn’t really the line that caused the error - it could be something just before or after. So, if you can give us a bit more of your script, it might help.
Well, that line is the last line of a choice. I mean, three lines before that I used the "menu" code (for making choices), and it's the first time I use it, so maybe that's part of the problem. And after that, I started another label for the menu.

User avatar
namastaii
Eileen-Class Veteran
Posts: 1350
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: I don't understand this error

#9 Post by namastaii »

You need to actually copy and paste your code because we can't see what's going on. If you tell us what you did, that doesn't really help because it could be a syntax error, etc. It'll be something you aren't catching that we can but we can't do anything without seeing the exact code. When asking for help, you'd normally copy and paste your code in a post between the code brackets

Code: Select all

Your code will be displayed like this so we can review how the error occurred. 

User avatar
isobellesophia
Miko-Class Veteran
Posts: 979
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao
Contact:

Re: I don't understand this error

#10 Post by isobellesophia »

I think it is related to the color hex error, maybe you tried putting this..

Code: Select all

#FF0
instead of this

Code: Select all

#FF0000
which is likely got this error for somebody.
I am a friendly user, please respect and have a good day.


Image

Image


User avatar
namastaii
Eileen-Class Veteran
Posts: 1350
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: I don't understand this error

#11 Post by namastaii »

There's nothing wrong with #FF0 though

It's more likely they typed ## instead of one #

User avatar
Donmai
Eileen-Class Veteran
Posts: 1958
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: I don't understand this error

#12 Post by Donmai »

As I said (maybe not very clearly, I admit) before. The error "invalid literal for int() with base 16" in Ren'Py generally points to a color value wrongly typed. Ren'Py recognizes RGB hex values ("#fff" or "#ffffff") or RGBA (A for Alpha or transparency value) hex values ("#ffffff7f").
If you type, say "#fffff" that will give you an "invalid literal for int() with base 16" error message.
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]