Script-writing and plot-branching

Use this forum to help develop your game-making skills, and get feedback on writing, art, music, or anything else you've created that isn't attached to a game in progress.
Locked
Message
Author
User avatar
PockieHoshi
Regular
Posts: 87
Joined: Thu Sep 22, 2011 10:08 am
Location: Between reality and a fictional realm
Contact:

Script-writing and plot-branching

#1 Post by PockieHoshi »

Sorry if this question sounds stupid but,
I was wondering,How do you go about making a branching,multi-pathed game on ren'py?
I mean its TOTALLY confusing :? ! I'm not exactly a genius at programming and coding things :cry: .
Also,Are there any codes for this? Any specific way of going about doing this?

Please explain it as simply as possible :|

Thank you!

User avatar
Camille
Eileen-Class Veteran
Posts: 1227
Joined: Sat Apr 23, 2011 2:43 pm
Completed: Please see http://trash.moe
Projects: the head well lost
Organization: L3
Tumblr: narihira
Deviantart: crownwaltz
itch: lore
Contact:

Re: Script-writing and plot-branching

#2 Post by Camille »

You'll want to read about menus, labels, and jumps as well as remembering user choices. That's about all you need to know in order to make a branching, multi-path game.

cloudyssky
Veteran
Posts: 258
Joined: Mon May 17, 2010 2:09 pm
Completed: Alone
Projects: Many failed ones
Location: Massachusetts
Contact:

Re: Script-writing and plot-branching

#3 Post by cloudyssky »

Having a game end in multiple ways is actually pretty easy. Yes, there's coding for ending a game, but you have to do all the work!

Here's a quick example:

Code: Select all

label start:
    a "Hey let's get married!"
    menu:
        "Okay!":
            jump married
            
        "No!":
            jump single
            
label married:
    a "We got married!"
    "Good Ending."
    return

label single:
    a "We didn't get married! A shame!"
    "Bad ending"
    return

What creates an ending is "return". That function ends the game. A game can have dozens and dozens of different endings. All you need is "return" where you want the game to end.
Projects:
Alone- (Horror/Sci-Fi) Complete! Link
Demokratiya- (Adventure/Action) I'm kind of winging it with this one. Goal is 100,000 words. Yeah, it's gonna take a while.
{Last worked on Sept/28 : Word count (coding and all) ~4500}

User avatar
PockieHoshi
Regular
Posts: 87
Joined: Thu Sep 22, 2011 10:08 am
Location: Between reality and a fictional realm
Contact:

Re: Script-writing and plot-branching

#4 Post by PockieHoshi »

Camille wrote:You'll want to read about menus, labels, and jumps as well as remembering user choices. That's about all you need to know in order to make a branching, multi-path game.
I've just read up on both things and it actually seems pretty simple lol (^o^)/ Thank you! :)
cloudyssky wrote:Having a game end in multiple ways is actually pretty easy. Yes, there's coding for ending a game, but you have to do all the work!

Here's a quick example:

Code: Select all

label start:
    a "Hey let's get married!"
    menu:
        "Okay!":
            jump married
            
        "No!":
            jump single
            
label married:
    a "We got married!"
    "Good Ending."
    return

label single:
    a "We didn't get married! A shame!"
    "Bad ending"
    return

What creates an ending is "return". That function ends the game. A game can have dozens and dozens of different endings. All you need is "return" where you want the game to end.
Thank you so much for posting an example :o ! I think I sort of understand how to go about doing this now.
Thank you :lol: !

gaoldart
Regular
Posts: 36
Joined: Wed Jul 06, 2011 11:23 am
Projects: Tony T (Writer, programmer)
Location: Under your chair >8D
Contact:

Re: Script-writing and plot-branching

#5 Post by gaoldart »

You could use a point system. With a variable like:

Code: Select all

$ girl1_points = 0
then girl1 has no points but if you add something like...

Code: Select all

    "girl1" "What to do...?"

    menu:
        "Do nothing":
            girl1_points = +1
(Someone correct me if the code is wrong) But this means that girl1 now has +1 point

You could later put something on the lines of:

Code: Select all

    if girl1_points = x:
                  jump girl1end
If anybody can correct me please do so... but that's the basic idea
Bashing my head against the computer desk while programming since march 2011, and so far no brain damashii nanananananananana katamari damashii

User avatar
PockieHoshi
Regular
Posts: 87
Joined: Thu Sep 22, 2011 10:08 am
Location: Between reality and a fictional realm
Contact:

Re: Script-writing and plot-branching

#6 Post by PockieHoshi »

gaoldart wrote:You could use a point system. With a variable like:

Code: Select all

$ girl1_points = 0
then girl1 has no points but if you add something like...

Code: Select all

    "girl1" "What to do...?"

    menu:
        "Do nothing":
            girl1_points = +1
(Someone correct me if the code is wrong) But this means that girl1 now has +1 point

You could later put something on the lines of:

Code: Select all

    if girl1_points = x:
                  jump girl1end
If anybody can correct me please do so... but that's the basic idea
Point system :o ?
I'd actually hadn't heard of that,thanks for mentioning it ^-^!
That actually looks alot simpler than the labels and such :lol: . (probably easier to code too)
So does it function similarly like the labels and jumps or is there some sort of difference between them?
Please explain it a bit more if you can (sorry if I'm asking for too much) :oops: .

Thank you! =]

gaoldart
Regular
Posts: 36
Joined: Wed Jul 06, 2011 11:23 am
Projects: Tony T (Writer, programmer)
Location: Under your chair >8D
Contact:

Re: Script-writing and plot-branching

#7 Post by gaoldart »

Well for starters you have this: http://lemmasoft.renai.us/forums/viewto ... f=8&t=4205

And as far as i know, you still need the labels...

Code: Select all

    menu:
        "Do nothing":
            $ girl1_points += 1
            jump nextscene
Please note that i was wrong is += 1 not = +1

And you continue there, later you can put up a road cone like:

Code: Select all

if girl1_points >= 10:
    jump goodend
else:
    jump bad end
The code adds to the points you put in the choice, but as a menuitem it still needs somewhere to jump to, so you need to put up a label for the choice.

You can also put it as part of the script so the points add thanks to the story. Just put them like you would put any line

It is still a bit more simple than to depend on flags...

If you get any problems, PM me and i might help you, unless you find a better answer, then i might need help from you
Bashing my head against the computer desk while programming since march 2011, and so far no brain damashii nanananananananana katamari damashii

Locked

Who is online

Users browsing this forum: No registered users