Page 1 of 1

Crashing on choice_screen

Posted: Fri Apr 15, 2016 5:16 am
by Raviel
Hi! I'm trying to make a choice_screen for my game through python: but it keeps crashing.

Code: Select all

        result = [(kiss[1][1][0].text, 'renpy.jump("start")', ''), (kiss[1][1][1].text, 'renpy.jump("home_scene")', ''), (kiss[1][1][2].text, 'renpy.jump("school_scene")', '')]
        
        renpy.call_screen('choice', items=result)
I get to make the choice but it crashes because: "TypeError: 'str' object is not callable" but if I leave out the quotations it messes up in other ways.
I appreciate all help I can get!

Re: Crashing on choice_screen

Posted: Fri Apr 15, 2016 5:44 am
by xela
Try:

Code: Select all

        result = [(kiss[1][1][0].text, Jump("Start"), ''), (kiss[1][1][1].text, Jump("home_scene"), ''), (kiss[1][1][2].text, Jump("school_scene"), '')]
       
        renpy.call_screen('choice', items=result)

Re: Crashing on choice_screen

Posted: Fri Apr 15, 2016 7:06 am
by Raviel
That's amazing, it worked thank you!

Now to another part of the problem. If I would like the action to be "$ option = 1" instead of jumping to another scene? What would I have to write? Maybe I should ask if it's possible first, hehe?

Re: Crashing on choice_screen

Posted: Fri Apr 15, 2016 7:12 am
by xela
Ask the good, old Doc about screen actions, they are very straight forward.

Re: Crashing on choice_screen

Posted: Fri Apr 15, 2016 7:39 am
by Raviel
Huh, I have never come across this doc before. It helped, everything works now. Thank you!