Page 1 of 1

Renpy 7.4 Exception: Properties are not allowed here. [Solved]

Posted: Thu Nov 05, 2020 5:59 am
by Exiscoming
Just downloaded v7.4 and when trying to launch my game I get:

Code: Select all

After initialization, but before game start.
  File "game/items.rpy", line 2856, in prepare_screen
    screen items:
Exception: Properties are not allowed here.
When I look in the code, it's just a normal screen with imagebuttons. Here's a snippet:

Code: Select all

screen items:
    add "gui/itemUI/items/itemsUI.png"
    
    # EXIT
    vbox xalign 0.01 yalign 0.012:
        imagebutton:
            idle "gui/itemUI/shop1/exit1.png"
            hover "gui/itemUI/shop1/exit1-hover.png"
            action Jump("worldmap")
            
    # Magazines
    if magazine >= 1:
        vbox xalign 0.070 yalign 0.52:
            imagebutton:
                idle "gui/itemUI/items/magazine.png"
                hover "gui/itemUI/items/magazine-hover.png"
                action Jump("inspMagazine")
        vbox xalign 0.165 yalign 0.60:
            if magazine >= 1:
                text "{color=#8d8d8d}[magazine]{/color}"
Is there something new in Renpy v7.4 that changes how imagebuttons work?

Re: Renpy 7.4 Exception: Properties are not allowed here.

Posted: Thu Nov 05, 2020 8:47 am
by Imperf3kt
I think the issue might be the final line

Code: Select all

{color=#8d8d8d}[magazine]{/color} 
You're using a text tag color property to style what should be styled using an actual style.

Re: Renpy 7.4 Exception: Properties are not allowed here.

Posted: Thu Nov 05, 2020 2:13 pm
by rayminator
you would have to change the image file names

instead of using exit1-hover use exit1_hover
instead of using magazine-hover use magazine_hover

Re: Renpy 7.4 Exception: Properties are not allowed here.

Posted: Fri Nov 06, 2020 11:08 am
by PyTom
I'm tentatively tracking this as a bug in 7.4. I'm not seeing anything obviously wrong with this.

https://github.com/renpy/renpy/issues/2450

Re: Renpy 7.4 Exception: Properties are not allowed here.

Posted: Mon Nov 09, 2020 1:41 am
by PyTom
I've been unable to repeat this, after copying the screen in question into a fresh project.

Re: Renpy 7.4 Exception: Properties are not allowed here. [Solved]

Posted: Wed Jan 27, 2021 2:17 pm
by Exiscoming
Sorry to necro this thread, but I found out what's causing the error message.
It was actually part of a different bit of code that I didn't link.
The error was here:

Code: Select all

    if itemsSelectButton == 3:
	modal True						# <- Conflict
        default x = renpy.get_mouse_pos()[0]
        default y = renpy.get_mouse_pos()[1]
        frame:
            pos (x + 20, y + 15)
            has vbox
            textbutton "View":                                        # View loot
                clicked SetVariable("itemsSelectButton", 0), Jump("sellLoot")
            textbutton "Inspect":                                    # Inspect loot
                clicked SetVariable("itemsSelectButton", 0), Jump("inspLoot")
            textbutton "Back":
                action SetVariable("itemsSelectButton", 0), Jump("items")
I copied some old code which had the modal True bit in there. Too be honest, I don't even really know what it's used for, but after deleting the code bit by bit and restoring it, I found out that this was causing the error. I haven't had anymore error messages since the fix.