return to menu after script [solved]

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
XxrenxX
Veteran
Posts: 265
Joined: Tue Oct 02, 2012 2:40 am
Projects: Chasing
Deviantart: bara-ettie
Location: Canada
Contact:

return to menu after script [solved]

#1 Post by XxrenxX » Sun Sep 09, 2018 2:17 am

I've been posting a lot today but I am getting frustrated doing this alone.

So I have some side stories programmed into my game that are accessible via the extra's menu. However no matter what I try the game either crashes when it tries to return or it starts a new game, ignoring any menu's asked to go to.

here are some different codes I've tried. Am I at least on the right track? (each line a different variation I tried)

Code: Select all

return
return ("mainmenu") #Also tried with ("extra_screen") as well as empty ()
return () action ShowMenu("extra_screen")
action ShowMenu("extra_screen")
jump ShowMenu("extra_Screen")
jump("extra_Screen")
call_extra_screen
call("extra_screen")
I either have the game start a new game oran error saying invalid syntax.
Last edited by XxrenxX on Sun Sep 09, 2018 1:18 pm, edited 1 time in total.

User avatar
MaydohMaydoh
Regular
Posts: 104
Joined: Mon Jul 09, 2018 5:49 am
Projects: Fuwa Fuwa Panic
Tumblr: maydohmaydoh
Location: The Satellite of Love
Contact:

Re: return to menu after script

#2 Post by MaydohMaydoh » Sun Sep 09, 2018 6:41 am

From your previous thread, I'm guessing you're using the Jump action, which for this won't work. You can't return from a jump. You should use Start("label_name") instead and put return at the end of the script, which will return you to the main menu.

User avatar
XxrenxX
Veteran
Posts: 265
Joined: Tue Oct 02, 2012 2:40 am
Projects: Chasing
Deviantart: bara-ettie
Location: Canada
Contact:

Re: return to menu after script

#3 Post by XxrenxX » Sun Sep 09, 2018 1:18 pm

so instead of Jump("label") use Start("label") for the hotspot and the return function should act as intended?

Seems to be working. Can't believe I didn't think of that.

Post Reply

Who is online

Users browsing this forum: Adrian_DVL, Google [Bot], Majestic-12 [Bot], MaydohMaydoh