bogate wrote: ↑Mon, 7. Jun 21, 12:13
Sadly coding such a thing is well beyond my ability
Same - but it looks like the sort of task that would be absolutely trivial for someone with a modicum of programming knowledge. If I knew even just a little bit more Python I could probably pull it off. (It might also erase your hard drive and burn down your house, but it would work.)
It would just need to mimic the Extensions menu in the game - give you on/off switches for each mod that it finds in the content.xml file. (This alone would be a boon - you could set your mods before launching the game, rather than having to launch, set mods, quit and launch again.) And then allow you to either save that setup directly into context.xml or save it as a separate (preset) file.
And then from there, someone could add a pulldown menu that lets you pick one of the preset files, which then copies that file over as content.xml, replacing the one that's currently there. (You would presumably want to have a "default" preset that is either all on or all off, as well as a "revert" option that would restore the last content.xml in the event of a disaster.)
Alternatively, the mod launcher could ignore content.xml (on first run) and simply generate the mod list from what's in the extensions folder. The way content.xml works currently, if you remove an extension from the folder it DOES NOT remove that extension from content.xml. (This is not a problem normally, but it might get weird if the mod launcher reads an extension in context.xml that you don't actually have installed anymore - you might expect it to be there, but it's not. The game still runs just fine, it's just that the extension is missing.)
In game, X4 is doing some comparison between the content.xml file and the extensions folder. It's reading the on/off state from the xml file but reading the exists/doesn't exist state from the extensions folder. So if you remove an extension from the folder it doesn't show up in the game's list, either as on or off, but if you then put it back it will restore whatever on/off state was in effect the last time you had it - because it's still in content.xml.
I know way more about this than I should, for someone who can't program his way into a paper bag, let alone out of it.
Edit: Final thought: having a mod preset launcher would be an absolute boon for modders and mod testers. It would make A/B testing (see? I know some things... I just can't use them) so much easier. (Maybe modders already edit their own content.xml files?) It would also make playing multiple saves with different extensions much easier. Honestly half the reason I don't routinely switch between my vanilla save and my Star Wars Interworlds save is because it's a multi-minute hassle to launch, switch on/off the extensions, quit and relaunch. And I used to play with over 50 mods installed (non-Star Wars) but once I started a vanilla save so I can help test 4.1 beta, I just gave up on it because the effort required to go through and turn all of my extensions off and on again is just too annoying.