mkinfrared / baldurs-gate3-mod-manager

158 stars 4 forks source link

Need support for mods without json files #70

Closed azwargamer closed 11 months ago

azwargamer commented 11 months ago

The manager correctly will copy the .pak file to the mods folder, but doe# not create an entry in the approximate files for loading the mods. This forces the user to have to manually find and edit these files resulting in errors. Create a generic process to create an entry when no provided .json file is included.

johnbamf commented 11 months ago

This seems liek a major thing as It seems like most mods do not have Json files and don't work. I hope this will come!

Timodej commented 11 months ago

Second this. An example for this would be the "bags bags bags" mod.

mkinfrared commented 11 months ago

I'm in the process of moving right now so not able to work on the app at the moment. But as soons as I'm done I will take a look if it's possible to add that feature.

johnbamf commented 11 months ago

any update?

nmcclay commented 11 months ago

I also encountered this issue, digging in the part that skips updating the modsettings.lsx for mods if there is no mod info: https://github.com/mkinfrared/baldurs-gate3-mod-manager/blob/e64b727c77427cdb2b93ce095840e6afd0633c22/src/main/features/mod/installModsHandler/lib/helpers/addModsToSettings/addModsToSettings.ts#L25

Here is the line where the mod info is only populated via included JSON:

https://github.com/mkinfrared/baldurs-gate3-mod-manager/blob/e64b727c77427cdb2b93ce095840e6afd0633c22/src/main/entities/mod/lib/helpers/getModData/lib/getModDataFromArchive/getModDataFromArchive.ts#L37

My hunch would be simply populating mod info with pak data at this point will fall back pak data would fix this. I’ll setup my dev environment and try it when I get a chance.

mkinfrared commented 11 months ago

I had little time to investigate whether it's possible to get data from pak files. So here's an outcome. First all, pak files seem to contain same data provided in info.json so it can be used to populate the data for modsettings.lsx. And second, which is unfortunate, there's no lib for mac that can extract or read the contents of pak files for Divinity engine at the moment. The only working app which I found that managed to exract the pak files was lslib. But it uses .Net Framework which is not cross platform. I will try to come up with a solution. If anyone knows a tool on mac which can extract pak files please let me know. That might help

nmcclay commented 11 months ago

I agree @mkinfrared the .pak contains all the needed details for this case but isn't available as toolkit outside of Windows. I was looking and found others discussing this problem with Linux based mod managers: https://github.com/CHollingworth/Lamp/issues/14

I hacked together a version of this mod manager working to create the expected JSON file, but I still needed to manually populate the necessary UUID/MD5/Folder/Version details in order to reliably get it to load. These details are somewhat visible in the .pak if you open it as a .txt file but ultimately not in reliably parsable way.

There are interesting ongoing projects to convert LsLib to .NET 6 (which may work with Mono) and another to allow it to work standalone on Linux. Unless anyone else is aware of any tools that can extract pak files those projects seem necessary to fix this issue reliably.

mkinfrared commented 11 months ago

I did some research, and fortunately it's seems to be doable at the moment. I will keep you updated

nmcclay commented 10 months ago

@mkinfrared can you clarify how PR #87 resolves this issue? Looking at the source I see some changes to how the UUID is generated but it is still not writing the details to the modsettings.lsx when there is no json file.

mkinfrared commented 10 months ago

Which mod are you trying to install? And which version of the app are you using?

nmcclay commented 10 months ago

@mkinfrared, my apologies. I simply missed clicking the activate button. This is an incredible fix, sorry for my confusion!