[SOLVED] Choice screen problems

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
Dreamtale
Newbie
Posts: 24
Joined: Tue Jan 11, 2011 8:15 pm
Contact:

[SOLVED] Choice screen problems

#1 Post by Dreamtale » Wed Oct 16, 2013 3:22 pm

Ok, it's me again, hope, you didn't get tired. My problem tonight is that the game crashes on choice screen if player clicks on something other than choice button (or Enter, supposedly). Another issue is that I cannot reproduce this bug. Many testers report it, but I tried doing exactly like they did and nothing bad happens. From their words, game crashes, when you are on choice screen, like this:

Code: Select all

menu:
    "Choice 1":
        "text"
    "Choice 2":
        "text"
and click (one tester reported pressing Enter key) on random space on the screen, but not the choice button (they say it's ~40% of the screen that causes crash). So, here's traceback
I'm sorry, but an uncaught exception occurred.
While running game code:
File "scenario/day3/day3.rpy", line 1491, in script
TypeError: list indices must be integers, not str
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "C:\GAMES\iichan\everlasting_summer-1.0-all\renpy\execution.py", line 288, in run
node.execute()
File "C:\GAMES\iichan\everlasting_summer-1.0-all\renpy\ast.py", line 1310, in execute
next_node(self.items[choice][2][0])
TypeError: list indices must be integers, not str
Windows-7-6.1.7601-SP1
Ren'Py 6.15.7.374
Everlasting Summer 1.0
And my choice screen config:

Code: Select all

screen choice:
    python:
        choice_colors_hover={
        'day': "#9dcd55",
        'night': "#3ccfa2",
        'sunset': "#dcd168",
        'prologue': "#98d8da"
                            }
        choice_colors={
        'day': "#466123",
        'night': "#145644",
        'sunset': "#69652f",
        'prologue': "#496463"
                            }
    
    window background Frame(get_image("gui/choice/"+persistent.timeofday+"/choice_box.png"),50,50) xfill True yalign 0.5 left_padding 75 right_padding 75 bottom_padding 50 top_padding 50:
    
        vbox xalign 0.5 yalign 0.5:
    
            for caption, action in items:
                if action and caption:
                    
                    button background None:
                        action action
                        text caption font "fonts/corbel.ttf" size 35 hover_size 37 color choice_colors[persistent.timeofday] hover_color choice_colors_hover[persistent.timeofday] text_align 0.5
                else:
                    text caption font "fonts/corbel.ttf" size 35 color choice_colors[persistent.timeofday]
persistent.timeofday is not None, and even without it and choice_colors_hover and choice_colors game still crashes. So, the problem lies elsewhere.

For now I have absolutely no ideas and my best guess that it's renpy bug.
Any help would be appreciated!
Last edited by Dreamtale on Wed Oct 16, 2013 4:04 pm, edited 1 time in total.

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

Re: Choice screen problems

#2 Post by xela » Wed Oct 16, 2013 3:47 pm

Did you try to set modal to true on choice screen? Might not fix the press enter issue but will at least hint on some other input outside of that screen (I mean if the click on screen trouble disappear afterwards)
Like what we're doing? Support us at:
Image

Dreamtale
Newbie
Posts: 24
Joined: Tue Jan 11, 2011 8:15 pm
Contact:

Re: Choice screen problems

#3 Post by Dreamtale » Wed Oct 16, 2013 4:03 pm

xela wrote:Did you try to set modal to true on choice screen? Might not fix the press enter issue but will at least hint on some other input outside of that screen (I mean if the click on screen trouble disappear afterwards)
Thanks, it helped! :D It was really that simple, and I didn't get it myself, meh :(

Post Reply

Who is online

Users browsing this forum: Google [Bot]