Page 1 of 1

I don't understand this error

Posted: Wed Sep 11, 2019 10:10 am
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

Re: I don't understand this error

Posted: Wed Sep 11, 2019 10:20 am
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

Re: I don't understand this error

Posted: Wed Sep 11, 2019 10:51 am
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.

Re: I don't understand this error

Posted: Sat Sep 14, 2019 12:07 pm
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

Re: I don't understand this error

Posted: Sat Sep 14, 2019 2:05 pm
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.

Re: I don't understand this error

Posted: Sat Sep 14, 2019 8:04 pm
by Donmai
While processing the color property of anonymous style:
I think I've already told you what's the problem.

Re: I don't understand this error

Posted: Sat Sep 14, 2019 10:07 pm
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.

Re: I don't understand this error

Posted: Mon Sep 16, 2019 2:40 pm
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.

Re: I don't understand this error

Posted: Mon Sep 16, 2019 3:25 pm
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. 

Re: I don't understand this error

Posted: Thu Sep 19, 2019 10:14 pm
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.

Re: I don't understand this error

Posted: Thu Sep 19, 2019 10:53 pm
by namastaii
There's nothing wrong with #FF0 though

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

Re: I don't understand this error

Posted: Fri Sep 20, 2019 10:36 am
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.