Closed End-User-Person closed 4 years ago
Wrong repo.
I did a simple test where I renamed sonictex.pak in a mod to sonictex2.pak and then used the ReplaceFiles section in mod.ini to redirect the file, and it worked fine, so I'm really not sure what's going wrong here.
As it turns out, there is no problem with the mod loader being able to replace .pak files. The problem, as it were, is that the mod loader only replaces the path used to load the file, not the filename string used to access the data inside said file, which expects the original file name instead of the replaced one. If you save the .pak with the file's original name and then rename it, it loads fine, at the cost of needing to rename it again before being able to edit it.
Attempting to replace a .pak texture file using the ReplaceFile function via code results in one of two outcomes: Either the game crashes upon attempting to load the affected textures, or the .pak replacement is ignored entirely.
Whenever a .pak file already exists somewhere, either in the game itself or via enabled mods, setting a function to replace the file and its .prs equivalent is necessary for any changes to take effect, though the game will only recognize the .prs texture file. Having the replacement .pak texture file in its appropriate location will crash the game with this message:
Replacing event cutscene textures produces the second outcome, though the process of setting the function to replace the .pak and .prs versions of the files is still required, even if there is no .pak file in the game's directory or other mods.