[Solved] Story/chapter selection - Very confused please help
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.
- Ocelot
- Lemma-Class Veteran
- Posts: 2400
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
- Contact:
Re: [Solved] Story/chapter selection - Very confused please
Mostly it is because you are still in menu context, renpy thinks that you are still in main menu and might behave accordingly. I have run into strange issues, like one branch repeating twice when selected (and second run did not reinicialize variables, so I was left in broken state), inability to open game menu screen, crashes when loading in specific places. (I do not know how much is caused by not starting game properly, and how much was caused by jumping from call screen statement: it can cause problems too)
On the other hand it worked seamlessly in some cases. I do not know what happens behind the scenes, but I would be really careful with that.
On the other hand it worked seamlessly in some cases. I do not know what happens behind the scenes, but I would be really careful with that.
< < insert Rick Cook quote here > >
- Ocelot
- Lemma-Class Veteran
- Posts: 2400
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
- Contact:
Re: [Solved] Story/chapter selection - Very confused please
I personally would set a flag, showing what screen you want to display in main menu:
Code: Select all
define persistent.show_ch_select = False # Not nessesary, actually
label splascreen:
# We want each launch start with actual main menu
$ persistent.show_ch_select = False
return
# Obviously, you need to actually make it reachable from main_menu screen too
screen chapter_select():
tag menu # for interoperability with other menus
use navigation # For all kinds of pretty buttons
vbox:
textbutton '---ch1---':
# Before starting new chapter, we set marker telling that we need to return to the chapter selection screen
action [SetField(persistent, 'ch_select', True), Start('ch1')]
# Clearing selected state
selected False
textbutton '---ch2---' action [SetField(persistent, 'ch_select', True), Start('ch2')] selected False
label main_menu:
# Check if we need to display chapter select screen.
if persistent.show_ch_select:
$ persistent.show_ch_select = False
call screen chapter_select
else:
call screen main_menu
return
label ch1:
'chapter 1'
return
label ch2:
'chapter 2'
return
< < insert Rick Cook quote here > >
Re: [Solved] Story/chapter selection - Very confused please
Ocelot, that indeed seems like a way more legit approach.
Circumventing the internal programmings of RenPy by pulling tricks causes problems. The first problem I run into is the title music. Since the title screen is triggered with a call statement within the splash screen the music doesn't play the first time you visit the title screen; it does play the second time around. There are ways to fix this, but they're fixes to problems that shouldn't exist in the first place.
I am implementing your method as we speak Ocelot. I shall post how the results differ.
Circumventing the internal programmings of RenPy by pulling tricks causes problems. The first problem I run into is the title music. Since the title screen is triggered with a call statement within the splash screen the music doesn't play the first time you visit the title screen; it does play the second time around. There are ways to fix this, but they're fixes to problems that shouldn't exist in the first place.
I am implementing your method as we speak Ocelot. I shall post how the results differ.
Re: [Solved] Story/chapter selection - Very confused please
I followed your method to the letter Ocelot, and the application now largely functions in a correct manner.
However, the user ends up back at the title screen (main_menu) again after each story.
I've tried flipping False to True and switching around the screens, which leads me to believe this bit of code here seems to work fine:I wonder where it exactly goes wrong. "define persistent.show_ch_select = False" is present in the script. The screen actions are written as follows:Trying to figure it out as we speak.
Thanks for your help and valuable insights Ocelot.
However, the user ends up back at the title screen (main_menu) again after each story.
I've tried flipping False to True and switching around the screens, which leads me to believe this bit of code here seems to work fine:
Code: Select all
label main_menu:
if persistent.show_ch_select:
$ persistent.show_ch_select = False
call screen chapter
else:
call screen main_menu
return
Code: Select all
imagebutton idle "gui/chapter_button.png" xpos 24 ypos 24 action [SetField(persistent, 'ch_select', True), Start('ch1')] selected False
Thanks for your help and valuable insights Ocelot.
Re: [Solved] Story/chapter selection - Very confused please
Got it!
What finally works is:
Some of what was False had to be True :-p
What finally works is:
Code: Select all
define persistent.show_ch_select = True
label splashscreen:
$ persistent.show_ch_select = True
scene white
with Pause(0.5)
show splash at Position(xpos = 0.5, xanchor=0.5, ypos=0.5, yanchor=0.5) with dissolve
with Pause(2.5)
scene white with dissolve
with Pause(1)
return
label main_menu:
if persistent.show_ch_select:
$ persistent.show_ch_select = False
call screen main_menu
else:
call screen chapter
return
Last edited by SethRiley on Sun Mar 19, 2017 9:32 pm, edited 1 time in total.
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3791
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: [Solved] Story/chapter selection - Very confused please
Won't that lable name will cause headaches? Since it will conflict with renpy internal files.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Re: [Solved] Story/chapter selection - Very confused please
Hi Imperf3kt. What label name exactly? ch1?
-
- Newbie
- Posts: 5
- Joined: Thu Sep 06, 2018 7:52 am
- Contact:
Have a selection screen without jumping
Hi Guys...
I have the exact same question here as this thread started on.. the only diff to my question is this..
Instead of going to the story that was chosen in the "chapter screen" and reading the story to then later return to this screen to choose a different story.. instead of this i would like to have a "chapter screen" aswell with many different storys but the player should be able to "pre-select" all the stories he is interested in reading and then without renpy jumping to the first one there should be a button that says something like start here.. renpy then starts the first choice and cycles through to the next choice chosen and finaly when all the stories that were chosen at this first screen then only the game ends?
This is a huge roadblock for me i really hope this would be possible maybe with some python code?
Please please please tell me it is possible!!
I have the exact same question here as this thread started on.. the only diff to my question is this..
Instead of going to the story that was chosen in the "chapter screen" and reading the story to then later return to this screen to choose a different story.. instead of this i would like to have a "chapter screen" aswell with many different storys but the player should be able to "pre-select" all the stories he is interested in reading and then without renpy jumping to the first one there should be a button that says something like start here.. renpy then starts the first choice and cycles through to the next choice chosen and finaly when all the stories that were chosen at this first screen then only the game ends?
This is a huge roadblock for me i really hope this would be possible maybe with some python code?
Please please please tell me it is possible!!
-
- Newbie
- Posts: 5
- Joined: Thu Sep 06, 2018 7:52 am
- Contact:
Re: [Solved] Story/chapter selection - Very confused please help
Sorry i saw this is a duplicate
Last edited by Ravenheart on Tue Sep 11, 2018 8:57 am, edited 1 time in total.
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3791
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: [Solved] Story/chapter selection - Very confused please help
You can do that, I beleive.
I haven't got the time to try an example right now, but I assume you can use lists and variables to determine what label to jump to.
Perhaps someone more skilled than myself already has such a thing or can easily make one?
I haven't got the time to try an example right now, but I assume you can use lists and variables to determine what label to jump to.
Perhaps someone more skilled than myself already has such a thing or can easily make one?
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
-
- Newbie
- Posts: 5
- Joined: Thu Sep 06, 2018 7:52 am
- Contact:
Re: [Solved] Story/chapter selection - Very confused please help
Hi there☺
Thanks for the quick response!
I would so much appreciate any help or direction and hopefully if you can when you have some time show me an example perhaps i will jump with joy on the inside!!!!!
Regards
Who is online
Users browsing this forum: No registered users