strange behavior of a button in 8.1.0

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Post Reply
Message
Author
User avatar
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

strange behavior of a button in 8.1.0

#1 Post by Alex »

Hi, folks!
Got a strange behavior of a button in 8.1.0 is it bug or feature?

Tried to put an action, sensitive and background properties for a button under if/else condition, but got an error

Code: Select all

I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


File "game/script.rpy", line 104: a non-constant keyword argument like 'background empty_tile' is not allowed after a python block.
    background empty_tile
                         ^

Ren'Py Version: Ren'Py 8.1.0.23051307
Sat Jun 17 01:00:34 2023

Code: Select all

button:
    action Function(...)

    if value == 0:
        background empty_tile
It also throws the same error even if those properties placed after any python block inside a button, like

Code: Select all

button:
    background tile
    if value == 0:
        $ value = ""
    action Function(...)
    sensitive can_click

Code: Select all

I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


File "game/script.rpy", line 116: a non-constant keyword argument like 'action Function(...)' is not allowed after a python block.
    action Function(...)
                                          ^

Ren'Py Version: Ren'Py 8.1.0.23051307
Sat Jun 17 01:14:50 2023

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: strange behavior of a button in 8.1.0

#2 Post by PyTom »

It's a feature, as the properties are evaluated before the block would be.
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
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: strange behavior of a button in 8.1.0

#3 Post by Alex »

PyTom wrote: Fri Jun 23, 2023 5:45 pm It's a feature, as the properties are evaluated before the block would be.
Um, ok then, thank you...))

Post Reply

Who is online

Users browsing this forum: No registered users