Custom Name 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.
Message
Author
Sugar_and_rice
Newbie
Posts: 12
Joined: Tue Feb 21, 2017 2:57 pm
Contact:

Custom Name error

#1 Post by Sugar_and_rice »

I'm really frustrated. I've looked through forums, youtube, websites, tutorials, everything to find an answer but I have yet to find one. Whenever I try to type in code to let the player choose their own name, i always get this error: AttributeError 'StoreModule' object has no attribute 'dialogue_xalign'
I've copied and pasted other people's codes that work for them, but it still gives me that error. Here's an example of what I've typed in:

Code: Select all

# Declare characters used by this game.
define e = Character('Eileen', color="#c8ffc8")
define n = Character('[name]', color="#c8ffc8")

# The game starts here.
label start:

    $ name = renpy.input("What is your name?")
    $ name = name.strip()
    
    if name == "":
        $ name="You"
  
    "Pleased to meet you, [name]!"
    
    n "This is a test. You are talking."

    return
Please help :(

User avatar
SuperbowserX
Veteran
Posts: 270
Joined: Sat Jan 07, 2017 3:09 pm
Contact:

Re: Custom Name error

#2 Post by SuperbowserX »

Here's an idea for you. Try to define character "n" after your if statement but before the "pleased to meet you" line.

So do this:

$ n = Character("[name]", color="#c8ffc8")

Sugar_and_rice
Newbie
Posts: 12
Joined: Tue Feb 21, 2017 2:57 pm
Contact:

Re: Custom Name error

#3 Post by Sugar_and_rice »

thank you for the suggestion, but unfortunately it still didn't work :( I'm thinking something is wrong with the actual program... maybe I should try an re-install it?

User avatar
SuperbowserX
Veteran
Posts: 270
Joined: Sat Jan 07, 2017 3:09 pm
Contact:

Re: Custom Name error

#4 Post by SuperbowserX »

That's bizzare. Can you post the full traceback/error report?

Sugar_and_rice
Newbie
Posts: 12
Joined: Tue Feb 21, 2017 2:57 pm
Contact:

Re: Custom Name error

#5 Post by Sugar_and_rice »

here's the full thing:

I'm sorry, but an uncaught exception occurred.

While running game code:
File "game/script.rpy", line 8, in script
$ name = renpy.input("What is your name?")
File "game/script.rpy", line 8, in <module>
$ name = renpy.input("What is your name?")
File "game/screens.rpy", line 170, in execute
screen input(prompt):
File "game/screens.rpy", line 170, in execute
screen input(prompt):
File "game/screens.rpy", line 173, in execute
window:
File "game/screens.rpy", line 175, in execute
vbox:
File "game/screens.rpy", line 175, in keywords
vbox:
AttributeError: 'StoreModule' object has no attribute 'dialogue_xalign'

-- Full Traceback ------------------------------------------------------------

Full traceback:
File "game/script.rpy", line 8, in script
$ name = renpy.input("What is your name?")
File "C:\Users\Hannah\Downloads\renpy-6.99.12.3-sdk\renpy\ast.py", line 814, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "C:\Users\Hannah\Downloads\renpy-6.99.12.3-sdk\renpy\python.py", line 1715, in py_exec_bytecode
exec bytecode in globals, locals
File "game/script.rpy", line 8, in <module>
$ name = renpy.input("What is your name?")
File "C:\Users\Hannah\Downloads\renpy-6.99.12.3-sdk\renpy\exports.py", line 797, in input
rv = renpy.ui.interact(mouse='prompt', type="input", roll_forward=roll_forward)
File "C:\Users\Hannah\Downloads\renpy-6.99.12.3-sdk\renpy\ui.py", line 285, in interact
rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
File "C:\Users\Hannah\Downloads\renpy-6.99.12.3-sdk\renpy\display\core.py", line 2519, in interact
scene_lists.replace_transient()
File "C:\Users\Hannah\Downloads\renpy-6.99.12.3-sdk\renpy\display\core.py", line 822, in replace_transient
self.remove(layer, tag)
File "C:\Users\Hannah\Downloads\renpy-6.99.12.3-sdk\renpy\display\core.py", line 1107, in remove
self.hide_or_replace(layer, remove_index, "hide")
File "C:\Users\Hannah\Downloads\renpy-6.99.12.3-sdk\renpy\display\core.py", line 1031, in hide_or_replace
d = oldsle.displayable._hide(now - st, now - at, prefix)
File "C:\Users\Hannah\Downloads\renpy-6.99.12.3-sdk\renpy\display\screen.py", line 443, in _hide
self.update()
File "C:\Users\Hannah\Downloads\renpy-6.99.12.3-sdk\renpy\display\screen.py", line 578, in update
self.screen.function(**self.scope)
File "game/screens.rpy", line 170, in execute
screen input(prompt):
File "game/screens.rpy", line 170, in execute
screen input(prompt):
File "game/screens.rpy", line 173, in execute
window:
File "game/screens.rpy", line 175, in execute
vbox:
File "game/screens.rpy", line 175, in keywords
vbox:
File "<screen language>", line 177, in <module>
AttributeError: 'StoreModule' object has no attribute 'dialogue_xalign'

Windows-8-6.2.9200
Ren'Py 6.99.12.3.2123
test 1.0

User avatar
SuperbowserX
Veteran
Posts: 270
Joined: Sat Jan 07, 2017 3:09 pm
Contact:

Re: Custom Name error

#6 Post by SuperbowserX »

Have you changed any of your screens files (the ones that come with Ren'py)? Check their date modified value.

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

Re: Custom Name error

#7 Post by IrinaLazareva »

Yep. It is a bug. In GUI. In Only new version....
in 6.11 (and in 6.12.3 Legacy Theme) works fine.

Sugar_and_rice
Newbie
Posts: 12
Joined: Tue Feb 21, 2017 2:57 pm
Contact:

Re: Custom Name error

#8 Post by Sugar_and_rice »

oh it's a bug?? that sucks... is there any way I can download a 6.11? or should I just re-install the new version again?

User avatar
gas
Miko-Class Veteran
Posts: 842
Joined: Mon Jan 26, 2009 7:21 pm
Contact:

Re: Custom Name error

#9 Post by gas »

Aaaargh....

Cause the dynamic characters work like this:

define e=Character("name", dynamic=True)

Remove those [ ] stuff, you're not interpolating a text XD.
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.

10 ? "RENPY"
20 GOTO 10

RUN

Sugar_and_rice
Newbie
Posts: 12
Joined: Tue Feb 21, 2017 2:57 pm
Contact:

Re: Custom Name error

#10 Post by Sugar_and_rice »

I'm sorry I'm a little confused... so I just remove all the brackets? It still doesn't work :(

User avatar
gas
Miko-Class Veteran
Posts: 842
Joined: Mon Jan 26, 2009 7:21 pm
Contact:

Re: Custom Name error

#11 Post by gas »

It's impossible, I'm using the exact code in this very moment.

Try this

default name="Try"
define e=Character("name", dynamic=True)

I'm running a game the next window with this code.

And somewhere you've tried to define something as "dialogue_xalign"???
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.

10 ? "RENPY"
20 GOTO 10

RUN

Sugar_and_rice
Newbie
Posts: 12
Joined: Tue Feb 21, 2017 2:57 pm
Contact:

Re: Custom Name error

#12 Post by Sugar_and_rice »

so like this? or no brackets around the other name too?

Code: Select all

define e = Character("name", dynamic=True)

label start:

    $ name = renpy.input("What is your name?")
    $ name = name.strip()
    
    if name == "":
        $ name="You"
  
    "Pleased to meet you, [name]!"
    
    e "This is a test. You are talking."

    return
and I have no idea what it means when it says dialogue_xalign... i've never typed that anywhere...

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

Re: Custom Name error

#13 Post by IrinaLazareva »

gas wrote:It's impossible, I'm using the exact code in this very moment.
Problem in input, not Character

For example, this code doesn't work (only in GUI).

Code: Select all

default nam = "Vasya" 
label start:
    $ nam = renpy.input("Enter")
    "Ok [nam]"

AttributeError: 'StoreModule' object has no attribute 'dialogue_xalign'

Ren'py 6.99.12.3.2123

Sugar_and_rice
Newbie
Posts: 12
Joined: Tue Feb 21, 2017 2:57 pm
Contact:

Re: Custom Name error

#14 Post by Sugar_and_rice »

wait so it is a bug or am I typing something wrong? this is so confusing but thank you everyone who has helped me so far :)

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

Re: Custom Name error

#15 Post by IrinaLazareva »

Sugar_and_rice wrote:wait so it is a bug or am I typing something wrong? this is so confusing but thank you everyone who has helped me so far :)
Well, You can try Legacy Theme Interface (it is required to create new project).

Post Reply

Who is online

Users browsing this forum: Semrush [Bot]