unsupported operand type(s) for +: 'NoneType' and 'NoneType'

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
ShojiAmasawa
Veteran
Posts: 211
Joined: Fri May 11, 2012 5:26 pm
Completed: EVOLVEd: Echoes Of The Codex War, [ASH] the Seeds of Destruction
Projects: Cult of the Lily (18+)
Organization: PaperDoor Studios
Tumblr: paperdoorstudios
Deviantart: ShojiAmasawa
Soundcloud: Greyberry
Location: Cloudbase
Contact:

unsupported operand type(s) for +: 'NoneType' and 'NoneType'

#1 Post by ShojiAmasawa » Sat Nov 07, 2015 9:51 pm

Not entirely sure what to make of this. The last time I opened the project it worked fine, and no changes have been made since then. Every time I start up my project from the main menu, I get this message. I included the full traceback for maximum detail. Any help would be appreciated! I looked for this problem I could not find anyone else talking about it.

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 44, in script
    "The day could not have been more ordinary. As usual, my dear friend Jefrey Goodfellow and I, Byron Thomas, arrived at our clinic early in the morning, expectant of clients."
TypeError: unsupported operand type(s) for +: 'NoneType' and 'NoneType'

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

Full traceback:
  File "game/script.rpy", line 44, in script
    "The day could not have been more ordinary. As usual, my dear friend Jefrey Goodfellow and I, Byron Thomas, arrived at our clinic early in the morning, expectant of clients."
  File "/Applications/renpy-6.99.6-sdk/renpy/ast.py", line 594, in execute
    renpy.exports.say(who, what, interact=self.interact)
  File "/Applications/renpy-6.99.6-sdk/renpy/exports.py", line 1032, in say
    who(what, interact=interact)
  File "/Applications/renpy-6.99.6-sdk/renpy/character.py", line 826, in __call__
    self.do_display(who, what, cb_args=self.cb_args, **display_args)
  File "/Applications/renpy-6.99.6-sdk/renpy/character.py", line 688, in do_display
    **display_args)
  File "/Applications/renpy-6.99.6-sdk/renpy/character.py", line 491, in display_say
    rv = renpy.ui.interact(mouse='say', type=type, roll_forward=roll_forward)
  File "/Applications/renpy-6.99.6-sdk/renpy/ui.py", line 277, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "/Applications/renpy-6.99.6-sdk/renpy/display/core.py", line 2346, in interact
    repeat, rv = self.interact_core(preloads=preloads, **kwargs)
  File "/Applications/renpy-6.99.6-sdk/renpy/display/core.py", line 2683, in interact_core
    self.draw_screen(root_widget, fullscreen_video, (not fullscreen_video) or video_frame_drawn)
  File "/Applications/renpy-6.99.6-sdk/renpy/display/core.py", line 1785, in draw_screen
    renpy.config.screen_height,
  File "renpy/display/render.pyx", line 394, in renpy.display.render.render_screen (gen/renpy.display.render.c:6190)
    rv = render(root, width, height, 0, 0)
  File "renpy/display/render.pyx", line 185, in renpy.display.render.render (gen/renpy.display.render.c:2721)
    rv = d.render(widtho, heighto, st, at)
  File "/Applications/renpy-6.99.6-sdk/renpy/display/layout.py", line 650, in render
    surf = render(child, width, height, cst, cat)
  File "renpy/display/render.pyx", line 103, in renpy.display.render.render (gen/renpy.display.render.c:3104)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 185, in renpy.display.render.render (gen/renpy.display.render.c:2721)
    rv = d.render(widtho, heighto, st, at)
  File "/Applications/renpy-6.99.6-sdk/renpy/display/layout.py", line 650, in render
    surf = render(child, width, height, cst, cat)
  File "renpy/display/render.pyx", line 103, in renpy.display.render.render (gen/renpy.display.render.c:3104)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 185, in renpy.display.render.render (gen/renpy.display.render.c:2721)
    rv = d.render(widtho, heighto, st, at)
  File "/Applications/renpy-6.99.6-sdk/renpy/display/layout.py", line 650, in render
    surf = render(child, width, height, cst, cat)
  File "renpy/display/render.pyx", line 103, in renpy.display.render.render (gen/renpy.display.render.c:3104)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 185, in renpy.display.render.render (gen/renpy.display.render.c:2721)
    rv = d.render(widtho, heighto, st, at)
  File "/Applications/renpy-6.99.6-sdk/renpy/display/screen.py", line 610, in render
    child = renpy.display.render.render(self.child, w, h, st, at)
  File "renpy/display/render.pyx", line 103, in renpy.display.render.render (gen/renpy.display.render.c:3104)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 185, in renpy.display.render.render (gen/renpy.display.render.c:2721)
    rv = d.render(widtho, heighto, st, at)
  File "/Applications/renpy-6.99.6-sdk/renpy/display/layout.py", line 650, in render
    surf = render(child, width, height, cst, cat)
  File "renpy/display/render.pyx", line 103, in renpy.display.render.render (gen/renpy.display.render.c:3104)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 185, in renpy.display.render.render (gen/renpy.display.render.c:2721)
    rv = d.render(widtho, heighto, st, at)
  File "/Applications/renpy-6.99.6-sdk/renpy/display/layout.py", line 1015, in render
    back = render(style.background, bw, bh, st, at)
  File "renpy/display/render.pyx", line 103, in renpy.display.render.render (gen/renpy.display.render.c:3104)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 185, in renpy.display.render.render (gen/renpy.display.render.c:2721)
    rv = d.render(widtho, heighto, st, at)
  File "/Applications/renpy-6.99.6-sdk/renpy/display/imagelike.py", line 195, in render
    bw = self.left + self.right
TypeError: unsupported operand type(s) for +: 'NoneType' and 'NoneType'

Darwin-15.0.0-x86_64-i386-64bit
Ren'Py 6.99.6.739
Cult of the Lily 0.0

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: unsupported operand type(s) for +: 'NoneType' and 'NoneT

#2 Post by PyTom » Sun Nov 08, 2015 1:13 am

Can you try 6.99.7? ISTR this might have been a known bug that's fixed there.

If that doesn't work, look for a Frame without the two size arguments.
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
ShojiAmasawa
Veteran
Posts: 211
Joined: Fri May 11, 2012 5:26 pm
Completed: EVOLVEd: Echoes Of The Codex War, [ASH] the Seeds of Destruction
Projects: Cult of the Lily (18+)
Organization: PaperDoor Studios
Tumblr: paperdoorstudios
Deviantart: ShojiAmasawa
Soundcloud: Greyberry
Location: Cloudbase
Contact:

Re: unsupported operand type(s) for +: 'NoneType' and 'NoneT

#3 Post by ShojiAmasawa » Sun Nov 08, 2015 12:59 pm

PyTom wrote:Can you try 6.99.7? ISTR this might have been a known bug that's fixed there.

If that doesn't work, look for a Frame without the two size arguments.
I updated, but I still get the same problem. And I am very sorry, but I am not sure what you mean by "two size arguments". I guess I don't really have much knowledge of the terminology ... What exactly does that mean?

Thanks.

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: unsupported operand type(s) for +: 'NoneType' and 'NoneT

#4 Post by PyTom » Sun Nov 08, 2015 1:04 pm

I think you'd get a problem like this if you have something like:

Frame("foo.png")

rather than

Frame("foo.png, 0, 0)
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
ShojiAmasawa
Veteran
Posts: 211
Joined: Fri May 11, 2012 5:26 pm
Completed: EVOLVEd: Echoes Of The Codex War, [ASH] the Seeds of Destruction
Projects: Cult of the Lily (18+)
Organization: PaperDoor Studios
Tumblr: paperdoorstudios
Deviantart: ShojiAmasawa
Soundcloud: Greyberry
Location: Cloudbase
Contact:

Re: unsupported operand type(s) for +: 'NoneType' and 'NoneT

#5 Post by ShojiAmasawa » Sun Nov 08, 2015 1:40 pm

That definitely helps narrow it down, unfortunately I have several different lines of code that could qualify for that. I have tried them each individually (paying special attention to one with 0, 0) but I am still getting the same message. No change as far as I can tell.

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: unsupported operand type(s) for +: 'NoneType' and 'NoneT

#6 Post by PyTom » Mon Nov 09, 2015 11:00 pm

Post the code somewhere, with a jump to right before the error. I can debug this myself.
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
ShojiAmasawa
Veteran
Posts: 211
Joined: Fri May 11, 2012 5:26 pm
Completed: EVOLVEd: Echoes Of The Codex War, [ASH] the Seeds of Destruction
Projects: Cult of the Lily (18+)
Organization: PaperDoor Studios
Tumblr: paperdoorstudios
Deviantart: ShojiAmasawa
Soundcloud: Greyberry
Location: Cloudbase
Contact:

Re: unsupported operand type(s) for +: 'NoneType' and 'NoneT

#7 Post by ShojiAmasawa » Tue Nov 10, 2015 11:20 pm

PyTom wrote:Post the code somewhere, with a jump to right before the error. I can debug this myself.
Since the error happens as soon as Start Game is clicked, I don't know what else to do besides paste the most likely causes, as well as some other bits which may be useful.

The error message: http://pastebin.com/embed_js.php?i=BWiym4ai
The script: http://pastebin.com/embed_js.php?i=d4ZCVUAu
The options: http://pastebin.com/embed_js.php?i=nFkYJNf8

Thank you! I hope this is enough information.

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: unsupported operand type(s) for +: 'NoneType' and 'NoneT

#8 Post by PyTom » Thu Nov 12, 2015 2:54 am

Post the built game. I need to run the game to debug it - and it's hard to run through code someone has posted, without the whole thing present.
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
ShojiAmasawa
Veteran
Posts: 211
Joined: Fri May 11, 2012 5:26 pm
Completed: EVOLVEd: Echoes Of The Codex War, [ASH] the Seeds of Destruction
Projects: Cult of the Lily (18+)
Organization: PaperDoor Studios
Tumblr: paperdoorstudios
Deviantart: ShojiAmasawa
Soundcloud: Greyberry
Location: Cloudbase
Contact:

Re: unsupported operand type(s) for +: 'NoneType' and 'NoneT

#9 Post by ShojiAmasawa » Fri Nov 13, 2015 10:32 pm

PyTom wrote:Post the built game. I need to run the game to debug it - and it's hard to run through code someone has posted, without the whole thing present.
I meant to do this much earlier but long story short, I accidentally deleted the game. Thankfully I had a backup, so at long last here is the build. Some NSFW images and writing, I suppose I should say.

There is a build for Mac, Windows, and Linux. https://app.box.com/s/3j6hhld8avkjfy5qdgsuvj8whcug3wzn

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: unsupported operand type(s) for +: 'NoneType' and 'NoneT

#10 Post by PyTom » Sun Nov 15, 2015 12:46 pm

There are two places in options.rpy where you have

Code: Select all

style.<something>.background = Frame("Blank_1280x720.png")
it would be valid, if wasteful, to change it to:

Code: Select all

style.<something>.background = Frame("Blank_1280x720.png", 0, 0)
[code]

But far better would be to get rid of the background entirely.

[code]
style.<something>.background = None
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
ShojiAmasawa
Veteran
Posts: 211
Joined: Fri May 11, 2012 5:26 pm
Completed: EVOLVEd: Echoes Of The Codex War, [ASH] the Seeds of Destruction
Projects: Cult of the Lily (18+)
Organization: PaperDoor Studios
Tumblr: paperdoorstudios
Deviantart: ShojiAmasawa
Soundcloud: Greyberry
Location: Cloudbase
Contact:

Re: unsupported operand type(s) for +: 'NoneType' and 'NoneT

#11 Post by ShojiAmasawa » Thu Feb 11, 2016 8:14 pm

Pytom, thank you for helping me. I am sorry I forgot to in the first place. Thankfully this was exactly what I needed to fix the problem, and the game is going smoothly now!

Post Reply

Who is online

Users browsing this forum: Bing [Bot]