How to lock scenes after playing it once?

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
georgewbush
Newbie
Posts: 13
Joined: Fri Nov 30, 2018 5:14 pm
Contact:

How to lock scenes after playing it once?

#1 Post by georgewbush »

Hello, I'm new to the Ren'Py engine. If someone could help me I would greatly appreciate it.

I have a game map where the player clicks on certain areas like "shop" "school" "gym" etc. I want to have like 10 different story scenes for each location, so if I click on "gym" on my map I start #1 scene which I place inside a label. However if I already did #1 scene I do NOT want for it to be replayed again. It should jump to #2 story scene.

So basically if I completed the first story then it should jump to the second, third, etc.

I tried searching up this but found empty hands. Please help. Thank you!

User avatar
Enchant00
Regular
Posts: 136
Joined: Tue Jan 12, 2016 1:17 am
Contact:

Re: How to lock scenes after playing it once?

#2 Post by Enchant00 »

You can use variables for that or persistent data.

Code: Select all


$ scene_1_done = False

    label scene_1:
        if not scene_1_done:
            'some text'
            'end of scene 1'
            $scene_1_done = True
        else:
            jump scene_2

    label scene_2:
        'scene 2'
if not_scene_1_done is the same as if scene_1_done == False

Post Reply

Who is online

Users browsing this forum: Ocelot