Page 1 of 1

[BUG] multilevel use/transclude

Posted: Sun Sep 12, 2021 12:58 am
by drKlauz
Got hit by weird bug, using rather complex screen with multiple levels of use/transclude, below is simplified example.
Adding $pass to certain place fixes it.
Tested on 7.4.6 and 11-sep nightly.

Code: Select all

## how to replicate: open "Help" screen, click left "Increase" button, see variable not changing

screen box2():
  vbox:
    align (0.25,0.5)
#    $pass
    transclude

screen box1():
  use box2:
    transclude

screen box2x():
  vbox:
    align (0.75,0.5)
    $pass
    transclude

screen box1x():
  use box2x:
    transclude

screen help():
  tag menu
  default some_var=1
  default some_varx=9001
  use box1:
    vbox:
      text "BUGGED: [some_var]"
      textbutton "Increase" action SetScreenVariable("some_var",some_var+1)
  use box1x:
    vbox:
      text "WORKING: [some_varx]"
      textbutton "Increase" action SetScreenVariable("some_varx",some_varx+1)
  textbutton "Return":
    action Return()
    keysym "game_menu"

label start:
  "test"
  return
P.S.: While at this, is there any chance of allowing recursive screens? For example complex layout where some parts may contain similar sublayouts, using recursive approach it would require single screen.

Re: [BUG] multilevel use/transclude

Posted: Sun Sep 12, 2021 11:13 am
by PyTom
There is no chance of allowing recursive screens, as doing so would create loops that would prevent Ren'Py from coming up with a defined order in which it could analyze screens.

I'm tracking this as https://github.com/renpy/renpy/issues/3034 , at least until I figure out what's going on.

Re: [BUG] multilevel use/transclude

Posted: Sun Sep 12, 2021 1:27 pm
by drKlauz
Make sense.
Thanks.