How to skip a scene

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
JimPanse
Newbie
Posts: 13
Joined: Wed Apr 28, 2021 1:36 pm
Contact:

How to skip a scene

#1 Post by JimPanse »

Hi guys,

so I'm trying to achieve the following:
If the player decides for one specific choice, a scene later in the game won't show up, because it basically was the wrong choice to make.
So I was thinking... is it possible to use an 'if statement' with a skip action. So let's just assume the player comes to a point where it's like this:

Code: Select all

menu:
    "Yes"
    $ Player += 1

    "No"
    pass
Now if he chooses 'No' then later in the game one specific scene shall be skipped. I'm not sure if you could combine an 'if statement' with a 'skip call'.
So when later in the game the player reaches a certain point the 'if statement' would come into play.
I'm thinking that I would have to label the choice beforehand, someting like

Code: Select all

label choice_20:
     menu:
        "Yes"
        $ Player += 1

        "No"
        pass
So I could then use something like this:

Code: Select all

if choice_20 = No then skip scene_ch6fight
Am I on the right track with this or am I talking rubbish here? Maybe you could help me out here.
Talking about scenes: Is it possible to tell renpy exactly where a scene begins and where it ends, e.g.

Code: Select all

start scene_01:
...
...
...
...
...
...
...
end scene_01
or something like that :-) because usually if you do something like

Code: Select all

scene black with fade
it ends as soon as you use a show statement or anything like that.

Best Regards

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2446
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: How to skip a scene

#2 Post by Ocelot »

Code: Select all

default skip_later_scene = False
# . . .
menu:
    "Yes":
        $ player += 1
    "No":
        $ skip_later_scene = True
# . . .
label later_scene:
if skip_later_scene:
    jump later_scene_end
# . . .
label later_scene_end:
# . . .
< < insert Rick Cook quote here > >

JimPanse
Newbie
Posts: 13
Joined: Wed Apr 28, 2021 1:36 pm
Contact:

Re: How to skip a scene

#3 Post by JimPanse »

Thank you so much Ocelot,

with the code you posted it worked absolutely flawless :D

I really appreciate your help buddy :wink:

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]