[SOLVED] Weird issue with Ren'Py

Winterfire

Forum Fanatic
Respected User
Game Developer
Sep 27, 2018
5,046
7,393
Hello,
I would like to rebuild the style just once, however, it seems once I type "style.rebuild()" the game will begin rebuilding the style over and over, no matter where I put it.

I have tried adding it in various places to test it out, for example:
Python:
    if main_menu:
        key "game_menu":
            action [ShowMenu("main_menu"), style.rebuild()]
which should happen only once I press"Escape"

or

Python:
bar value FieldValue(..., action=style.rebuild())
which should happen only once I change the value on the slider, yet I do not even need to access the preferences screen (where the slider is) for the style.rebuild to begin executing.

I even tried to put it as an action in a button with again the same result, is this a ren'py bug or is typing "style.rebuild" anywhere is supposed to execute it from the start of the game, over and over? I am using 7.3.4
 

the66

beware, the germans are cumming
Modder
Donor
Respected User
Jan 27, 2017
7,669
23,789
use style.rebuild and not style.rebuild().
the action property expects Action class inherits or functions w/o arguments or a list of both types as arguments. you use the function result as argument.
 

Winterfire

Forum Fanatic
Respected User
Game Developer
Sep 27, 2018
5,046
7,393
Oh wow, this solved the issue. Thank you a lot!

It was still a pretty weird behavior... I would have expected an error rather than it executing everywhere.
 
  • Like
Reactions: the66