Funkin icon indicating copy to clipboard operation
Funkin copied to clipboard

Fix PolyMod Binary Integration

Open Ji-Rath opened this issue 4 years ago • 1 comments
trafficstars


name: Bug Fix about: Fix poly mod not replacing binary files title: 'Bug Fix: Poly Mod Binary Integration' labels: bug, polymod, modding, binary

Please check for duplicates or similar PRs before creating this issue.

Does this PR close any issue(s)? If so, link them below.

#279

Briefly describe the issue(s) fixed.

Apologies if this pull request is not appropriate as this fix is not completely finished. I simply wanted to get the ball rolling on this issue since I did not see relevant solutions to this problem. This essentially addresses some of the issues with the current poly mod integration. Currently, this fixes replacing binary files through the mods folder, as it did nothing before. While I was only successful with replacing images/animation on Windows 10 build, it should be possible to replace sounds/music with a few tweaks. On a side note, the current implementation adds ALL mods in the mods folder and each mod requires a _polymod_meta.json file. In addition, I modified the name of the base folder to 'contents' as keeping it as 'assets' would not let me replace binary files. This should be looked into further.

Ji-Rath avatar Apr 05 '21 08:04 Ji-Rath

After further investigation, it looks like I stumbled upon the issue of why poly mod was not replacing files correctly. It seems that FNF uses Asset Libraries. I essentially cheated on 4240103 by modifying the Project.xml file to have: <assets path="assets" rename="contents"/> which creates a set of all the assets onto contents without using libraries. I then modified Paths.cs and removed the library references. ex. "'$library:contents/$library/$file'" to 'contents/$library/$file'. This is further enforced by a comment by larsiusprime, the author of polymod:

As it happens ninjamuffin is an old acquaintance of mine and I've been helping him fix some bugs with Polymod, did some digging on that tonight in fact. As it turns out he's doing some stuff with asset libraries I wasn't expecting, so it's going to take some refactoring to make FNF compatible with Polymod. I know now what needs to be done but it might take a while.

Ji-Rath avatar Apr 06 '21 04:04 Ji-Rath