renpy / renpy

The Ren'Py Visual Novel Engine
http://www.renpy.org/
5.04k stars 705 forks source link

Error occurred when using the text shader tag #5711

Closed Noriverwater closed 2 months ago

Noriverwater commented 2 months ago
I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 24, in script
    e "What's this? A letter {shader=zoom}from out of nowhere?{/shader}"
AttributeError: 'NoneType' object has no attribute 'key'

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

Full traceback:
  File "game/script.rpy", line 24, in script
    e "What's this? A letter {shader=zoom}from out of nowhere?{/shader}"
  File "D:\program files\renpy-sdk\renpy\ast.py", line 2572, in execute
    Say.execute(self)
  File "D:\program files\renpy-sdk\renpy\ast.py", line 615, in execute
    renpy.exports.say(who, what, *args, **kwargs)
  File "D:\program files\renpy-sdk\renpy\exports\sayexports.py", line 132, in say
    who(what, *args, **kwargs)
  File "D:\program files\renpy-sdk\renpy\character.py", line 1451, in __call__
    self.do_display(who, what, cb_args=self.cb_args, dtt=dtt, **display_args)
  File "D:\program files\renpy-sdk\renpy\character.py", line 1102, in do_display
    display_say(who,
  File "D:\program files\renpy-sdk\renpy\character.py", line 799, in display_say
    rv = renpy.ui.interact(mouse='say', type=type, roll_forward=roll_forward)
  File "D:\program files\renpy-sdk\renpy\ui.py", line 301, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "D:\program files\renpy-sdk\renpy\display\core.py", line 2188, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, pause=pause, pause_start=pause_start, pause_modal=pause_modal, **kwargs) # type: ignore
  File "D:\program files\renpy-sdk\renpy\display\core.py", line 2836, in interact_core
    self.draw_screen(root_widget, fullscreen_video, (not fullscreen_video) or video_frame_drawn)
  File "D:\program files\renpy-sdk\renpy\display\core.py", line 1354, in draw_screen
    surftree = renpy.display.render.render_screen(
  File "render.pyx", line 486, in renpy.display.render.render_screen
  File "render.pyx", line 260, in renpy.display.render.render
  File "D:\program files\renpy-sdk\renpy\display\layout.py", line 903, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 170, in renpy.display.render.render
  File "render.pyx", line 260, in renpy.display.render.render
  File "D:\program files\renpy-sdk\renpy\display\layout.py", line 903, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 170, in renpy.display.render.render
  File "render.pyx", line 260, in renpy.display.render.render
  File "D:\program files\renpy-sdk\renpy\display\layout.py", line 903, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 170, in renpy.display.render.render
  File "render.pyx", line 260, in renpy.display.render.render
  File "D:\program files\renpy-sdk\renpy\display\screen.py", line 754, in render
    child = renpy.display.render.render(self.child, w, h, st, at)
  File "render.pyx", line 170, in renpy.display.render.render
  File "render.pyx", line 260, in renpy.display.render.render
  File "D:\program files\renpy-sdk\renpy\display\layout.py", line 903, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 170, in renpy.display.render.render
  File "render.pyx", line 260, in renpy.display.render.render
  File "D:\program files\renpy-sdk\renpy\display\layout.py", line 1454, in render
    surf = render(child,
  File "render.pyx", line 170, in renpy.display.render.render
  File "render.pyx", line 260, in renpy.display.render.render
  File "D:\program files\renpy-sdk\renpy\display\layout.py", line 903, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 170, in renpy.display.render.render
  File "render.pyx", line 260, in renpy.display.render.render
  File "D:\program files\renpy-sdk\renpy\text\text.py", line 2509, in render
    layout = Layout(self, width, height, renders, splits_from=virtual_layout)
  File "D:\program files\renpy-sdk\renpy\text\text.py", line 992, in __init__
    mr = self.create_mesh_displayable(o, tex, lines, xo, yo, depth, ts)
  File "D:\program files\renpy-sdk\renpy\text\text.py", line 1729, in create_mesh_displayable
    if (g.shader is not ts) and (g.shader != ts):
  File "D:\program files\renpy-sdk\renpy\text\shader.py", line 176, in __eq__
    return self.key == other.key
AttributeError: 'NoneType' object has no attribute 'key'

Windows-10-10.0.22621 AMD64
Ren'Py 8.3.0.24081503+nightly
dcc 1.0
Sat Aug 17 13:23:29 2024
renpytom commented 2 months ago

Do you have a default shader defined?

renpytom commented 2 months ago

I checked, and this is the error you get if textshaders are not in use. It's a terrible error, so I've changed it to be more informative.

You can fix the underlying issue by adding:

define config.default_textshader = "typewriter"

to your game.