In game menu - change color?

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
Kamos
Regular
Posts: 33
Joined: Mon Jan 02, 2017 5:18 am
Tumblr: Kamos
Contact:

In game menu - change color?

#1 Post by Kamos »

Hello.

I have a mission menu in game. When you click on them it show you progress of the mission or mission complete / failed status based on progress you made....

How can I change the color of the mission when it is completed? for example it turn grey or something. This is example of "one" mission:

Code: Select all

menu mission:
        "Deandrea mission":
            menu:
                "Mission 1 - Last smart deathclaw":
                    if deadstat == 0:
                        if day <=20:
                            o "Talk with Deandrea and find a clue in Slave City."
                            jump mainmenu
                        else:
                            o "You failed to complete this mission."
                            jump mainmenu
                    else:
                        show aihappy:
                            xalign 1.0 yalign 1.0
                        o "You complete this mission."
                        jump mainmenu
                    jump mainmenu
                "Mission 2 - Save my life":
                    if deadstat == 0:
                        if day <= 20:
                            o "Complete 1st mission."
                            jump mainmenu
                        else:
                            o "You failed in 1st mission. Mission 2 is locked."
                            jump mainmenu
                    elif deadstat == 1:
                        if day <= 40:
                            o "Talk with Deandrea, find hunter in slave city and take care off him."
                            jump mainmenu
                        else:
                            o "You didn't take care off the hunter."
                            o "Lame."
                            jump mainmenu
                    else:
                        show aihappy:
                            xalign 1.0 yalign 1.0
                        o "You complete this mission."        
                    jump mainmenu
                "Mission 3 - Meet my love":
                    if deadstat <= 1:
                        if day <= 40:
                            o "Complete previous missions."
                            jump mainmenu
                        else: 
                            o "You failed in previous missions." 
                            jump mainmenu
                    elif deadstat == 2:
                        if day <= 60:
                            o "Talk with Deandrea and find smart deathclaw near sisterhood."
                            jump mainmenu
                        else:
                            o "Deandrea never meet another smart deathclaw."
                            jump mainmenu
                    else:
                        show aihappy:
                            xalign 1.0 yalign 1.0
                        o "You complete this mission."  
                        jump mainmenu
                    jump mainmenu
                "Mission 4 Explore the vault":
                    if dwault == 0:                        
                        o "Wait until Deandrea ask for visit."
                        jump mainmenu
                    else:
                        o "Mission over."
                        jump mainmenu
                    jump mainmenu
                "Something else":
                    jump mission
Last edited by Kamos on Mon Sep 25, 2017 7:41 am, edited 1 time in total.

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: In game menu - change color?

#2 Post by Remix »

Please first put your code in tags so it is formatted... like this...

[code]Your script code here[/code]
Frameworks & Scriptlets:

User avatar
IrinaLazareva
Veteran
Posts: 399
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy
Organization: SunShI
Location: St.Petersburg, Russia
Contact:

Re: In game menu - change color?

#3 Post by IrinaLazareva »

Code: Select all

default mission01 = False
default mission02 = False
# etc

label start:
    menu mission:
        "Mission 1 - Last smart deathclaw" if not mission01:
            menu:
                "complete":
                    "You complete this mission."
                    $ mission01 = True
                "fail":
                    "You failed to complete this mission."
            jump mission
                    
        "{color=#fff9}Mission 1 - Last smart deathclaw{/color}" if mission01:
            jump mission


        "Mission 2" if not mission02:
            "Bla... Bla..."
            "You complete this mission."
            $ mission02 = True
            jump mission
                    
        "{color=#fff9}Mission 2{/color}" if mission02:
            jump mission
            
        "End":
            return
           
Or you can develop this idea viewtopic.php?f=8&t=25453#p313338

Post Reply

Who is online

Users browsing this forum: Google [Bot]