In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
-
Kia
- Eileen-Class Veteran
- Posts: 1008
- Joined: Fri Aug 01, 2014 7:49 am
- Deviantart: KiaAzad
- Discord: Kia#6810
-
Contact:
#1
Post
by Kia » Thu Jan 03, 2019 3:04 am
I've found this gives me and error:
Code: Select all
screen nested_test:
use nested_in
screen nested_in:
default ylg = 1.0
button:
action ToggleScreenVariable("ylg", 0.0, 1.0)
yalign ylg
text "jump"
label start:
show screen nested_test
pause
return
here's the error:
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/script.rpy", line 13, in script
pause
File "renpy/common/000statements.rpy", line 416, in execute_pause
renpy.pause()
File "renpy/common/00action_data.rpy", line 356, in __call__
value = cs.scope[self.name]
KeyError: u'ylg'
it doesn't happen when the screen is called directly or when I'm using "SetScreenVariable" instead
Last edited by
Kia on Sun Jan 13, 2019 7:59 am, edited 1 time in total.
-
PyTom
- Ren'Py Creator
- Posts: 15893
- 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:
#2
Post
by PyTom » Sat Jan 12, 2019 5:07 pm
Checkout ToggleLocalVariable and SetLocalVariable if you want to access variables in nested screens. (These are slower than their ScreenVariable equivalents.)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama •
https://www.patreon.com/renpytom
-
Kia
- Eileen-Class Veteran
- Posts: 1008
- Joined: Fri Aug 01, 2014 7:49 am
- Deviantart: KiaAzad
- Discord: Kia#6810
-
Contact:
#3
Post
by Kia » Sun Jan 13, 2019 8:01 am
I can't believe the solution was in front of my eyes the whole time, I need to pay attention to the changes.
thank you ^_^
Users browsing this forum: No registered users