Help with Branches

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
undertone
Newbie
Posts: 5
Joined: Sun Dec 14, 2008 3:55 pm
Contact:

Help with Branches

#1 Post by undertone »

Okay, so I am at a point where I need to branch the game, and the documentation is too vague for me.

Here is the script
"I hesitated. Should I keep going, pretending to ignore the person, or should I turn around and ask him to stop following me."

menu:
"Keep Walking":

"Its just my brain playing tricks on me."
"I kept walking, maybe I'm just being paranoid."
"As I made it to the store, walking inside, the man went by, only giving a quick glance on the way."


"Confront the Man"
"It isn't an illusion."
"I turned around, giving the man a jump."
"In Japanese he said."
m "Shit, does he know?"
l "Ahha! So I was right! You are following me!"
m "You speak Japanese?! Oh crap."
"He bolted, having cleary failed his mission, whatever it was."

I want to make it where each one ends up getting to a different point. For example, confronting the man should result in a different script like
"It turns out that I was being followed, which started this whole journey I am on now. After that day, I realized that I wasn't safe..." Yada yada, and that will start its own scenario.
While the other will begin its own scenario. So I'm basically writing two stories after the branch. What do I do?

EternalDream
Veteran
Posts: 208
Joined: Sat Nov 27, 2010 6:04 pm
Completed: Secret Santa
Projects: Memory Lane
Contact:

Re: Help with Branches

#2 Post by EternalDream »

You could do 2 things (From what I know ^^;;)

1. Split it into separate scripts (so create a new .rpy file and name it path1.rpy or something and continue writing from there each of them separately.)


2. If its like: 2 paths now, then one path and depending on the paths chosen before, separate into different paths, then use the if statement.

Some links that might help you:

http://www.renpy.org/wiki/renpy/doc/tut ... er_Choices

http://www.renpy.org/wiki/renpy/doc/ref ... anguage#if

Did I answer ur question? ...Or did I misunderstand? ^_^;;

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

Re: Help with Branches

#3 Post by Showsni »

You can either put the entire story of each branch within each menu option, or jump elsewhere in your script. So, if you have:

Code: Select all


menu:
    "Keep Walking":
        "Its just my brain playing tricks on me."

    "Confront the Man":
        "It isn't an illusion."

You could either place the whole script inside each branch:

Code: Select all


menu:
    "Keep Walking":
        "Its just my brain playing tricks on me."
        (Whole script for this branch)
    "Confront the Man":
        "It isn't an illusion."
        (Whole script for this branch)
But that's pretty confusing, and you could end up with nested menus all over the place. It's probably better to use jumps:

Code: Select all


menu:
    "Keep Walking":
        "Its just my brain playing tricks on me."
        jump branch1
    "Confront the Man":
        "It isn't an illusion."
        jump branch 2

label branch1:
    (Whole script of this branch)

label branch2:
    (Whole script of this branch)
The actual branches can then be put anywhere and it will jump to them; they can even be put in seperate script files in your game folder, if you want to keep things organised that way.

Post Reply

Who is online

Users browsing this forum: No registered users