Page 1 of 1

Changing Main Menu based on endings unlocked

Posted: Sat Apr 12, 2014 8:04 am
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?

Re: Changing Main Menu based on endings unlocked

Posted: Sat Apr 12, 2014 8:31 am
by Asceai

Code: Select all

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

Re: Changing Main Menu based on endings unlocked

Posted: Mon Apr 14, 2014 3:51 am
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