Need help with selections and such

A place to discuss things that aren't specific to any one creator or game.
Forum rules
Ren'Py specific questions should be posted in the Ren'Py Questions and Annoucements forum, not here.
Post Reply
Message
Author
ghazghkull
Newbie
Posts: 5
Joined: Tue Dec 12, 2006 12:29 am
Contact:

Need help with selections and such

#1 Post by ghazghkull » Tue Dec 12, 2006 12:39 am

Ok below is the code of what I have thus far.

Code: Select all

menu:
        
        "Katsuragi Residence":
            G "Presently the Second and Third Children live under the guardianship of the Major. As you sure of your choice?"
            menu:
                "Yes":
                    G "Very well, you may leave with the Major"
                "No":
                    G "Then I suggest you do not waste my time and select a guardian immediately, Fifth Children."
                    
        "Kaji Residence":
            G "The name is one of our top spies, therefore he may be unable to provide you the necessary protection you may need. Is this your final decision?"
            menu:
                "Yes":
                    G "Very well. Major escort the 5th Children to Kaji's office."
                    M "Yes sir..."
                "No":
                    M "Oh thank god..."
                    G "Major restrain yourself. As for your 5th Child I suggest you do not waste my time and select and guardian immediately."
            
        "Ibuki Residence":
            G "She is one of the most skilled scientists, and she is only 24 years old, therefore it would be unlikely for her to be able to be your guardian. Are you willing to make this arrangement?"
            menu:
                "Yes":
                    pov "Why not, it's only a 6 year difference between -"
                    G "You shall not waste my time with such trivial matters."
                    G "Major Katsuragi shall be your escort until such time that Lieutenant Ibuki is relieved."
                "No":
                    G "Then I suggest you do not waste my time and select a guardian immediately, Fifth Children."
                    
        "Live in an apartment":
            G "If that is your choice you shall be provided a room near the First Children's room, for convienience. Is that understood?"
            menu:
                "Yes sir!":
                    G "Major Katsuragi see to it that the 5th Children and his belongings are all transported to the appropriate location."
                    M "Yes sir."
                "No thank you, I'll look elsewhere.":
                    G "Then I suggest you do not waste my time and select a guardian immediately, Fifth Children."
As you can tell it's a series of menus in another menu. My problem right now is how I get it so that when I select, "No," it'll revert back to the previous menu after any speaking has been done. Does anyone know how to go about this?

Well anyways, that's all from me

Cheers ^^ Ja ne
Last edited by ghazghkull on Tue Dec 12, 2006 2:49 am, edited 1 time in total.

User avatar
PyTom
Ren'Py Creator
Posts: 15437
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#2 Post by PyTom » Tue Dec 12, 2006 1:13 am

Please put [ code ] [ /code ] tags around blocks of code, so that indentation is preserved.

The way to do this is to put a label before the menu, and then to jump to that label if an incorrect choice is made.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

ghazghkull
Newbie
Posts: 5
Joined: Tue Dec 12, 2006 12:29 am
Contact:

#3 Post by ghazghkull » Tue Dec 12, 2006 2:53 am

Ok I've made the changes, however I don't fully understand what you mean by that. Could you possibly demonstrate using a portion of my code?

User avatar
PyTom
Ren'Py Creator
Posts: 15437
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#4 Post by PyTom » Tue Dec 12, 2006 3:08 am

ghazghkull wrote:Ok I've made the changes, however I don't fully understand what you mean by that. Could you possibly demonstrate using a portion of my code?
Sure.

Code: Select all

label residence_menu:
menu:
       
        "Katsuragi Residence":
            G "Presently the Second and Third Children live under the guardianship of the Major. As you sure of your choice?"
            menu:
                "Yes":
                    G "Very well, you may leave with the Major"
                "No":
                    G "Then I suggest you do not waste my time and select a guardian immediately, Fifth Children."

                    jump residence_menu
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

ghazghkull
Newbie
Posts: 5
Joined: Tue Dec 12, 2006 12:29 am
Contact:

#5 Post by ghazghkull » Tue Dec 12, 2006 4:35 am

Thanks a lot ^^

However I have another question, if you don't mind eh he he...Do you happen to know how to jump from one script to the next like how it's done with the tutorial? That would be greatly appreciated, thanks.

User avatar
Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

#6 Post by Jake » Tue Dec 12, 2006 5:39 am

ghazghkull wrote:Do you happen to know how to jump from one script to the next like how it's done with the tutorial?
Exactly the same way - put a 'label' with a name where you want the jump to end up, and a 'jump' to that name to send execution there from any other point in the script.

You can jump to labels from any script file, while they're all separate in the game directory you can think of it as if they're all glued together into a single script when the engine runs.

(And... shouldn't this be in the "Ren'Py" forum?)
Server error: user 'Jake' not found

Post Reply

Who is online

Users browsing this forum: No registered users