Changing Main Menu based on endings unlocked

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
Sitraxis
Regular
Posts: 90
Joined: Fri May 25, 2012 1:08 am
Completed: Locked Heart, Cinderella Phenomenon
Projects: Cinderella Phenomenon Fandisk
Organization: Dicesuki
IRC Nick: sitraxis
Tumblr: sitraxis
Deviantart: sitraxis
Skype: Sitraxis
Location: Philippines
Contact:

Changing Main Menu based on endings unlocked

#1 Post by Sitraxis »

So, I intend to change the main menu screen based on the endings unlocked. Initially, everyone is a beast in the picture of the main menu.

For example, A's best end has been unlocked first so only A will be human while the B and C are still beasts.
If B's been unlocked first, then, B will be the only human and same goes with C.
At this point, it might sound easy if it wasn't based on whose ending was unlocked first.

Then, there's the instance where A and B's endings have been unlocked before C. and A and C before B or B and C before A.

The only easy part is ABC, I guess. ;w; Oh, by the way, lowercase a is the main character.

So here's my script.rpy

Code: Select all

label start:
    $ human_A=False
    $ human_B=False
    $ human_C=False
    stop music fadeout 1.0
    
label story:
    scene girl_room with dissolve
    a happy "All right! Let's see if this works."
label bear_talk:
        menu:
            a "The route you get is..."

            "A":
               jump papa_talk
                   
            "B":
                jump mama_talk
                
            "C":
                jump baby_talk
label papa_talk:
        show A with dissolve
        menu:
          a"Let's say you got the..."

          "Best End!":
              jump A_one
          "Normal End!":
              a whut"Normal End"
              jump end
            
label baby_talk:
        show B with dissolve
        menu:
          a"Let's say you got the..."

          "Best End!":
              jump deon_one
          "Normal End!":
               "Normal End."
               jump end
label mama_talk:
        show C with dissolve
        menu:
          a"Let's say you got the..."

          "Best End!":
              jump C_one
          "Normal End!":
               "Normal End."
               jump end      
label A_one:
    "A's not a beast"
    $ human_A= True
    jump end
label B_one:
    "B's not a beast"
    $ human_B= True
    jump end
label C_one:
    "C's not a bear"
    $ human_C= True
    jump end
label end:
    if(human_A):
        $ persistent.ending = "A Only"
    elif(human_B):
        $ persistent.ending = "B Only"  
    elif(human_C):
        $ persistent.ending = "C Only"  
    elif(human_C and human_B):
        $ persistent.ending = "A Left"  
    elif(human_C and human_A):
        $ persistent.ending = "B Left"  
    elif(human_A and human_B):
        $ persistent.ending = "C Left"  
    elif(human_C and human_B and human_A):
        $ persistent.ending = "Everyone"  
    return
                 

Code: Select all

screen main_menu:
    tag menu
    # This ensures that any other menu screen is replaced.

    # The background of the main menu.
    window:
        style "mm_root"
        if persistent.ending == "A Only":
                use main_menu_only_A
        elif persistent.ending = "B Only": 
                 use main_menu_only_B
        elif persistent.ending == "C Only":  
                 use main_menu_only_C
        elif persistent.ending == "A Left":
                use main_menu_A_left
        elif persistent.ending == "B Left": 
                use main_menu_B_left
        elif  persistent.ending == "C Left": 
                use main_menu_C_left
        elif persistent.ending == "Everyone": 
                use main_menu_yay
        else:    
            use main_menu_no_end
Strangely, the default menu is menu_menu_only_C and not main_menu_no_end even if I deleted the persistent data. Help?

Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: Changing Main Menu based on endings unlocked

#2 Post by Asceai »

Code: Select all

        elif persistent.ending = "B Only":
                 use main_menu_only_B
Whoops! == there.

User avatar
Sitraxis
Regular
Posts: 90
Joined: Fri May 25, 2012 1:08 am
Completed: Locked Heart, Cinderella Phenomenon
Projects: Cinderella Phenomenon Fandisk
Organization: Dicesuki
IRC Nick: sitraxis
Tumblr: sitraxis
Deviantart: sitraxis
Skype: Sitraxis
Location: Philippines
Contact:

Re: Changing Main Menu based on endings unlocked

#3 Post by Sitraxis »

Asceai wrote:

Code: Select all

        elif persistent.ending = "B Only":
                 use main_menu_only_B
Whoops! == there.

Thanks for pointing out the typo. :D

Post Reply

Who is online

Users browsing this forum: No registered users