Different route after a game crash or ending a route?

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
Posts: 1
Joined: Mon Aug 27, 2018 11:37 pm

Different route after a game crash or ending a route?

#1 Post by Bloody-Marie » Mon Aug 27, 2018 11:48 pm

Greetings! Im new to the forums so I highly apologize if this has already been answered! I’ve just been desperate to figure out a way to pull this off but have found absolutely no clear answers!
My issue is that I am creating a game with several character routes (much like a dating sim) but in one route specifically once the player finishes it and decides to replay the game, again. A new added on scene is in the game which takes the player to a different storyline yet keeps the rest of the routes in case the player would want to continue with the rest of the characters. Im very very sorry if this is making no sense but in clearer terms.

Much like how in DDLC (spoilers!) when Sayori is found dead the game crashes and when its booted up again its a completely different game! I am wondering as to what coding causes the game to load on a different label or python!

User avatar
Posts: 303
Joined: Thu Feb 09, 2017 10:29 pm
Completed: No Other Medicine, Well Met By Moonlight, RE:BURN
Projects: DemiDato, The Light at the End of the Ocean
itch: janetitor
Location: Canada

Re: Different route after a game crash or ending a route?

#2 Post by parttimestorier » Tue Aug 28, 2018 3:58 pm

I'm not entirely sure if I interpreted what you're saying correctly, but it sounds to me like you just need a persistent variable and an if/else statement. For instance, let's say that once you've done some character named Mary's route, that unlocks some character named Alice's route, and there's also a new scene with Alice at the beginning at the common route. Then, at the end of Mary's route you would want something like this:

Code: Select all

$ persistent.alice_unlocked = True
Because that's a persistent variable, the game still stores that information over multiple playthroughs. Then the beginning of your game might look something like this:

Code: Select all

if persistent.alice_unlocked:
	jump new_alice_scene
	jump first_scene
Then the first thing that happens in your game will be that it decides which scene to show based on that persistent variable.

Post Reply

Who is online

Users browsing this forum: oro121