Show modal screen while in a screen
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
-
- Newbie
- Posts: 11
- Joined: Sun Apr 03, 2022 8:04 pm
- Contact:
Show modal screen while in a screen
So here's what I'm trying to do. Players will reach a part where a screen is called. It's basically a background picture of a computer screen with some imagebuttons and other items strategically placed.
I have a boolean variable that is default to False. When the above screen is called I want the variable to be checked and if it is still False, I want to display a modal screen over the screen above that requires player input. The input will set the above variable to True and set another value as well. So basically, this is a runonce scenario.
It seems you can't automatically call another screen without some sort of button. Is this possible?
I'm also open to other suggestions to achieve the result of first time player sees this screen, it will still be visible, but with a modal open to obtain input. Player submits change, necessary variables are changed and the modal closes.
TIA
I have a boolean variable that is default to False. When the above screen is called I want the variable to be checked and if it is still False, I want to display a modal screen over the screen above that requires player input. The input will set the above variable to True and set another value as well. So basically, this is a runonce scenario.
It seems you can't automatically call another screen without some sort of button. Is this possible?
I'm also open to other suggestions to achieve the result of first time player sees this screen, it will still be visible, but with a modal open to obtain input. Player submits change, necessary variables are changed and the modal closes.
TIA
-
- Newbie
- Posts: 11
- Joined: Sun Apr 03, 2022 8:04 pm
- Contact:
Re: Show modal screen while in a screen
I think I may have solved it. In the first screen, I can do this:
The entry_screen appears over the other screen as expected. Not sure if this is the best solution, so will still accept others if provided.
Code: Select all
if not name_set:
use entry_screen
-
- Newbie
- Posts: 11
- Joined: Sun Apr 03, 2022 8:04 pm
- Contact:
Re: Show modal screen while in a screen
Ok, that won't work. By using "use entry_screen", calling the Hide("entry_screen") action doesn't seem to work.
-
- Miko-Class Veteran
- Posts: 793
- Joined: Fri Feb 09, 2018 12:05 am
- Location: Canada
- Contact:
Re: Show modal screen while in a screen
you have to do something else hide won't by using use screen_name
you want to do this
pass is for so renpy won't show a error
when ever you want to hide it you use a textbutton or $ want_to_see_this_screen = False
you want to do this
pass is for so renpy won't show a error
Code: Select all
default want_to_see_this_screen = True or False
if want_to_see_this_screen == True:
if not name_set:
use entry_screen
else:
pass
-
- Newbie
- Posts: 11
- Joined: Sun Apr 03, 2022 8:04 pm
- Contact:
Re: Show modal screen while in a screen
With use entry_screen, I noticed that the imagebuttons on the first screen are interactable under the modal. Doing some more research, it doesn't seem to be the way to go. I tested by having that modal open up through an imagebutton action and it worked as expected.
Now, if I can only find a way to open that second screen automatically if name_set == False.
Now, if I can only find a way to open that second screen automatically if name_set == False.
-
- Newbie
- Posts: 11
- Joined: Sun Apr 03, 2022 8:04 pm
- Contact:
Re: Show modal screen while in a screen
Perhaps I'm going at this wrong. Maybe I could just do something like this:
Code: Select all
if not name_set:
window:
style "entry_window"
text prompt
input id "entry"
-
- Newbie
- Posts: 11
- Joined: Sun Apr 03, 2022 8:04 pm
- Contact:
Re: Show modal screen while in a screen
The solution thanks to jDD on discord:
and someone else just showed me a different way, which I like better:
Code: Select all
screenA():
if not name_set:
timer .1 action Show("ScreenB")
and someone else just showed me a different way, which I like better:
Code: Select all
screenA():
on 'show' action If(name_set is False, Show("ScreenB"), NullAction())
Who is online
Users browsing this forum: Google [Bot], Majestic-12 [Bot]