Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

hello!

I'm having this weird bug that happens every other time i try to switch between tags of characters.

I'm not sure what triggers it, but here is the code ^^"

[code]

I'm sorry, but an uncaught exception occurred.

While running game code:

  File "game/image_tools/layered_image_visualizer.rpy", line 895, in event

    x = x / self.width

        ~~^~~~~~~~~~~~

ZeroDivisionError: float division by zero

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

Traceback (most recent call last):

  File "renpy/common/_layout/screen_main_menu.rpym", line 28, in script

    python hide:

  File "renpy/ast.py", line 1193, in execute

    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "renpy/python.py", line 1276, in py_exec_bytecode

    exec(bytecode, globals, locals)

    ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "renpy/common/_layout/screen_main_menu.rpym", line 28, in <module>

    python hide:

  File "renpy/common/_layout/screen_main_menu.rpym", line 35, in _execute_python_hide

    ui.interact()

    ~~~~~~~~~~~^^

  File "renpy/ui.py", line 306, in interact

    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)

         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "renpy/display/core.py", line 2163, in interact

    repeat, rv = self.interact_core(

                 ~~~~~~~~~~~~~~~~~~^

        preloads=preloads,

        ^^^^^^^^^^^^^^^^^^

    ...<4 lines>...

        **kwargs,

        ^^^^^^^^^

    )

    ^

  File "renpy/display/core.py", line 3263, in interact_core

    rv = root_widget.event(ev, x, y, 0)

         ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^

  File "renpy/display/layout.py", line 1281, in event

    rv = i.event(ev, x - xo, y - yo, cst)

         ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^

  File "renpy/display/transition.py", line 51, in event

    return self.new_widget.event(ev, x, y, st)  # E1101

           ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^         

  File "renpy/display/layout.py", line 1281, in event

    rv = i.event(ev, x - xo, y - yo, cst)

         ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^

  File "renpy/display/layout.py", line 1281, in event

    rv = i.event(ev, x - xo, y - yo, cst)

         ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^

  File "renpy/display/screen.py", line 805, in event

    rv = self.child.event(ev, x, y, st)

         ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^

  File "renpy/display/layout.py", line 1281, in event

    rv = i.event(ev, x - xo, y - yo, cst)

         ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^

  File "renpy/display/layout.py", line 1281, in event

    rv = i.event(ev, x - xo, y - yo, cst)

         ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^

  File "renpy/display/layout.py", line 1281, in event

    rv = i.event(ev, x - xo, y - yo, cst)

         ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^

[Previous line repeated 1 more time]

  File "game/image_tools/layered_image_visualizer.rpy", line 895, in event

    x = x / self.width

        ~~^~~~~~~~~~~~

ZeroDivisionError: float division by zero

Windows-11-10.0.26200-SP0 AMD64

Ren'Py 8.5.3.26051504

Pearls of Foam 

Thu Sep 17 18:06:20 2026

[/code]

Are the characters you're switching between layered images? Can you show me an example of two layered image declarations you're switching between which causes this issue? 

I should also note in this thread there was someone with a similar issue, which they ran into because their layered image did not have default attributes and thus the base image would show nothing at all unless attributes were added, which can cause this error because the image has no size by default

I'm not sure? like we have the sprites be a displayed lower than they are, to help with any jump animations we put

This is one of the defined characters:

layeredimage Judy:

    at sprite_highlight('Judy')

    ypos 1200

    zoom 1.15

    #base

    group body:

        attribute neucloth:

            "images/Judy/Jlayered/cl-J_neutralbody.png"

        attribute crosscloth:

            "images/Judy/Jlayered/cl-J_arms_crossed.png"

        attribute bikineu:

            "images/Judy/Jlayered/bikini-J_neutralbody.png"

        attribute bikicross:

            "images/Judy/Jlayered/bikini-J_arms_crossed.png"

    #eyebrows

    group brows:

    ##NEW SAD BROW

        attribute sad:

            "Judy/Jlayered/judy_eyebrows_sad.png"

        attribute frown:

            "images/Judy/Jlayered/brows_frown.png"

        attribute nebrow:

            "images/Judy/Jlayered/brows_neutral.png"

        attribute raised:

            "images/Judy/Jlayered/brows_raised.png"

    #eyes

    group eyes:

    ##NEW EYES CLOSED

        attribute closedeye:

            "Judy/Jlayered/judy_eyes_closed.png"

        attribute neueye:

            "images/Judy/Jlayered/eyes_neutral.png"

    #mouth

    group mouth:

    ##NEW NEUTRAL TALK

        attribute neutraltalk:

            "Judy/Jlayered/judy_mouth_neutral_talk.png"

        attribute closed:

            "images/Judy/Jlayered/mouth_closed_flat.png"

        attribute neutralsmile:

            "images/Judy/Jlayered/mouth_neutral_smile.png"

        attribute ah:

            "images/Judy/Jlayered/mouth_ah.png"

Yeah you don't have any default attributes or `always` images. If you just did `show Judy` it would be a completely blank image. Adjust it to something like `attribute neucloth default:` so that there's always a body layer shown at minimum (and you probably want to do the same for brows/eyes/etc).

ahhh, I see. tysm for the reply! I will fix that ^^