New main menu when a variable is set to True?

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
WanderLustWolfe
Newbie
Posts: 1
Joined: Wed May 29, 2019 11:11 pm
Deviantart: WanderLustWolfe
Contact:

New main menu when a variable is set to True?

#1 Post by WanderLustWolfe »

I'm currently making a visual novel that has around 14 completely different routes, and I want the main menu to change according to which route the player is going down. I've only been using renpy for about a year now, so I don't quite understand the super complicated code, but if I have to use it I will.

User avatar
Andredron
Miko-Class Veteran
Posts: 714
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

Re: New main menu when a variable is set to True?

#2 Post by Andredron »

Code: Select all



# script.rpy:
label start:
     "Changing the background in direct proportion to the ending."
     menu:
         "Firstday.":
             $ persistent.ending = "first"
         "Second.":
             $ persistent.ending = "second"
         "Return main background.":
             $ persistent.ending = "main"
     return

# screens.rpy:
screen main_menu:
     # This replaces other menus.
     tag menu
     # The background of the main menu.
     window:
         style "mm_root"
         if persistent.ending == None:
             $ persistent.ending = "main"
         background ("images / mm-% s.jpg"% (persistent.ending))
         # etc.


Post Reply

Who is online

Users browsing this forum: Andredron, wizard_jpg