Nonetype is not iterable - returning from the gm to the mm

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
User avatar
DesertFox
Regular
Posts: 196
Joined: Sun Jul 28, 2013 1:29 pm
Completed: Over The Hills And Far Away
Projects: My Little Dictator
Organization: WarGirl Games
Contact:

Nonetype is not iterable - returning from the gm to the mm

#1 Post by DesertFox » Tue Mar 24, 2015 11:59 am

Recently, returning to the Main Menu from the Game Menu leads to the following traceback error.

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
TypeError: 'NoneType' object is not iterable

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "renpy/common/_layout/screen_main_menu.rpym", line 29, in script
    $ ui.interact()
  File "C:\Users\User\Downloads\renpy-6.15.7-sdk\renpy-6.15.7-sdk\renpy\ast.py", line 785, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "C:\Users\User\Downloads\renpy-6.15.7-sdk\renpy-6.15.7-sdk\renpy\python.py", line 1382, in py_exec_bytecode
    exec bytecode in globals, locals
  File "renpy/common/_layout/screen_main_menu.rpym", line 29, in <module>
    $ ui.interact()
  File "C:\Users\User\Downloads\renpy-6.15.7-sdk\renpy-6.15.7-sdk\renpy\ui.py", line 247, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "C:\Users\User\Downloads\renpy-6.15.7-sdk\renpy-6.15.7-sdk\renpy\display\core.py", line 2149, in interact
    repeat, rv = self.interact_core(preloads=preloads, **kwargs)
  File "C:\Users\User\Downloads\renpy-6.15.7-sdk\renpy-6.15.7-sdk\renpy\display\core.py", line 2478, in interact_core
    self.draw_screen(root_widget, fullscreen_video, (not fullscreen_video) or video_frame_drawn)
  File "C:\Users\User\Downloads\renpy-6.15.7-sdk\renpy-6.15.7-sdk\renpy\display\core.py", line 1677, in draw_screen
    renpy.config.screen_height,
  File "render.pyx", line 363, in renpy.display.render.render_screen (gen\renpy.display.render.c:5330)
  File "render.pyx", line 174, in renpy.display.render.render (gen\renpy.display.render.c:2537)
  File "C:\Users\User\Downloads\renpy-6.15.7-sdk\renpy-6.15.7-sdk\renpy\display\layout.py", line 618, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 98, in renpy.display.render.render (gen\renpy.display.render.c:2849)
  File "render.pyx", line 174, in renpy.display.render.render (gen\renpy.display.render.c:2537)
  File "C:\Users\User\Downloads\renpy-6.15.7-sdk\renpy-6.15.7-sdk\renpy\display\transition.py", line 361, in render
    bottom = render(self.old_widget, width, height, st, at)
  File "render.pyx", line 98, in renpy.display.render.render (gen\renpy.display.render.c:2849)
  File "render.pyx", line 174, in renpy.display.render.render (gen\renpy.display.render.c:2537)
  File "C:\Users\User\Downloads\renpy-6.15.7-sdk\renpy-6.15.7-sdk\renpy\display\layout.py", line 618, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 98, in renpy.display.render.render (gen\renpy.display.render.c:2849)
  File "render.pyx", line 174, in renpy.display.render.render (gen\renpy.display.render.c:2537)
  File "C:\Users\User\Downloads\renpy-6.15.7-sdk\renpy-6.15.7-sdk\renpy\display\layout.py", line 618, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 98, in renpy.display.render.render (gen\renpy.display.render.c:2849)
  File "render.pyx", line 174, in renpy.display.render.render (gen\renpy.display.render.c:2537)
  File "C:\Users\User\Downloads\renpy-6.15.7-sdk\renpy-6.15.7-sdk\renpy\display\screen.py", line 598, in render
    child = renpy.display.render.render(self.child, w, h, st, at)
  File "render.pyx", line 98, in renpy.display.render.render (gen\renpy.display.render.c:2849)
  File "render.pyx", line 174, in renpy.display.render.render (gen\renpy.display.render.c:2537)
  File "C:\Users\User\Downloads\renpy-6.15.7-sdk\renpy-6.15.7-sdk\renpy\display\layout.py", line 618, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 98, in renpy.display.render.render (gen\renpy.display.render.c:2849)
  File "render.pyx", line 174, in renpy.display.render.render (gen\renpy.display.render.c:2537)
  File "C:\Users\User\Downloads\renpy-6.15.7-sdk\renpy-6.15.7-sdk\renpy\display\layout.py", line 741, in render
    surf = render(d, rw, height - y, cst, cat)
  File "render.pyx", line 98, in renpy.display.render.render (gen\renpy.display.render.c:2849)
  File "render.pyx", line 174, in renpy.display.render.render (gen\renpy.display.render.c:2537)
  File "C:\Users\User\Downloads\renpy-6.15.7-sdk\renpy-6.15.7-sdk\renpy\display\behavior.py", line 596, in render
    rv = super(Button, self).render(width, height, st, at)
  File "C:\Users\User\Downloads\renpy-6.15.7-sdk\renpy-6.15.7-sdk\renpy\display\layout.py", line 964, in render
    st, at)
  File "render.pyx", line 98, in renpy.display.render.render (gen\renpy.display.render.c:2849)
  File "render.pyx", line 174, in renpy.display.render.render (gen\renpy.display.render.c:2537)
  File "C:\Users\User\Downloads\renpy-6.15.7-sdk\renpy-6.15.7-sdk\renpy\text\text.py", line 1509, in render
    layout = Layout(self, width, height, renders)
  File "C:\Users\User\Downloads\renpy-6.15.7-sdk\renpy-6.15.7-sdk\renpy\text\text.py", line 673, in __init__
    ts.draw(glyphs, di, self.add_left, self.add_top)
  File "C:\Users\User\Downloads\renpy-6.15.7-sdk\renpy-6.15.7-sdk\renpy\text\text.py", line 251, in draw
    fo.draw(di.surface, xo, yo, color, glyphs, self.underline, self.strikethrough, black_color)
  File "ftfont.pyx", line 580, in renpy.text.ftfont.FTFont.draw (gen\renpy.text.ftfont.c:4798)
TypeError: 'NoneType' object is not iterable

Windows-post2008Server-6.2.9200
Ren'Py 6.18.3.761
Over The Hills And Far Away 1.0
I'm afraid I'm not very good at reading tracebacks so I'm not certain what the exact issue is here. The only recent difference I've made that may be causing this is inside the Navigation menu with the following. I wanted to have a different navigation menu dependent on its being accessed from in-game or the main menu:

Code: Select all

screen navigation():
    if main_menu:
        add "menuback"
    else:
        null
    frame:
        style_group "yesno"
        xfill True
        yfill True
    hbox:
        style_group "mainmenu"
        xalign 0.5
        yalign 0.92
        textbutton _("R E T U R N") action Return()
        null width 25
        if main_menu:
            null
        else:
            textbutton _("S A V E   D A T A") action ShowMenu("save")
        null width 25
        textbutton _("L O A D   D A T A") action ShowMenu("load")
        null width 25
        textbutton _("C O N F I G U R E") action ShowMenu("preferences")
        null width 25
        if main_menu:
            null
        else:
            textbutton _("T I T L E") action MainMenu()
        null width 25
        textbutton _("W E B") action OpenURL ("http://war-girl.com/")
        null width 25
        textbutton _("Q U I T   G A M E") action Quit()   
Any thoughts?

User avatar
Queex
Regular
Posts: 46
Joined: Sat Mar 14, 2015 9:47 am
Contact:

Re: Nonetype is not iterable - returning from the gm to the

#2 Post by Queex » Tue Mar 24, 2015 12:13 pm

Not sure, but I think the nulls in there are the problem.

Instead try:

Code: Select all

        if not main_menu:
            textbutton _("S A V E   D A T A") action ShowMenu("save")
And the same for the other use of null.

User avatar
DesertFox
Regular
Posts: 196
Joined: Sun Jul 28, 2013 1:29 pm
Completed: Over The Hills And Far Away
Projects: My Little Dictator
Organization: WarGirl Games
Contact:

Re: Nonetype is not iterable - returning from the gm to the

#3 Post by DesertFox » Tue Mar 24, 2015 12:38 pm

That didn't do the trick, I'm still getting the traceback :/

User avatar
PyTom
Ren'Py Creator
Posts: 15893
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:

Re: Nonetype is not iterable - returning from the gm to the

#4 Post by PyTom » Tue Mar 24, 2015 12:44 pm

It's not the nulls - it's more likely that a None is somehow making it into the text rendering code. If you can't figure out from where, send me the code and I'll try to figure out what's going wrong.
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

User avatar
DesertFox
Regular
Posts: 196
Joined: Sun Jul 28, 2013 1:29 pm
Completed: Over The Hills And Far Away
Projects: My Little Dictator
Organization: WarGirl Games
Contact:

Re: Nonetype is not iterable - returning from the gm to the

#5 Post by DesertFox » Tue Mar 24, 2015 12:48 pm

Never mind, I found out what it was. For some reason I had an 'insensitive_color None' in the style group for the main menu buttons. Not sure how that got in there.

Thank you for the help! :)

Post Reply

Who is online

Users browsing this forum: Google [Bot]