Variable Menus

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
lonewolf
Newbie
Posts: 4
Joined: Fri Dec 14, 2007 4:34 pm
Contact:

Variable Menus

#1 Post by lonewolf »

Hi, I was wondering about variable menus... by that i mean a single written menu that can expand depending on a variable.

A game I'm working on is fairly heavy on text and also needs expanding menus, so if you click on menu list C out of A,B,C then after C has been read menu list D shows up.

something like this.

Code: Select all

label mtest:
    
    menu:
        if menux == 0:
        "a":
            c "A"
            jump mtest
        "b":
            c "B"
            jump mtest
        "c":
            c "C"
            $ menux = 1
            jump mtest
            
        elif menux == 1:
        "d":
            c "D"
            jump mtest
This code doesn't work ^^; and I'm new to python :oops:

Any help would be greatly appreciated :)

lonewolf
Newbie
Posts: 4
Joined: Fri Dec 14, 2007 4:34 pm
Contact:

Re: Variable Menus

#2 Post by lonewolf »

AHHHHHHHHHHHHHHHHHHHHHHHHH !

I have found a way, I'm sorry for posting this :oops:

here is my solution after reading the documentation :oops:

Code: Select all

label mtest:
    
    menu:
        "a":
            c "A"
            jump mtest
        "b":
            c "B"
            jump mtest
        "c":
            c "C"
            $ menux = 1
            jump mtest
            
        "d" if menux == 1:
            c "D"
            jump mtest
Sorry again if I have wasted anyone's time. I hope people with this problem find it helpful.

Now to reprogram all the code for menus I've got :roll:

Post Reply

Who is online

Users browsing this forum: Google [Bot]