Page 1 of 1

Different Game Sections that can be chosen on title screen

Posted: Sun Jul 22, 2018 10:06 am
by renpycoder
Has anyone ever delved with making different script.py for each game section? Here's my question in full.

When you go to the title screen, you are only presented ONE new game, right? The ones that goes to script.py right after selecting it. I was wondering if there is a way you can make different new game options and change each option to script2.py, script3.py so that way, you can categorize the routes or story sections you really want.

Or is this even possible in Renpy?

Thanks in advance!

Re: Different Game Sections that can be chosen on title screen

Posted: Sun Jul 22, 2018 11:11 am
by Per K Grok
renpycoder wrote:
Sun Jul 22, 2018 10:06 am
Has anyone ever delved with making different script.py for each game section? Here's my question in full.

When you go to the title screen, you are only presented ONE new game, right? The ones that goes to script.py right after selecting it. I was wondering if there is a way you can make different new game options and change each option to script2.py, script3.py so that way, you can categorize the routes or story sections you really want.

Or is this even possible in Renpy?

Thanks in advance!
The game I'm working on now I'm splitting up in different scripts. This is only for me to be able to orient between different parts of the script with less problem. As far as I understand it does not matter for the game itself if the script is in one document or in a number of documents.

The game will not start with script.rpy. It will, as - I understand it - start with gui, screens and options before the main page can be shown. From the start button on the main page the game will go looking for 'label start' in whatever script it is placed.

One thing you easily could do is to show a screen directly after 'label start' with buttons that can make the game jump to the different places in your script - marked with labels - that are options you want to give the player. The game will find the label even if it is in a different document.

I'm not sure if this covers what you want to do.

Re: Different Game Sections that can be chosen on title screen

Posted: Sun Jul 22, 2018 1:12 pm
by Imperf3kt
You can name your files whatever you want (except a few small exceptions such as anything starting with 00)

What you should do, to achieve what you want is use labels and start action.
example:

Code: Select all

screen crappy_screen():
    textbutton "start story one" action start("story1")
    textbutton "start story two" action start("story2")
    textbutton "start story three" action start("story3")
Then you simply need the labels "story1", "story2" and "story3". It doesn't matter where you put them, and its perfectly fine to put each in its own file. Just make sure they have a return at the end of them:

Code: Select all

label story1:
    "This story sucks."
    "Don't blame me, its 3AM."

    return
Note: I can't remember if it is start() or Start()

Re: Different Game Sections that can be chosen on title screen

Posted: Sun Jul 22, 2018 1:27 pm
by xavimat
Imperf3kt wrote:
Sun Jul 22, 2018 1:12 pm
Note: I can't remember if it is start() or Start()
Actions are always capitalized, so Start()
https://www.renpy.org/doc/html/screen_a ... html#Start

Re: Different Game Sections that can be chosen on title screen

Posted: Mon Jul 23, 2018 3:37 pm
by Saltome
And if you want to make those changes to the title screen itself you have to find the main_menu screen in the screens.py file, to add the suggested lines.