weird Character/Lint error[solved]

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
Scribbles
Miko-Class Veteran
Posts: 636
Joined: Wed Sep 21, 2016 4:15 pm
Completed: Pinewood Island, As We Know It
Projects: In Blood
Organization: Jaime Scribbles Games
Deviantart: breakfastdoodles
itch: scribbles
Location: Ohio
Contact:

weird Character/Lint error[solved]

#1 Post by Scribbles »

So I'm getting a weird error when I run Lint. I do not get an error within the game though and everything is running as expected so I'm not sure why it's acting this way?

Code: Select all

game/ch01.rpy:27 Could not evaluate 'lucy' in the who part of a say statement.
Perhaps you forgot to define a character?
I've defined the characters:

Code: Select all

default lucy = Character("Lucy")
default sam = Character("Sam")
default axel = Character("Axel")
and within the game their names pop up when they're supposed to so I'm not sure why Lint is going crazy flagging them all? Is this a weird bug or should I define the characters vs using default? (I like to check Lint to look at my word count as I write which is why I'm running it.)
Last edited by Scribbles on Wed Jul 19, 2017 9:43 am, edited 1 time in total.
Image - Image -Image

User avatar
Milkymalk
Miko-Class Veteran
Posts: 753
Joined: Wed Nov 23, 2011 5:30 pm
Completed: Don't Look (AGS game)
Projects: KANPEKI! ★Perfect Play★
Organization: Crappy White Wings
Location: Germany
Contact:

Re: weird Character/Lint error

#2 Post by Milkymalk »

Did you by chance use "lucy" as a variable name somewhere else? Maybe as an image?
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)

User avatar
Scribbles
Miko-Class Veteran
Posts: 636
Joined: Wed Sep 21, 2016 4:15 pm
Completed: Pinewood Island, As We Know It
Projects: In Blood
Organization: Jaime Scribbles Games
Deviantart: breakfastdoodles
itch: scribbles
Location: Ohio
Contact:

Re: weird Character/Lint error

#3 Post by Scribbles »

Milkymalk wrote:Did you by chance use "lucy" as a variable name somewhere else? Maybe as an image?
I did, but when I changed it to

Code: Select all

default l = Character("Lucy")
I still get the same error (just this time is says l isn't defined....?
Image - Image -Image

User avatar
IrinaLazareva
Veteran
Posts: 399
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy
Organization: SunShI
Location: St.Petersburg, Russia
Contact:

Re: weird Character/Lint error

#4 Post by IrinaLazareva »

default lucy = Character("Lucy")

Code: Select all

define lucy = Character("Lucy")
https://www.renpy.org/doc/html/dialogue ... er-objects

User avatar
Scribbles
Miko-Class Veteran
Posts: 636
Joined: Wed Sep 21, 2016 4:15 pm
Completed: Pinewood Island, As We Know It
Projects: In Blood
Organization: Jaime Scribbles Games
Deviantart: breakfastdoodles
itch: scribbles
Location: Ohio
Contact:

Re: weird Character/Lint error

#5 Post by Scribbles »

IrinaLazareva wrote:default lucy = Character("Lucy")

Code: Select all

define lucy = Character("Lucy")
https://www.renpy.org/doc/html/dialogue ... er-objects
I am aware of using define, I just thought it was supposed to be inferior to default? Is that only for other variables maybe? It's strange that it isn't crashing the game, and it's still using the name tags in the textbox but pops up in lint... *sigh* I will never get the hang of coding
Image - Image -Image

User avatar
IrinaLazareva
Veteran
Posts: 399
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy
Organization: SunShI
Location: St.Petersburg, Russia
Contact:

Re: weird Character/Lint error

#6 Post by IrinaLazareva »

about difference between define and default (and init):
https://www.renpy.org/doc/html/python.h ... -statement

User avatar
Milkymalk
Miko-Class Veteran
Posts: 753
Joined: Wed Nov 23, 2011 5:30 pm
Completed: Don't Look (AGS game)
Projects: KANPEKI! ★Perfect Play★
Organization: Crappy White Wings
Location: Germany
Contact:

Re: weird Character/Lint error[solved]

#7 Post by Milkymalk »

I can't really see why one works and the other one doesn't, at least not from that description alone.

"define" sets a variable at init time.

"default" sets a variable when the game starts.

Both happens before any "say" statements.
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)

User avatar
Scribbles
Miko-Class Veteran
Posts: 636
Joined: Wed Sep 21, 2016 4:15 pm
Completed: Pinewood Island, As We Know It
Projects: In Blood
Organization: Jaime Scribbles Games
Deviantart: breakfastdoodles
itch: scribbles
Location: Ohio
Contact:

Re: weird Character/Lint error[solved]

#8 Post by Scribbles »

Milkymalk wrote:I can't really see why one works and the other one doesn't, at least not from that description alone.

"define" sets a variable at init time.

"default" sets a variable when the game starts.

Both happens before any "say" statements.
I'm not sure either, but using define did stop the lint error, maybe it's a specific issue with lint (since the game ran fine and it still picked up on the names)
Image - Image -Image

User avatar
IrinaLazareva
Veteran
Posts: 399
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy
Organization: SunShI
Location: St.Petersburg, Russia
Contact:

Re: weird Character/Lint error[solved]

#9 Post by IrinaLazareva »

Character() is one of oldest functions of Ren'py. I suspect, it is constructed on the elements, working at a init stage only... Perhaps..

User avatar
Milkymalk
Miko-Class Veteran
Posts: 753
Joined: Wed Nov 23, 2011 5:30 pm
Completed: Don't Look (AGS game)
Projects: KANPEKI! ★Perfect Play★
Organization: Crappy White Wings
Location: Germany
Contact:

Re: weird Character/Lint error[solved]

#10 Post by Milkymalk »

That might be the reson. The "config" variables can also only be changed during init.
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Amazon [Bot], Google [Bot]