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

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: 1299
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life, Coffea Beans
Github: namastaii
Skype: Discord: lunalucid#7684
Soundcloud: deadseed
itch: lunalucid
Location: USA
Contact:

Re: I don't understand this error

#2 Post by namastaii » 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

User avatar
Donmai
Eileen-Class Veteran
Posts: 1853
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
Projects: Slumberland
Location: Brazil
Contact:

Re: I don't understand this error

#3 Post by Donmai » Wed Sep 11, 2019 10:51 am

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

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
Regular
Posts: 159
Joined: Sun May 29, 2016 4:38 pm
Contact:

Re: I don't understand this error

#5 Post by rames44 » 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.

User avatar
Donmai
Eileen-Class Veteran
Posts: 1853
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
Projects: Slumberland
Location: Brazil
Contact:

Re: I don't understand this error

#6 Post by Donmai » Sat Sep 14, 2019 8:04 pm

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: 707
Joined: Mon Jan 07, 2019 2:55 am
Projects: Maddox's Everyday Talk! (13+ Unreal version), Maddox Everyday Talk! (3+ Real-Friendly version)(Upcoming 2020)
Organization: Friendly Teachers series
itch: .......
Location: Philippines, Mindanao
Contact:

Re: I don't understand this error

#7 Post by isobellesophia » Sat Sep 14, 2019 10:07 pm

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..


Working on a talking simulation game for everyone, except children.

Maddox Everyday Talk!
Is my very very main project, not contain 13 below.

Main project here viewtopic.php?f=43&t=56564
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 » Mon Sep 16, 2019 2:40 pm

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: 1299
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life, Coffea Beans
Github: namastaii
Skype: Discord: lunalucid#7684
Soundcloud: deadseed
itch: lunalucid
Location: USA
Contact:

Re: I don't understand this error

#9 Post by namastaii » Mon Sep 16, 2019 3:25 pm

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: 707
Joined: Mon Jan 07, 2019 2:55 am
Projects: Maddox's Everyday Talk! (13+ Unreal version), Maddox Everyday Talk! (3+ Real-Friendly version)(Upcoming 2020)
Organization: Friendly Teachers series
itch: .......
Location: Philippines, Mindanao
Contact:

Re: I don't understand this error

#10 Post by isobellesophia » Thu Sep 19, 2019 10:14 pm

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..


Working on a talking simulation game for everyone, except children.

Maddox Everyday Talk!
Is my very very main project, not contain 13 below.

Main project here viewtopic.php?f=43&t=56564
Image

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

Re: I don't understand this error

#11 Post by namastaii » Thu Sep 19, 2019 10:53 pm

There's nothing wrong with #FF0 though

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

User avatar
Donmai
Eileen-Class Veteran
Posts: 1853
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
Projects: Slumberland
Location: Brazil
Contact:

Re: I don't understand this error

#12 Post by Donmai » Fri Sep 20, 2019 10:36 am

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: amekoi