Page 1 of 1

code question (menu)

Posted: Thu Jul 12, 2018 4:22 am
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)

Re: code question (menu)

Posted: Thu Jul 12, 2018 5:52 am
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----


Re: code question (menu)

Posted: Thu Jul 12, 2018 6:09 am
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!

Re: code question (menu)

Posted: Thu Jul 12, 2018 3:33 pm
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