zer0fixer / MAS-Extraplus

A submod that adds an Extra+ button, as well as adding more content for Monika After Story.
54 stars 14 forks source link

Index out of range for chibika (on Linux) #34

Open AlexisGamero opened 2 weeks ago

AlexisGamero commented 2 weeks ago

Problem Description

The problem that I find is an IndexError.

Log

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/Submods/ExtraPlus/Extra_Plus_Labels.rpy", line 6, in script
    python:
  File "game/Submods/ExtraPlus/Extra_Plus_Labels.rpy", line 11, in <module>
    Extraplus_show()
  File "game/Submods/ExtraPlus/Extra_Plus_Main.rpy", line 267, in Extraplus_show
    renpy.call_screen("submod_interactions")
  File "game/Submods/ExtraPlus/Extra_Plus_Main.rpy", line 310, in draw_sprites
    chibi_sprites_0_max = chibi_sprites_0[min(persistent.chibi_accessory_layer_1, len(chibi_sprites_0) - 1)]
IndexError: list index out of range

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

Full traceback:
  File "game/Submods/ExtraPlus/Extra_Plus_Labels.rpy", line 6, in script
    python:
  File "/media/alexis/Data/DDLC-1.1.1-pc/renpy/ast.py", line 814, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "/media/alexis/Data/DDLC-1.1.1-pc/renpy/python.py", line 1719, in py_exec_bytecode
    exec bytecode in globals, locals
  File "game/Submods/ExtraPlus/Extra_Plus_Labels.rpy", line 11, in <module>
    Extraplus_show()
  File "game/Submods/ExtraPlus/Extra_Plus_Main.rpy", line 267, in Extraplus_show
    renpy.call_screen("submod_interactions")
  File "/media/alexis/Data/DDLC-1.1.1-pc/renpy/exports.py", line 2526, in call_screen
    rv = renpy.ui.interact(mouse="screen", type="screen", roll_forward=roll_forward)
  File "/media/alexis/Data/DDLC-1.1.1-pc/renpy/ui.py", line 285, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "/media/alexis/Data/DDLC-1.1.1-pc/renpy/display/core.py", line 2526, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "/media/alexis/Data/DDLC-1.1.1-pc/renpy/display/core.py", line 2883, in interact_core
    self.draw_screen(root_widget, fullscreen_video, (not fullscreen_video) or video_frame_drawn)
  File "/media/alexis/Data/DDLC-1.1.1-pc/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 "/media/alexis/Data/DDLC-1.1.1-pc/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 "/media/alexis/Data/DDLC-1.1.1-pc/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 "/media/alexis/Data/DDLC-1.1.1-pc/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 "/media/alexis/Data/DDLC-1.1.1-pc/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 "/media/alexis/Data/DDLC-1.1.1-pc/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 "/media/alexis/Data/DDLC-1.1.1-pc/renpy/display/dragdrop.py", line 377, in render
    cr = render(child, width, height, 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 "/media/alexis/Data/DDLC-1.1.1-pc/renpy/display/image.py", line 387, in render
    return wrap_render(self.target, width, height, st, at)
  File "/media/alexis/Data/DDLC-1.1.1-pc/renpy/display/image.py", line 208, in wrap_render
    rend = render(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 "/media/alexis/Data/DDLC-1.1.1-pc/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 "/media/alexis/Data/DDLC-1.1.1-pc/renpy/display/layout.py", line 318, in render
    surf = render(self.child, width, height, 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 "/media/alexis/Data/DDLC-1.1.1-pc/renpy/display/layout.py", line 1222, in render
    self.update(st, at)
  File "/media/alexis/Data/DDLC-1.1.1-pc/renpy/display/layout.py", line 1209, in update
    child, redraw = self.function(st, at, *self.args, **self.kwargs)
  File "game/Submods/ExtraPlus/Extra_Plus_Main.rpy", line 310, in draw_sprites
    chibi_sprites_0_max = chibi_sprites_0[min(persistent.chibi_accessory_layer_1, len(chibi_sprites_0) - 1)]
IndexError: list index out of range

Linux-6.8.0-48-generic-x86_64-with-debian-trixie-sid
Ren'Py 6.99.12.4.2187
Monika After Story 0.12.15

The problem is that Linux is case sensitive, so when it tries to load the "submods" folder, can't find it. This leads to an empty list error, so it explains why we get an IndexError.

Possible Solution

But, I found a possible solution, since Windows is not case sensitive but Linux is:

chibi_sprites_0_path = "Submods/ExtraPlus/submod_assets/sprites/accessories/0"
chibi_sprites_1_path = "Submods/ExtraPlus/submod_assets/sprites/accessories/1"

The fix is just changing the "submods" to Submods on every path. This should not break anything on Windows.