ProjectAliceDev / aliceos-classic

A virtual operating system framework for Ren'Py projects
https://aliceos.app
GNU Lesser General Public License v3.0
7 stars 1 forks source link

TypeError non-iterable NoneType object when loading blocked notification from save point #22

Closed cpgyuri closed 6 years ago

cpgyuri commented 6 years ago

Version of AliceOS Technical Preview 1

Describe the bug Everytime I save and then load Doki Forces, be after closing the game or not, when the game reaches a part in which a Ren'py alert screen or an AliceOS alert or notification pop-up must appear, the game crashes with a TypeError: argument of type 'NoneType' is not iterable bug. The first time it happens is when Ren'Py had to show the "Hint: you can skip..." alert. After I got this error, all my saves become unstable, and if it's a save in the poem minigame when this happens, it doesn't load again.

To Reproduce Steps to reproduce the behavior:

  1. Save your game. Optionally close the game and open it again.
  2. Click on Load and load your save.
  3. Skip or advance the game to a part of the script in which a Ren'py or AliceOS alert must show.
  4. See the error.

Expected behavior The game was expected to show the Ren'Py notification dialog or the AliceOS alert or notification pop-up, but it crashes to the error instead. Since AliceOS replaces the Ren'Py dialogue and alert interfaces, the Ren'Py standard alerts crash too.

Screenshots Added screenshot and traceback.txt. captura2

Desktop (please complete the following information):

Smartphone (please complete the following information): not aplicable.

Traceback (if provided)

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 63, in script call
    call chapter2_mid from _call_chapter2_mid
  File "game/studiopolisCh2b.rpy", line 6, in script call
    call expression nextscene
  File "game/script-exclusives-monika.rpy", line 175, in script
    $ forces.edmsession_music("Hardwell & KSHMR - Power")
  File "game/script-exclusives-monika.rpy", line 175, in <module>
    $ forces.edmsession_music("Hardwell & KSHMR - Power")
  File "game/Applets/Forces/Forces.rpy", line 51, in edmsession_music
    self.send_temporary_notification("DJ Sona", "You are listening to: " + song + "!", action=Return(1))
  File "game/Frameworks/Applets.rpy", line 110, in send_temporary_notification
    renpy.call_screen("alert", title="Notifications Are Disabled", message="Notifications are disabled for this Applet. Please check your permissions.", ok_action=Return(1))
TypeError: argument of type 'NoneType' is not iterable

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

Full traceback:
  File "game/script.rpy", line 63, in script call
    call chapter2_mid from _call_chapter2_mid
  File "game/studiopolisCh2b.rpy", line 6, in script call
    call expression nextscene
  File "game/script-exclusives-monika.rpy", line 175, in script
    $ forces.edmsession_music("Hardwell & KSHMR - Power")
  File "C:\Users\Neil\Desktop\RenPy\renpy-6.99.12.4-sdk\renpy\ast.py", line 814, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "C:\Users\Neil\Desktop\RenPy\renpy-6.99.12.4-sdk\renpy\python.py", line 1719, in py_exec_bytecode
    exec bytecode in globals, locals
  File "game/script-exclusives-monika.rpy", line 175, in <module>
    $ forces.edmsession_music("Hardwell & KSHMR - Power")
  File "game/Applets/Forces/Forces.rpy", line 51, in edmsession_music
    self.send_temporary_notification("DJ Sona", "You are listening to: " + song + "!", action=Return(1))
  File "game/Frameworks/Applets.rpy", line 110, in send_temporary_notification
    renpy.call_screen("alert", title="Notifications Are Disabled", message="Notifications are disabled for this Applet. Please check your permissions.", ok_action=Return(1))
  File "C:\Users\Neil\Desktop\RenPy\renpy-6.99.12.4-sdk\renpy\exports.py", line 2526, in call_screen
    rv = renpy.ui.interact(mouse="screen", type="screen", roll_forward=roll_forward)
  File "C:\Users\Neil\Desktop\RenPy\renpy-6.99.12.4-sdk\renpy\ui.py", line 285, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "C:\Users\Neil\Desktop\RenPy\renpy-6.99.12.4-sdk\renpy\display\core.py", line 2526, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "C:\Users\Neil\Desktop\RenPy\renpy-6.99.12.4-sdk\renpy\display\core.py", line 2883, in interact_core
    self.draw_screen(root_widget, fullscreen_video, (not fullscreen_video) or video_frame_drawn)
  File "C:\Users\Neil\Desktop\RenPy\renpy-6.99.12.4-sdk\renpy\display\core.py", line 1955, in draw_screen
    renpy.config.screen_height,
  File "renpy/display/render.pyx", line 427, in renpy.display.render.render_screen (gen\renpy.display.render.c:6806)
    rv = render(root, width, height, 0, 0)
  File "renpy/display/render.pyx", line 196, in renpy.display.render.render (gen\renpy.display.render.c:2978)
    rv = d.render(widtho, heighto, st, at)
  File "C:\Users\Neil\Desktop\RenPy\renpy-6.99.12.4-sdk\renpy\display\layout.py", line 693, in render
    surf = render(child, width, height, cst, cat)
  File "renpy/display/render.pyx", line 110, in renpy.display.render.render (gen\renpy.display.render.c:3440)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 196, in renpy.display.render.render (gen\renpy.display.render.c:2978)
    rv = d.render(widtho, heighto, st, at)
  File "C:\Users\Neil\Desktop\RenPy\renpy-6.99.12.4-sdk\renpy\display\layout.py", line 693, in render
    surf = render(child, width, height, cst, cat)
  File "renpy/display/render.pyx", line 110, in renpy.display.render.render (gen\renpy.display.render.c:3440)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 196, in renpy.display.render.render (gen\renpy.display.render.c:2978)
    rv = d.render(widtho, heighto, st, at)
  File "C:\Users\Neil\Desktop\RenPy\renpy-6.99.12.4-sdk\renpy\display\layout.py", line 693, in render
    surf = render(child, width, height, cst, cat)
  File "renpy/display/render.pyx", line 110, in renpy.display.render.render (gen\renpy.display.render.c:3440)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 196, in renpy.display.render.render (gen\renpy.display.render.c:2978)
    rv = d.render(widtho, heighto, st, at)
  File "C:\Users\Neil\Desktop\RenPy\renpy-6.99.12.4-sdk\renpy\display\screen.py", line 623, in render
    child = renpy.display.render.render(self.child, w, h, st, at)
  File "renpy/display/render.pyx", line 110, in renpy.display.render.render (gen\renpy.display.render.c:3440)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 196, in renpy.display.render.render (gen\renpy.display.render.c:2978)
    rv = d.render(widtho, heighto, st, at)
  File "C:\Users\Neil\Desktop\RenPy\renpy-6.99.12.4-sdk\renpy\display\layout.py", line 693, in render
    surf = render(child, width, height, cst, cat)
  File "renpy/display/render.pyx", line 110, in renpy.display.render.render (gen\renpy.display.render.c:3440)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 196, in renpy.display.render.render (gen\renpy.display.render.c:2978)
    rv = d.render(widtho, heighto, st, at)
  File "C:\Users\Neil\Desktop\RenPy\renpy-6.99.12.4-sdk\renpy\display\layout.py", line 1081, in render
    st, at)
  File "renpy/display/render.pyx", line 110, in renpy.display.render.render (gen\renpy.display.render.c:3440)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 196, in renpy.display.render.render (gen\renpy.display.render.c:2978)
    rv = d.render(widtho, heighto, st, at)
  File "C:\Users\Neil\Desktop\RenPy\renpy-6.99.12.4-sdk\renpy\display\layout.py", line 895, in render
    surf = render(d, width - x, rh, cst, cat)
  File "renpy/display/render.pyx", line 110, in renpy.display.render.render (gen\renpy.display.render.c:3440)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 196, in renpy.display.render.render (gen\renpy.display.render.c:2978)
    rv = d.render(widtho, heighto, st, at)
  File "C:\Users\Neil\Desktop\RenPy\renpy-6.99.12.4-sdk\renpy\display\layout.py", line 1081, in render
    st, at)
  File "renpy/display/render.pyx", line 110, in renpy.display.render.render (gen\renpy.display.render.c:3440)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 196, in renpy.display.render.render (gen\renpy.display.render.c:2978)
    rv = d.render(widtho, heighto, st, at)
  File "C:\Users\Neil\Desktop\RenPy\renpy-6.99.12.4-sdk\renpy\text\text.py", line 1732, in render
    virtual_layout = Layout(self, width, height, renders, drawable_res=False, size_only=True)
  File "C:\Users\Neil\Desktop\RenPy\renpy-6.99.12.4-sdk\renpy\text\text.py", line 574, in __init__
    glyphs = ts.glyphs(s, self)
  File "C:\Users\Neil\Desktop\RenPy\renpy-6.99.12.4-sdk\renpy\text\text.py", line 236, in glyphs
    fo = font.get_font(self.font, self.size, self.bold, self.italic, 0, self.antialias, self.vertical, self.hinting, layout.oversample)
  File "C:\Users\Neil\Desktop\RenPy\renpy-6.99.12.4-sdk\renpy\text\font.py", line 648, in get_font
    face = load_face(fn)
  File "C:\Users\Neil\Desktop\RenPy\renpy-6.99.12.4-sdk\renpy\text\font.py", line 558, in load_face
    if "@" in fn:
TypeError: argument of type 'NoneType' is not iterable

Windows-8-6.2.9200
Ren'Py 6.99.12.4.2187
Doki Doki Forces DokiDokiForcesBeta6

Additional context The notification that was about to show when the error happened is one about that you didn't give permissions to your AliceOS applets. This happens everytime i open my game again or load a save. It's very frustating that you have to program in each chapter the "give permissions" dialogue or the "override perms" code.

alicerunsonfedora commented 6 years ago

Did you have the Applet ask for permissions at the vert start of the game? Notifications are user-controlled, meaning that the user must grant an Applet permission to display notifications.

cpgyuri commented 6 years ago

My concern is not about the applet permissions, but to the nasty bug which is very detrimental to the experience, but replying your question, I ask for permissions of the applet at the very start of the game, but everytime I open the game again after closing it, it seems the game doesn't save the permissions and if I don't ask for them again, it tries to show the "Permissions disabled" alert.

Tl;dr: I ask for permissions, but the permission values are lost everytime I open the game again, even if I do a save with the permissions granted.

alicerunsonfedora commented 6 years ago

Just confirmed this is applicable to all versions of AliceOS.

cpgyuri commented 6 years ago

So it's not a bug of my mod then?

cpgyuri commented 6 years ago

I want to add that this bug affects all alerts, since AliceOS replaces the way how Ren'Py shows its original alerts. For example, the "Hint: you can skip the text" and the "Do you want to quit?" alerts of Ren'py after re-loading save for the first time or closing the game shows the alert with the white Material window and the fonts of AliceOS.

If i try to quit the game after the error shows the first time, the game DOESN'T close or show the "Do you want to quit" dialog, and keeps showing errors for each line of the script.

cpgyuri commented 6 years ago

captura2 Bug after trying to close the game normally after getting the TypeError bug. (The dialogue box about closing your game never shows and you can't close the game normally, except for the Quit button of the error screen).

alicerunsonfedora commented 6 years ago

Problem has now been traced down to an issue with OEM fonts resulting in blank values for styles.