Page 1 of 1

Need help with selections and such

Posted: Tue Dec 12, 2006 12:39 am
by ghazghkull
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

Posted: Tue Dec 12, 2006 1:13 am
by PyTom
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.

Posted: Tue Dec 12, 2006 2:53 am
by ghazghkull
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?

Posted: Tue Dec 12, 2006 3:08 am
by PyTom
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

Posted: Tue Dec 12, 2006 4:35 am
by ghazghkull
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.

Posted: Tue Dec 12, 2006 5:39 am
by Jake
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?)