Different Game Sections that can be chosen on title screen

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Post Reply
Message
Author
renpycoder
Newbie
Posts: 7
Joined: Fri Mar 09, 2018 12:58 am
Contact:

Different Game Sections that can be chosen on title screen

#1 Post 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!

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

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

#2 Post 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.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

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

#3 Post 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()
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

User avatar
xavimat
Eileen-Class Veteran
Posts: 1461
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Discord: xavimat
Contact:

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

#4 Post by xavimat »

Imperf3kt wrote: Sun Jul 22, 2018 1:12 pmNote: 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
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

User avatar
Saltome
Veteran
Posts: 244
Joined: Sun Oct 26, 2014 1:07 pm
Deviantart: saltome
Contact:

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

#5 Post 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.
Deviant Art: Image
Discord: saltome
Itch: Phoenix Start

Post Reply

Who is online

Users browsing this forum: AWizardWithWords