Crashing on choice_screen

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
Raviel
Newbie
Posts: 6
Joined: Tue Apr 12, 2016 4:40 am
Contact:

Crashing on choice_screen

#1 Post by Raviel » Fri Apr 15, 2016 5:16 am

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!

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Crashing on choice_screen

#2 Post by xela » Fri Apr 15, 2016 5:44 am

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)
Like what we're doing? Support us at:
Image

Raviel
Newbie
Posts: 6
Joined: Tue Apr 12, 2016 4:40 am
Contact:

Re: Crashing on choice_screen

#3 Post by Raviel » Fri Apr 15, 2016 7:06 am

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?

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Crashing on choice_screen

#4 Post by xela » Fri Apr 15, 2016 7:12 am

Ask the good, old Doc about screen actions, they are very straight forward.
Like what we're doing? Support us at:
Image

Raviel
Newbie
Posts: 6
Joined: Tue Apr 12, 2016 4:40 am
Contact:

Re: Crashing on choice_screen

#5 Post by Raviel » Fri Apr 15, 2016 7:39 am

Huh, I have never come across this doc before. It helped, everything works now. Thank you!

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Hojoo