code question (menu)

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
TamakiShibo
Regular
Posts: 27
Joined: Sat Jul 07, 2018 1:24 pm
Contact:

code question (menu)

#1 Post by TamakiShibo »

i want to do something like this: game will allow you to choose 3 or more options, every option will do something and then will return to choosing, but without option that was already chosen. like you should do couple of labels of code and player will decide in what order he should read those. so, how to do that? the simplest way

thanks in advance

(sorry for bad english plz)

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: code question (menu)

#2 Post by Per K Grok »

TamakiShibo wrote: Thu Jul 12, 2018 4:22 am i want to do something like this: game will allow you to choose 3 or more options, every option will do something and then will return to choosing, but without option that was already chosen. like you should do couple of labels of code and player will decide in what order he should read those. so, how to do that? the simplest way

thanks in advance

(sorry for bad english plz)
Don't know if it is the simplest way, but it is at least one way :)

Code: Select all

default ch1 = True
default ch2 = True
default ch3 = True

-------------

    menu:
        "choice 1" if ch1:
            $ ch1 = False
            ----- do something----
        "choice 2" if ch2:
            $ ch2 = False
            ----- do something----
        "choice 3" if ch3:
            $ ch3 = False
            ----- do something----


TamakiShibo
Regular
Posts: 27
Joined: Sat Jul 07, 2018 1:24 pm
Contact:

Re: code question (menu)

#3 Post by TamakiShibo »

Per K Grok wrote: Thu Jul 12, 2018 5:52 am
TamakiShibo wrote: Thu Jul 12, 2018 4:22 am i want to do something like this: game will allow you to choose 3 or more options, every option will do something and then will return to choosing, but without option that was already chosen. like you should do couple of labels of code and player will decide in what order he should read those. so, how to do that? the simplest way

thanks in advance

(sorry for bad english plz)
Don't know if it is the simplest way, but it is at least one way :)

Code: Select all

default ch1 = True
default ch2 = True
default ch3 = True

-------------

    menu:
        "choice 1" if ch1:
            $ ch1 = False
            ----- do something----
        "choice 2" if ch2:
            $ ch2 = False
            ----- do something----
        "choice 3" if ch3:
            $ ch3 = False
            ----- do something----

thanks a lot!

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: code question (menu)

#4 Post by Remix »

Alternatively, just use a set attribute of the menu

Code: Select all

default some_set_name = []

label menu_test:

    menu:
        set some_set_name
        
        "A":
            "..."
        "B":
            "..."
        "C":
            "..."
    jump menu_test
Frameworks & Scriptlets:

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Semrush [Bot]