Page 1 of 1

Multiple endings based on choices made throughout?

Posted: Tue Apr 23, 2013 10:34 am
by crimsonnight
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!

Re: Multiple endings based on choices made throughout?

Posted: Tue Apr 23, 2013 11:00 am
by Kato
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

Re: Multiple endings based on choices made throughout?

Posted: Wed Apr 24, 2013 5:11 pm
by OokamiKasumi
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.

Re: Multiple endings based on choices made throughout?

Posted: Wed Apr 24, 2013 5:44 pm
by Cabriolean
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.

Re: Multiple endings based on choices made throughout?

Posted: Wed Apr 24, 2013 7:53 pm
by OokamiKasumi
Cabriolean wrote:It's currently offline.
My mistake, I posted the wrong link.
http://www.otome-games.com/index.php/ma ... otome-game