So yeah, still haven't gotten around to working on a better loadmod system. I think I'm stalling out on that one. Anyone else have any ideas on how to do this? Or maybe I just need to do some thinking out loud.
I was thinking add some lines to Outpost2.ini, but then wondered just how well that would work. How would you know what mods to load, especially if you wanted some setup but disabled? Then I was thinking of a custom file that just listed the DLLs. Then it occured to me that some mods have parameters. For instance, the net patch takes a game server address. It'd be nice to specify not just mods, but parameters to them, and maybe even multiple sets of parameters for the same mod.
Perhaps a format like this:
# Comment
DllName:Parameters
Possible Example 1:
# NetPatch with game server support
NetPatch.dll:127.0.0.1
In the above, everything after the colon could just be handed off to the module for processing. Or perhaps the module should try to pretty things up a bit by accepting parameters in a form such as:
Possible Example 2:
# NetPatch with game server support
NetPatch.dll:GameServerAddr=127.0.0.1
In both cases, you could just comment out lines to render a module inactive.
But the parameters lend itself to a .ini style approach, that might look something like this:
[NetPatch]
Dll = "NetPatch.dll"
GameServerAddr = "127.0.0.1"
Of course that last example is incomplete, as how will the game know what the module sections are called with the standard Ini processing functions. You'd probably need a known tag in a known section that lists the (active) module names. The Dll tag within the module section could be standard, and then leave the module to load the rest of the tags from it's section. The module would probably need to take the settings tag name as a parameter.
Example:
[Addons]
LoadAddons = "NetPatch, SomeOtherMod, YetAnotherMod"
[NetPatch]
Dll = "NetPatch.dll"
GameServerAddr = "127.0.0.1"
[AltNetPatch]
Dll = "NetPatch.dll"
GameServerAddr = "192.168.1.2"
...
Note the inactive parameter set under the "AltNetPatch" heading. It's not listed in the LoadAddons line. Since the Dll name is divorced from the section name, you'd need to tell the dll which section name to load additional settings from (such as the GameServerAddr tag). That way it also doesn't get confused if the same module has different parameter sets specified for it. It would also allow certain well crafted modules to load multiple parameter sets at once.
Questions? Comments? Better ideas?