eArmada8 / misc_kiseki

Random code for Kiseki (trails) modding
GNU General Public License v3.0
6 stars 4 forks source link

Instant crash #1

Closed SheLikesCloth closed 1 year ago

SheLikesCloth commented 1 year ago

I am having some trouble with aa - inject model.py.

Setup

I am trying this with CLE Hajimari.

I have both aa - inject model.py and uyjulian’s unpackpkg.py in the Hajimari data/asset/D3D11 directory. I also tried putting them in data/asset/D3D11.

Behavior

When I run the injection script by just calling the name of the script (or double-clicking), a terminal window opens and then immediately closes. There is no error returned. I also get a __pycache__ folder with a unpackpkg.cpython-310.pyc file.

When I run python "aa - inject model.py", I get this:

Traceback (most recent call last):
  File "E:\SteamLibrary\steamapps\common\THE LEGEND OF HEROES HAJIMARI NO KISEKI\data\asset\D3D11\aa - inject model.py", line 6, in <module>
    from unpackpkg import * # Needed for games that compress the XML file
  File "E:\SteamLibrary\steamapps\common\THE LEGEND OF HEROES HAJIMARI NO KISEKI\data\asset\D3D11\unpackpkg.py", line 131, in <module>
    with open(sys.argv[1], "rb") as f:
IndexError: list index out of range

I thought that might indicate a problem with unpackpkg, but running unpackpkg.py C_CHR067.pkg test unpacks C_CHR067.pkg into the test directory without noticeable problems.

Thoughts

I am not familiar enough with Python to know what else to try.

System

eArmada8 commented 1 year ago

Just to be sure, you are using my fork of unpackpkg, correct? The original release is not written to be used as a library.

https://github.com/eArmada8/unpackpkg/blob/main/unpackpkg.py

SheLikesCloth commented 1 year ago

Nope! I missed that requirement somehow.

eArmada8 commented 1 year ago

I'm glad it's solved. I'm planning on overhauling this tool eventually, I will probably fork it off into its own repository and I can make a release that already includes the needed files. It's somewhere on my todo list.

EDIT: Overhauled and put into its own repo here: https://github.com/eArmada8/ed8_inject/releases