[SOLVED] Custom links to short scenes in menu

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
liagel
Regular
Posts: 30
Joined: Thu Jan 10, 2019 5:13 pm
Contact:

[SOLVED] Custom links to short scenes in menu

#1 Post by liagel »

Hello!

I have an issue in my main menu.
I try to make a custom menu with the basics :

Code: Select all

        ... action ShowMenu("load")
        ... action Start()
        ... action ShowMenu("preferences")
        ... action Quit()
What I wanted to do now, is adding a link to a short scene which is not in the main story (like a bonus scene the player can access from the menu.)

Let's call this scene "scenebonus" which will be like this:

Code: Select all

label scenebonus:
   scene bonus1
   with dissolve
   pause
   scene bonus2
   with dissolve
   pause
   ...
   
   Return
It is just an example, I know indentation is not respected here.
I saved this files in scenebonus.rpy


So I tried :

Code: Select all

action ShowMenu("scenebonus")
But I have a black screen but with the right audio file playing...

Code: Select all

action Jump("scenebonus")
But it make me play the main game...

Code: Select all

action Replay("scenebonus")
And it works perfectly fine, this is exactly what I was looking for!
But of course, to have Replay working, you have to have seen the scene already...

So, I don't know what to do...
If you guys have any idea, I'm really open to any suggestion :)

Thank you for your help!
Last edited by liagel on Tue Feb 19, 2019 9:31 am, edited 1 time in total.

jacob_ax
Regular
Posts: 32
Joined: Thu Jan 31, 2019 9:21 am
Contact:

Re: Custom links to short scenes in menu

#2 Post by jacob_ax »

Hi liagel!
First of all I'm new to programming/renpy, so my answer may not be right :P

try to use:

Code: Select all

action Call("scenebonus")
also, keep the "return" at the end of the label scenebonus. This way it will bring back to where you were before you called the label itself.
I hope it works :D

Edit:
I just noticed that you wrote Return with a capital R. Is that a typo?

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

Re: Custom links to short scenes in menu

#3 Post by Imperf3kt »

The correct approach is to "start" at the scene.

Code: Select all

action start("scenebonus")
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

liagel
Regular
Posts: 30
Joined: Thu Jan 10, 2019 5:13 pm
Contact:

Re: Custom links to short scenes in menu

#4 Post by liagel »

Thank you both for your answers.

"Start" is working. I have tried it before, but as I tried to make my scene in another screen, Ren'Py didn't like it.

Thank you for your help !

Post Reply

Who is online

Users browsing this forum: Bing [Bot], DewyNebula