Another version of an 'ending' after triggering the original one.

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
Fisseha
Newbie
Posts: 20
Joined: Thu May 24, 2018 8:11 am
Projects: Fly Fly Fly, Grey Area, SICK, Raindrops, My Girlfriend Akane
Organization: Lonely Fish
Tumblr: PoissonMorts
Deviantart: MiyukiKudo(INACTIVE)
itch: FishPrincess
Location: Philippines
Contact:

Another version of an 'ending' after triggering the original one.

#1 Post by Fisseha » Sun Dec 02, 2018 7:08 am

Alright! Hello! I'm trying to find a way to do this. I've tried the cookbook (persistent data... I thought it would work.) but out of frustration I deleted all the code I typed earlier.

Basically,
If you have triggered ending {1A} once, you unlock ending {2A}.

The flow would be:
Picking C as the choice, which is ignoring the person then {1A}: You choose to ignore the person, you get a game over. restart the game.

In the new game, if you still choose C then {2A}: You choose to ignore the person again, and realize your mistake. So instead of a game over, you get to choose an option again to continue the game.

I'm not sure if all these details or enough. Please let me know. :D
I'm an artist, and probably a weaboo.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3636
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: Another version of an 'ending' after triggering the original one.

#2 Post by Imperf3kt » Sun Dec 02, 2018 7:57 am

I think I understand your query. This should do what you want: (I do not recommend using single letters as label names)

Code: Select all

default persistent.slip_up = False

label start:
    "This is the start of your game."
    "It is probably quite a bit longer than this."
    
label endgame:
    
    menu:
        "Pick an option"
        "A":
            jump a
        "B":
            jump b
        "C":
            $persistent.slip_up = True
            jump c

label c:
    if not persistent.slip_up:
        "you ignore the person."
        "Game over."
        $ renpy.full_restart()
    else:
        "Oops, I already chose that..."
        jump endgame
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py

Post Reply

Who is online

Users browsing this forum: No registered users