Multiple endings based on choices made throughout?

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
crimsonnight
Veteran
Posts: 298
Joined: Fri Apr 20, 2012 4:44 am
Contact:

Multiple endings based on choices made throughout?

#1 Post by crimsonnight » Tue Apr 23, 2013 10:34 am

I understand about 'branching' and 'jumping' for multiple variations in text/endings but it is possible for each choice you make to award you with a 'point' and depending on how many 'points' you have accumulated you will receive a certain ending?
I'm basically looking for the cleanest way to code a good or bad ending based on choices the player makes throughout the novel as opposed to branching off at certain points.

Cheers!
alwaysthesamebluesky.com

User avatar
Kato
Miko-Class Veteran
Posts: 649
Joined: Tue Jan 15, 2013 4:45 am
Projects: Memories of Summer Winds
Organization: Blue Sphere Group
Location: Perth, Western Australia
Contact:

Re: Multiple endings based on choices made throughout?

#2 Post by Kato » Tue Apr 23, 2013 11:00 am

Yep, easy.

First you need to set your variable to 0 at the beginning, so:

$ ending = 0

Then as the player performs an action which will add/subtract a point to the variable you use:

$ ending += 1 (will add 1 point to the variable 'ending')

or

$ ending -= 1 (will subtract 1 point from 'ending')

Then at the end you can run a test to see how many points you have and what actions are taken because of it:

if ending > 5:
jump good_ending

else:
jump bad_ending


Not at a computer right now so I'm not 100% on it all. But that's the basic idea of it all, should be able to play around with it and figure it out from there. Basically the last piece of code is testing to see if 'ending have more than 5 points, if it does it will jump to the label good_ending, if not bad_ending. You can add more variables if you need to aswell. Hopefully I helped a bit, even if i'm not 100% of the top of my head XD
Image Image
Kato, Producer & Programmer for Blue Sphere Group. Current Projects: Memories of Summer Winds

User avatar
OokamiKasumi
Eileen-Class Veteran
Posts: 1779
Joined: Thu Oct 14, 2010 3:53 am
Completed: 14 games released -- and Counting.
Organization: DarkErotica Games
Deviantart: OokamiKasumi
Location: NC, USA
Contact:

Re: Multiple endings based on choices made throughout?

#3 Post by OokamiKasumi » Wed Apr 24, 2013 5:11 pm

crimsonnight wrote:I understand about 'branching' and 'jumping' for multiple variations in text/endings but it is possible for each choice you make to award you with a 'point' and depending on how many 'points' you have accumulated you will receive a certain ending?
I'm basically looking for the cleanest way to code a good or bad ending based on choices the player makes throughout the novel as opposed to branching off at certain points.

Cheers!
This tutorial should answer your questions:

How to Make a Simple Otome Game
http://www.otome-games.com/index.php/ma ... otome-game

This explains basic 'choice' menu coding, how to use 'if' statements, and how to set up a point system in a sample Otome (Dating) game.
Last edited by OokamiKasumi on Wed Apr 24, 2013 7:54 pm, edited 4 times in total.
Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed: For ALL my completed games visit: DarkErotica Games

"No amount of great animation will save a bad story." -- John Lasseter of Pixar

Cabriolean
Regular
Posts: 44
Joined: Sun Dec 09, 2012 6:59 am
Contact:

Re: Multiple endings based on choices made throughout?

#4 Post by Cabriolean » Wed Apr 24, 2013 5:44 pm

OokamiKasumi wrote:
crimsonnight wrote:I understand about 'branching' and 'jumping' for multiple variations in text/endings but it is possible for each choice you make to award you with a 'point' and depending on how many 'points' you have accumulated you will receive a certain ending?
I'm basically looking for the cleanest way to code a good or bad ending based on choices the player makes throughout the novel as opposed to branching off at certain points.

Cheers!
This tutorial should answer your questions:
http://www.otome-games.com/index.php/fo ... art=30#358

This explains basic 'choice' menu coding, how to use 'if' statements, and how to set up a point system in a sample Otome (Dating) game.
It's currently offline.

User avatar
OokamiKasumi
Eileen-Class Veteran
Posts: 1779
Joined: Thu Oct 14, 2010 3:53 am
Completed: 14 games released -- and Counting.
Organization: DarkErotica Games
Deviantart: OokamiKasumi
Location: NC, USA
Contact:

Re: Multiple endings based on choices made throughout?

#5 Post by OokamiKasumi » Wed Apr 24, 2013 7:53 pm

Cabriolean wrote:It's currently offline.
My mistake, I posted the wrong link.
http://www.otome-games.com/index.php/ma ... otome-game
Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed: For ALL my completed games visit: DarkErotica Games

"No amount of great animation will save a bad story." -- John Lasseter of Pixar

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], zyric