Keyword argument 'xalign' is incompatible with 'xpos'

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
mtermik
Regular
Posts: 28
Joined: Fri Dec 23, 2022 2:26 pm
Contact:

Keyword argument 'xalign' is incompatible with 'xpos'

#1 Post by mtermik »

I recently started to receive a random compile error on one of my projects. None of the other projects I have reports this error, despite using the exact same code, and I cannot for the life of me tell what is causing the error. I have tried clearing persistent, but the error prevents that, as it prevents forcing a recompile. The only information I am given is keyword argument 'xalign' is incompatible with 'xpos' in regards to the following code:

Code: Select all

if tt:
        text "{size=15}{color=#ffffff}[tt]{/color}{/size}":
            xpos 657
            ypos 624
            xalign 0.5
            yalign 0.5
            xsize 288
            anchor (0.0, 0.0)
I am loath to create another project, and try to move the code over, as there is a ton of work inside of this one. Anyone have ideas?

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2434
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Keyword argument 'xalign' is incompatible with 'xpos'

#2 Post by Ocelot »

It is literally what it says:

*align is a *pos and *anchor bundled together and cannot be used together with either one, that would be the same as providing xpos twice. It was always that way, but recently was promoted from undefined behavior (results wary epending on how particular transform was defined) to hard error.

Choose what you want to use, pos+anchor or align and use only that.
< < insert Rick Cook quote here > >

mtermik
Regular
Posts: 28
Joined: Fri Dec 23, 2022 2:26 pm
Contact:

Re: Keyword argument 'xalign' is incompatible with 'xpos'

#3 Post by mtermik »

Ocelot wrote: Sat Nov 11, 2023 4:13 am It is literally what it says:

*align is a *pos and *anchor bundled together and cannot be used together with either one, that would be the same as providing xpos twice. It was always that way, but recently was promoted from undefined behavior (results wary epending on how particular transform was defined) to hard error.

Choose what you want to use, pos+anchor or align and use only that.
If it wasn't for the fact that 5 other projects use the same code without error, then your answer would make sense. But since I have the same exact code running without problem in other projects "It is literally what it says" means absolutely nothing. Either this project has an issue that I cannot detect or I have 5 projects running code that by all rights shouldn't be able to function.

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2434
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Keyword argument 'xalign' is incompatible with 'xpos'

#4 Post by Ocelot »

Possibiities are:
1) RenPy on those projects is not updated to the latest version.
2) That code wasn't run yet. Simply having it in your script does not guarantee that it iwll be executed in compile time. Make sure you actually trigger offending ATL to see if it would crash in runtime.

Other than that I do not know what answer do you seek.
Is official documentation mentioning that conflicting properties now result in an error enough? Here is another excerpt from changelog highlighting that xalign and xpos do, in fact, conflict.
< < insert Rick Cook quote here > >

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Keyword argument 'xalign' is incompatible with 'xpos'

#5 Post by PyTom »

This is a fairly new check. The other projects likely have a subtle bug in them - not only do xpos and xalign conflict, but the way the two properties conflict varies from computer to computer, so it will work on some computers and not others.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
m_from_space
Eileen-Class Veteran
Posts: 1030
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: Keyword argument 'xalign' is incompatible with 'xpos'

#6 Post by m_from_space »

mtermik wrote: Sat Nov 11, 2023 4:16 am

Code: Select all

            xpos 657
            ypos 624
            xalign 0.5
            yalign 0.5
            xsize 288
            anchor (0.0, 0.0)
I just want to add, that you're not only trying to set two different positions (xpos 657 and xpos 0.5 of parent width / same for ypos), but also try to anchor it at different anchors (xanchor 0.5 and xanchor 0.0 by setting anchor / same for yanchor). You're trying to violate the Pauli exclusion principle. ;)

Post Reply

Who is online

Users browsing this forum: Semrush [Bot], Toma