Multiple Requirments For An Option To Show (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
Tahrgat
Regular
Posts: 26
Joined: Sat Jan 11, 2014 11:33 am
Projects: End of Darkness
Organization: Artistic License Studio
Location: Florida
Contact:

Multiple Requirments For An Option To Show (Solved)

#1 Post by Tahrgat »

Thank you for reading my question :) I need to know how to set an option to appear only after all the other options have been completed. This is the script below. Specifically I need to know how I should phrase the code for "GO TO BED" after "if" so that it will become present when "amity_first_done", "imoen_first_done" and "study_first_done" are all "True". I really tried looking hard for the answer, but no luck.

Code: Select all

menu:
    "INTRODUCE MYSELF TO THE NEIGHBOR" if amity_first_done == False:
        $ amity_first_done = True
        jump amityfirst
          
    "WORKOUT IN THE WOODS" if imoen_first_done == False:
        $ imoen_first_done = True
        "hi"
        
    "STUDY A BOOK" if study_first_done == False:
        $ study_first_done = True
        "hi"
        
    "GO TO BED" if :
        "sleep"
Last edited by Tahrgat on Thu Jan 16, 2014 11:23 pm, edited 1 time in total.
It is better to be the cub of a live jackal than of a dead lion.

User avatar
akemicchi
Veteran
Posts: 465
Joined: Mon Dec 31, 2007 11:22 pm
Projects: Magicians of Delphine, Panaderia: Ensaimada, SweetTooth!, XOXO Droplets
Deviantart: littlebabyshoes
Contact:

Re: Multiple Requirments For An Option To Show

#2 Post by akemicchi »

Just use the 'and' operator. :)

Code: Select all

    "GO TO BED" if amity_first_done and imoen_first_done and study_first_done:
        "sleep"
You can also do it as amity_first_done == True and imoen_first_done == True and study_first_done == True.

User avatar
Tahrgat
Regular
Posts: 26
Joined: Sat Jan 11, 2014 11:33 am
Projects: End of Darkness
Organization: Artistic License Studio
Location: Florida
Contact:

Re: Multiple Requirments For An Option To Show

#3 Post by Tahrgat »

akemicchi wrote:Just use the 'and' operator. :)

Code: Select all

    "GO TO BED" if amity_first_done and imoen_first_done and study_first_done:
        "sleep"
You can also do it as amity_first_done == True and imoen_first_done == True and study_first_done == True.
THANK YOU SO MUCH akemicchi! I, somehow, overlooked this operation. That is to say I didn't know it existed until you just showed me. YAY! Now for progress ^.^
It is better to be the cub of a live jackal than of a dead lion.

Post Reply

Who is online

Users browsing this forum: No registered users