Multiple endings?

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
User avatar
Ran08
Miko-Class Veteran
Posts: 737
Joined: Tue Jun 12, 2012 1:17 am
Completed: https://ran.itch.io/
Projects: Fate's Cafe
Tumblr: otometwist
Skype: @otomeran
itch: ran
Location: Manila
Contact:

Multiple endings?

#1 Post by Ran08 » Thu Jun 14, 2012 6:50 am

(I'm not sure if this is the right forum for this...)

Um, hello! :)

I'm trying to make a visual novel right now, and I wanted to have multiple endings. Well, I do know how to make multiple endings, but this is my problem...

(I don't know how to explain this well, sorry.)
I plan to have something like RE: Alistair where you can choose where to go for the day. My story has 5 "bachelors" and of course, they have their own endings that depend on a point system; where you always go to and the choices you make. I got up to the 5th day planning out each event until I realized, what if the player went to the library the first day, then she would meet this guy and if she went there again the 2nd day then they would continue being friends. But if she went to the, say, gym, the first day and then went to the library the 2nd day, then the conversation in the library.rpy would still be the same conversation she would have if she went to the library the first day. Which is so wrong, because it would leave the player confused. :(

This is how I designed it:

(example:)

Code: Select all

menu:
  "Where should I go today?"
     "Library":
        call library1
     "Gym"
        call gym1
     "Classroom"
        call room1

 #2nd day
menu:
  "Where should I go today?"
     "Library":
        call library2
     "Gym"
        call gym2
     "Classroom"
        call room2
As you can see, it's really bound to go wrong because I made each day a... err... unique event. So if the player chooses a different location in the 2nd day, then she would skip the introduction that happened in that location the 1st day! :'( How do I solve this...?

I am aware that my question isn't really about making multiple endings... tee-hee, I'm just wondering if anyone could help me make a day planner or anything. -_- I'm new to this stuff, and I'm sorry for being so naive. I just really want to use some kind of "planner" like the one in Alistair... :( I'd appreciate any help from you guys. Thanks in advance. :D

User avatar
SundownKid
Lemma-Class Veteran
Posts: 2299
Joined: Mon Feb 06, 2012 9:50 pm
Completed: Icebound, Selenon Rising Ep. 1-2
Projects: Selenon Rising Ep. 3-4
Organization: Fastermind Games
Deviantart: sundownkid
Location: NYC
Contact:

Re: Multiple endings?

#2 Post by SundownKid » Thu Jun 14, 2012 9:02 am

The solution to this would involve creating a variable that increases based on the number of times a person went to a certain place. That way, depending on the variable number, a certain event would happen when they jumped to a place like the library.

Code: Select all

label planner:
  menu:
    "Where should I go today?"
       "Library":
          $ libraryvisits += 1
          jump library
       "Gym"
          $ gymvisits += 1
          jump gym
       "Classroom"
          $ roomvisits += 1
          jump room

label library:
  if libraryvisits == 1:
     b "This is my first time here."
  if libraryvisits == 2:
     b "This is my second time here."

User avatar
KimiYoriBaka
Miko-Class Veteran
Posts: 636
Joined: Thu May 14, 2009 8:15 pm
Projects: Castle of Arhannia
Contact:

Re: Multiple endings?

#3 Post by KimiYoriBaka » Thu Jun 14, 2012 10:44 am

and here we get the the very essence of non-linear storytelling and one of the very basics of genuine game-design: controlling things with variables.

anytime you have a story with the player given choices over and over like this, you need to make a menu for each sets of repeating choices, then once the player chooses something, you make a check for everything that could be relevant, go to the appropriate dialogue, then jump to the next set of choices.

as sundownkid said, you should have a variable for each location that keeps track of how many times the player has been there. another good thing to keep track of is whether the player has gone through any particularly important conversations (like introductions). that way you don't necessarily have to have the events for each location happen in a certain order.

Code: Select all

label library:
    if not library_guy_introduced:
        library_guy_introduced = True
        jump library_guy_intro

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

Re: Multiple endings?

#4 Post by Showsni » Thu Jun 14, 2012 11:39 am

Also, it sounds like what you want to use is exactly the DSE that's available for Ren'Py, here: http://www.renpy.org/wiki/renpy/DSE

It comes with a built in day planner that can handle choosing where to go each day and having different events pop up depending on whether you've been there before or not.

User avatar
Ran08
Miko-Class Veteran
Posts: 737
Joined: Tue Jun 12, 2012 1:17 am
Completed: https://ran.itch.io/
Projects: Fate's Cafe
Tumblr: otometwist
Skype: @otomeran
itch: ran
Location: Manila
Contact:

Re: Multiple endings?

#5 Post by Ran08 » Fri Jun 15, 2012 8:33 am

Ahhh, I understand it better now! Thank you so much for you three. :D I'm going to try it out later and report my progres
s. xD

Edit: I got an error. Whyyyy...?

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 1256, in script
  File "game/script.rpy", line 1256, in python
NameError: name 'roomvisits' is not defined

User avatar
Destiny
Veteran
Posts: 468
Joined: Thu Jun 14, 2012 2:00 pm
Projects: Cards of Destiny, Sky Eye
Location: Germany
Contact:

Re: Multiple endings?

#6 Post by Destiny » Fri Jun 15, 2012 3:52 pm

@Ran08
I guess, it would help, if you quote the line 1526, because the error message doesn't really tell, what EXACTLY is the problem with that name.

@SundownKid
I have a question about the way you proposed.
Is it possible to do something like that?

Code: Select all

label library:
  if libraryvisits == 1 or greater:
     b "Gosh, I like this place."
I mean, when the counter is bigger like 2, there will be another message then when it is under 2.
Because I want the == counter for the possible bachelors to react more or less lovingly.
BUT the main character talks to the best friend after every date and it just matters to that friend, if the date never happend with bachelor A, if it was the first date or the second and higher.

so I need something like

Code: Select all

label library:
  if libraryvisits == 0:
     # the character will talk about another date with a positiv number, since this date never happend
  if libraryvisits == 1:
     b "And then I met this new guy."
  if libraryvisits == 2 or greater:
     b "And then I met David again."
Maybe I shouldn't do it with these counts, but it kind of sounded appropiate .__.

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

Re: Multiple endings?

#7 Post by Showsni » Fri Jun 15, 2012 4:10 pm

Destiny wrote:@SundownKid
I have a question about the way you proposed.
Is it possible to do something like that?

Code: Select all

label library:
  if libraryvisits == 1 or greater:
     b "Gosh, I like this place."
I mean, when the counter is bigger like 2, there will be another message then when it is under 2.
Because I want the == counter for the possible bachelors to react more or less lovingly.
BUT the main character talks to the best friend after every date and it just matters to that friend, if the date never happend with bachelor A, if it was the first date or the second and higher.

so I need something like

Code: Select all

label library:
  if libraryvisits == 0:
     # the character will talk about another date with a positiv number, since this date never happend
  if libraryvisits == 1:
     b "And then I met this new guy."
  if libraryvisits == 2 or greater:
     b "And then I met David again."
Maybe I shouldn't do it with these counts, but it kind of sounded appropiate .__.
You an use >, <, >= and <= as well as ==. So, just use
if libraryvisits > 1:
for if library visits are greater than 1.

User avatar
Destiny
Veteran
Posts: 468
Joined: Thu Jun 14, 2012 2:00 pm
Projects: Cards of Destiny, Sky Eye
Location: Germany
Contact:

Re: Multiple endings?

#8 Post by Destiny » Fri Jun 15, 2012 4:25 pm

Thanks Showsni, thats exactly what I needed :D

User avatar
KimiYoriBaka
Miko-Class Veteran
Posts: 636
Joined: Thu May 14, 2009 8:15 pm
Projects: Castle of Arhannia
Contact:

Re: Multiple endings?

#9 Post by KimiYoriBaka » Fri Jun 15, 2012 5:19 pm

I guess, it would help, if you quote the line 1526,
actually, this tends to be a lot less helpful than would be intuitive. posting the entire section of code is usually needed.

looking at the error, I would guess that you either didn't give a value for roomvisits before checking it, or you gave it a value in a place that wouldn't necessarily be run.

if that is the case, then putting something like this at the beginning of your start label would help:

Code: Select all

label start:
    python:
        libraryvisits = 0
        roomvisits = 0
        gymvisits = 0
that way, no matter what choices are made, those variables have a checkable value.

User avatar
Ran08
Miko-Class Veteran
Posts: 737
Joined: Tue Jun 12, 2012 1:17 am
Completed: https://ran.itch.io/
Projects: Fate's Cafe
Tumblr: otometwist
Skype: @otomeran
itch: ran
Location: Manila
Contact:

Re: Multiple endings?

#10 Post by Ran08 » Sat Jun 16, 2012 7:01 am

Aww, thanks a whole lot for the help you guys, it works perfectly now. Turns out I just forgot to put it in the beginning. :D Thank you so much.

Post Reply

Who is online

Users browsing this forum: No registered users