Splitting plotline into chapters - anyone know how to do it?

A place to discuss things that aren't specific to any one creator or game.
Forum rules
Ren'Py specific questions should be posted in the Ren'Py Questions and Annoucements forum, not here.
Post Reply
Message
Author
Black Anise

Splitting plotline into chapters - anyone know how to do it?

#1 Post by Black Anise »

I'm sure most people here remember Higurashi no Naku Koro ni, which split the story up into various 'chapters', the next of which could only be accessed after playing through the previous. What I'm after for my game is a similar principle.

The plot follows a teacher getting to know each of the students in his (very small) class; what I have planned is to have one chapter focusing on his relationship with each of them, with every subsequent chapter building the plot and his understanding of the class as a whole off of his experience in the previous chapter. It's somewhat crucial to the storyline not to skip around too much, so I don't want every chapter to appear in the 'chapter selection menu' (or however one selects the chapters) right off the bat.

However, I'm a total newbie and I don't even know how to split the thing into chapters in the first place. -.-U

If anyone could give me advice, links to examples, examples of code - anything, I would be eternally grateful. Thank you in advance! :)

User avatar
DaFool
Lemma-Class Veteran
Posts: 4171
Joined: Tue Aug 01, 2006 12:39 pm
Contact:

Re: Splitting plotline into chapters - anyone know how to do it?

#2 Post by DaFool »

You must decide whether to:

1.) Release each chapter as a standalone game, with subsequent chapters requiring a savefile from a previous one.

OR

2a.) Release several chapters in one game, with the chapter selection directly from the main menu

OR

2b.) Chapter selection from a submenu.

-----------------------

You can start your game off with something like this:

Code: Select all

$ prologue_complete = False
$ chapter1_complete = False
$ chapter2_complete = False
$ chapter3_complete = False
Then later on in the game you can have something like this:

Code: Select all

    $ chapter2_complete = True
#end of chapter 2

#-------Chapter 3-----------------
label chapter3:
    if not chapter3_complete:
        "I'm sorry, you need to read previous chapters first."
        return
    else:
        "Hi, let's continue with our story, shall we?"
    #.....
using method 2b.) is easy, since you can use if/else to jump to labels (chapter2, chapter3, etc.)

using method 2a.), refer to this:

http://www.renpy.org/wiki/renpy/doc/ref ... Game_Menus

and where it says 'True', you can substitute it with a boolean such as chapter2_complete, for example, you can add the line:

Code: Select all

(u"Chapter 2", "chapter2", "chapter2_complete"),
Please note it's been a while since I've done these things, and some coding implementations have been changed, so my syntax may not be exact.

chronoluminaire
Eileen-Class Veteran
Posts: 1153
Joined: Mon Jul 07, 2003 4:57 pm
Completed: Elven Relations, Cloud Fairy, When I Rule The World
Tumblr: alextfish
Skype: alextfish
Location: Cambridge, UK
Contact:

Re: Splitting plotline into chapters - anyone know how to do it?

#3 Post by chronoluminaire »

You might like to take a look at the kinetic novel Dream Chasers by lordcloudx. That has four chapters and an epilogue: you can player chapters 1 & 2 in either order IIRC, but chapter 3 is only unlocked once you've read both of them, 4 only when you've read 1, 2 and 3, and the epilogue only once you've finished 4. lordcloudx may be able to supply the code to do it.
I released 3 VNs, many moons ago: Elven Relations (IntRenAiMo 2007), When I Rule The World (NaNoRenO 2005), and Cloud Fairy (the Cute Light & Fluffy Project, 2009).
More recently I designed the board game Steam Works (published in 2015), available from a local gaming store near you!

User avatar
PyTom
Ren'Py Creator
Posts: 16096
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:

Re: Splitting plotline into chapters - anyone know how to do it?

#4 Post by PyTom »

Note that you almost certainly want to use persistent variables, and not reset them to False at the start of every new game. So you'd want to do something like:

Code: Select all

init python:
    config.main_menu.pop(0)
    config.main_menu.insert(("Chapter 1", _intra_jumps("chapter_1", "main_game_transition"), "True"))
    config.main_menu.insert(("Chapter 2", _intra_jumps("chapter_2", "main_game_transition"), "persistent.chapter_1_complete"))
    config.main_menu.insert(("Chapter 3", _intra_jumps("chapter_3", "main_game_transition"), "persistent.chapter_2_complete"))
At the end of chapter 1, you'd have:

Code: Select all

    "This is the last line of chapter 1." 
 
    $ persistent.chapter_1_complete = True

label chapter_2:

    scene this
    show that

    "This is the first line of chapter 2."
and similarly for chapter 3.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

BlackAnise
Newbie
Posts: 2
Joined: Fri Jul 11, 2008 1:01 am
Projects: Ganbatte!Sensei
Contact:

Re: Splitting plotline into chapters - anyone know how to do it?

#5 Post by BlackAnise »

Thanks very much, everyone! I still can't quite get it to run properly, but your advice was all quite helpful; I've gotten the code underway, at least, so I'm sure I'll be able to work it all out soon. ^_^

Thanks again! I really appreciate your responses.

kraken
Newbie
Posts: 23
Joined: Tue Oct 23, 2007 7:41 am
Contact:

Re: Splitting plotline into chapters - anyone know how to do it?

#6 Post by kraken »

I want to add an epilogue which is only unlocked when the player have played each segment of the chapter, including the bad ending.

How can I do a variable like this, please?

Verity
Regular
Posts: 67
Joined: Wed Jul 30, 2008 11:43 am
Projects: Wanderer
Location: USA
Contact:

Re: Splitting plotline into chapters - anyone know how to do it?

#7 Post by Verity »

kraken wrote:I want to add an epilogue which is only unlocked when the player have played each segment of the chapter, including the bad ending.

How can I do a variable like this, please?
I think what you'd want to do there is set a variable for the end of each of them, and then... okay, something kinda like this?

Code: Select all

menu:
    "Chapter 1":
        jump ch1
    "Chapter 2":
        jump ch2
    "Epilogue" if ch1finish == True & ch2finish == True & badendfinish == True:
        jump epilogue
The last option should only display if all of the variables included are true—that is, if you've gone through all those sections. Untested, so anyone else, feel free to correct me here, but something along these lines should work.

User avatar
Showsni
Miko-Class Veteran
Posts: 563
Joined: Tue Jul 24, 2007 12:58 pm
Contact:

Re: Splitting plotline into chapters - anyone know how to do it?

#8 Post by Showsni »

The problem is that chapter one's completion will reset if you start the game again; the best way is probably to use persistent variables. See here: http://www.renpy.org/wiki/renpy/doc/ref ... stent_Data

kraken
Newbie
Posts: 23
Joined: Tue Oct 23, 2007 7:41 am
Contact:

Re: Splitting plotline into chapters - anyone know how to do it?

#9 Post by kraken »

thank you very much, you really help me

Post Reply

Who is online

Users browsing this forum: No registered users