ThibautSF / ParadoxosModManagerRework

Software to manage mods for recent Paradox games, work in progress, Java 11
MIT License
64 stars 7 forks source link

[Critical] Playset functionality from last launcher update (2020.10) makes PMM impossible to work #43

Open deschain212 opened 4 years ago

deschain212 commented 4 years ago

Stellaris now has a built in "playset" and now when you try applying it with your mod manager it overrides the mod manager config.

ThibautSF commented 4 years ago

Can you try the following?:

deschain212 commented 4 years ago

Yea I tried that. It just doesnt apply the modlist anymore.

deschain212 commented 4 years ago

Apparently this was also added for Hearts of Iron IV and it also does not apply to it.

fgf1011 commented 4 years ago

Hello, I met the same issue. Can you fix that? Thank you. By the way, Paradox seems use a weird method to build a playlist via a type of file called SQlite. Basically it is a database that builds references list to mods.

KevinKevin-2020 commented 4 years ago

Same issus here.

The new launcher use SQlite to create mod list and the mod manager is no longer working.

please have a look, and save us from this painful experience of scrolling a hundred mods up and down.

fgf1011 commented 4 years ago

6c7077f856aefd6ad681931688bdb3b 9507bafcd4c09b0457e0dcaa45fc754 8b45fe131ea7bf68a9b799ddf11e549

I tried to open the SQlite via a sqlitebrowser. However, I never learn CS before so I have no idea.

ThibautSF commented 4 years ago

Games affected, all Paradox games using new launcher system.

ThibautSF commented 4 years ago

TODO for development:

Enhancements ideas:

ThibautSF commented 4 years ago

Note: Launching the game directly by it's executable (might be "stellaris.exe", I'm not sure because I'm not at home and can't check game folder...) should be an option.

deschain212 commented 4 years ago

I can confirm that the workaround works. Its the way to go for the time being.

KarlSchwartz commented 4 years ago

Did exactly what @ThibautSF suggested to fix in HoI 4, with a clean install and few mods, still not working ( sorry for bad english)

bcssov commented 4 years ago

@KarlSchwartz @Crack-Attack The workaround works it's just that you cannot under any circumstances open the PDX Launcher as it will instantly overwrite your changes made via PMM. If you do you must reapply the PMM list again.

KarlSchwartz commented 4 years ago

@bcssov , I understand what you wrote, but I can assure you, that I was well aware that the launcher would interfere with the list, so I applied the list and launched through the exe, still, no results

Crack-Attack commented 4 years ago

@bcssov Yeah nvm the workaround worked for me. I didn't test it properly.

mkemper31 commented 4 years ago

@ThibautSF Hi, I ran into this same issue and I threw together a solution. I've created a simple JS script that generates a SQL query that can be used to insert into the new sqlite db. At present it only generates the query; I ran it manually through an SQLite DB browser. I will attach it to this message. It is very rough but works - just needs modification to work with your code, make sure it works universally, and make it less hardcoded :)

Code follows below:

const dlcload = {"enabled_mods":["mod/ugc_2114559224.mod","mod/ugc_2183551683.mod"],"disabled_dlcs":[]};

const generateModDbQuery = (dlcLoadJson) => {
    let i = 0;
    const playsetId = "a3efbe94-2688-421a-8c83-ab3a242ce52e"; // Unique ID generated by launcher - not sure how to decode it. Just copy/pasted.
    const startValue = parseInt('3333333334', 16); // Sequence of mods is a 10-character hexidecimal string. Using this to convert it to int and generate new values in the loop below.
    let sql = `INSERT INTO playsets_mods VALUES `; // playsets_mods is the table that handles the mods-playsets many to many relationship.
    for (const mod of dlcLoadJson['enabled_mods']) {
        const nextValue = startValue + i;
        if (i) {
            sql += ', ';
        }
        sql += `('${playsetId}', (SELECT id FROM mods WHERE mods.gameRegistryId = '${mod}' LIMIT 1), '${nextValue.toString(16)}', 1)`;
        i++;
    }
    sql += ';';
    return sql;
}

const sql = generateModDbQuery(dlcload);
console.log(sql);

/*
Example output:

INSERT INTO playsets_mods VALUES ('a3efbe94-2688-421a-8c83-ab3a242ce52e', (SELECT id FROM mods WHERE mods.gameRegistryId = 'mod/ugc_2114559224.mod' LIMIT 1), '3333333334', 1), ('a3efbe94-2688-421a-8c83-ab3a242ce52e', (SELECT id FROM mods WHERE mods.gameRegistryId = 'mod/ugc_2183551683.mod' LIMIT 1), '3333333335', 1);

*/
bcssov commented 4 years ago

@mkemper31 const playsetId = "a3efbe94-2688-421a-8c83-ab3a242ce52e" There's nothing to decode, this is what you call a GUID or UUID.

const startValue = parseInt('3333333334', 16); Well, not exactly a proper hex number you see in my test cases I've seen generated position values "33333333ci" or "333333333m" or "33333333bf" for example. If you decode the number and then sort by it you don't get the proper order which they seem to get. They seem to be sorting these strings alphabetically ;)

I just kinda fetch them from the database sort them the same way they're doing and then update all entries with my own hex numbers. I have no idea what they were thinking to be honest.

deschain212 commented 3 years ago

Any news on the update?

shadoxxhd commented 3 years ago

If the mod manager directly launched Stellaris.exe instead of the paradox launcher, the problem would be mitigated.

Is there a way to make steam launch Stellaris.exe (or PMM) instead of the stupid paradox launcher?

bcssov commented 3 years ago

You can create a shortcut on your desktop to the stellaris.exe and launch that, instead of launching via PMM. PMM does not detect the location of your game installs to be able to run the exe directly at the moment I think.