Multiple endings based on choices made throughout?
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.
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.
-
crimsonnight
- Veteran
- Posts: 298
- Joined: Fri Apr 20, 2012 4:44 am
- Contact:
Multiple endings based on choices made throughout?
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!
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
- 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?
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
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
- 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?
This tutorial should answer your questions: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!
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:
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
Most recent Games Completed:
- The Walk[Psychological][NanoWinter] ~ PG New!
- Trap! [ModernFantasy][VN] ~ PG16
- The Adventures of Prince Ivan [Fant/Adv/VN] ~ PG
"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?
It's currently offline.OokamiKasumi wrote:This tutorial should answer your questions: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!
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.
- 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?
My mistake, I posted the wrong link.Cabriolean wrote:It's currently offline.
http://www.otome-games.com/index.php/ma ... otome-game
Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed:
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
Most recent Games Completed:
- The Walk[Psychological][NanoWinter] ~ PG New!
- Trap! [ModernFantasy][VN] ~ PG16
- The Adventures of Prince Ivan [Fant/Adv/VN] ~ PG
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
Who is online
Users browsing this forum: Bing [Bot], Google [Bot], zyric
