Info Screen trouble

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
lovebby
Regular
Posts: 106
Joined: Mon Sep 09, 2013 12:24 am
Deviantart: lovebby
Contact:

Info Screen trouble

#1 Post by lovebby »

I seem to be having a lot of problems with this.
It's not with the info screen per se, but the code for one character.
Basically,

Code: Select all

$ a.description = "blah"
$ a.memo = "blah"
text text
$ allchars = [e, d,c, b, a,]

Code: Select all

 $ a = char(
        name="a", 
        race="Human",
        age="-",
        birthmonth="-",
        job="Cobbler",
        hobby="-",
        likes="-",
        dislikes="-",
        memo="something",
        description="something", 
        task = " ",
        dateable=False,
        pic="c/a/pro.png"
And it gives me :

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 1139, in script
  File "game/script.rpy", line 1139, in python
AttributeError: 'str' object has no attribute 'description'
the same when it gets to memo , and when I just use the "allchars" with "a" in there it gives me

While running game code:

Code: Select all

  File "renpy/common/00gamemenu.rpy", line 144, in script
  File "renpy/common/00gamemenu.rpy", line 144, in python
  File "game/CharProfiles.rpy", line 184, in python
AttributeError: 'str' object has no attribute 'name'
It only effects this character for whatever reason? All the other characters are just fine with this coding, but "a" messes up whenever I try to open the info screen with him on it.
It's stumped me for a while.
Last edited by lovebby on Tue Oct 15, 2013 4:07 pm, edited 1 time in total.

Elmiwisa
Veteran
Posts: 476
Joined: Sun Jul 21, 2013 8:08 am
Contact:

Re: Info Screen trouble

#2 Post by Elmiwisa »

Look at how you defined the variable a.
Make sure it did not get accidentally redefined.

User avatar
lovebby
Regular
Posts: 106
Joined: Mon Sep 09, 2013 12:24 am
Deviantart: lovebby
Contact:

Re: Info Screen trouble

#3 Post by lovebby »

Sadly that's not it, I've redid his definitions a few times, copy and pasted from working characters and just changed the info.

User avatar
jesusalva
Regular
Posts: 88
Joined: Mon Jul 22, 2013 5:05 pm
Organization: Software in Public Interest, Inc.
IRC Nick: jesusalva
Github: pazkero
itch: tmw2
Location: Brazil
Discord: Jesusalva#4449
Contact:

Re: Info Screen trouble

#4 Post by jesusalva »

I'm not an expert but...
are you sure that "a" IS a character, not a string?

I mean... ren'py is thinking that it is a text string. Are you sure that this IS NOT a text string?

just for curiosity... are you using "class a" or "a = Character()"?
Jesusaves/Jesusalva

User avatar
lovebby
Regular
Posts: 106
Joined: Mon Sep 09, 2013 12:24 am
Deviantart: lovebby
Contact:

Re: Info Screen trouble

#5 Post by lovebby »

Oh pft, I should had thrown his code up, aha.

Code: Select all

 $ a = char(
        name="a", 
        race="Human",
        age="-",
        birthmonth="-",
        job="Cobbler",
        hobby="-",
        likes="-",
        dislikes="-",
        memo="something",
        description="something", 
        task = " ",
        dateable=False,
        pic="c/a/pro.png"
So a character =.
Would it be better to try class?

Elmiwisa
Veteran
Posts: 476
Joined: Sun Jul 21, 2013 8:08 am
Contact:

Re: Info Screen trouble

#6 Post by Elmiwisa »

No, class a is going to be even worse. Your definition is correct (except for the missing parenthesis, but I assumed it's in your code and you simply did not copy it). Check to make sure you did not redefine it accidentally somewhere else.
For example, you might have done some thing like this:

Code: Select all

a.task="blah"
a="bah"   #<---a get redefined here!!!
a.memo="..."
To make it quicker to locate the problem, try adding this to right after label start and run the game to see what you get:

Code: Select all

$narrator(a)

User avatar
lovebby
Regular
Posts: 106
Joined: Mon Sep 09, 2013 12:24 am
Deviantart: lovebby
Contact:

Re: Info Screen trouble

#7 Post by lovebby »

AH yeah, I forgot the parenthesis aha.

I tried that and it didn't help at all, there was nothing extra redefining the character.

I took him a out completely to see if that would've done anything and the game ran perfectly, before and after he's scenes and after characters ran smoothly as well.
I'm thinking I might just have to recode his somehow?

Elmiwisa
Veteran
Posts: 476
Joined: Sun Jul 21, 2013 8:08 am
Contact:

Re: Info Screen trouble

#8 Post by Elmiwisa »

Have you try adding

Code: Select all

$narrator(a)
near the point where the bug happen to see what you get?

Post Reply

Who is online

Users browsing this forum: Bing [Bot]