EldenRingModLoader icon indicating copy to clipboard operation
EldenRingModLoader copied to clipboard

Mod Load Order Format

Open diabloterrorgf opened this issue 2 years ago • 2 comments

Could you please provide a short example of what the format for mod loader's load order should be? It's not too clear from the readme.

diabloterrorgf avatar Jul 25 '22 12:07 diabloterrorgf

Oh bad reading comprehension. I understand now... but isn't that a bit convoluted than just having some XML load order?

diabloterrorgf avatar Jul 25 '22 12:07 diabloterrorgf

This is for the author of ERML:

I made a load order that works in the config by putting the mod under the [loadorder] section. I can make a PR if you are happy with it! https://github.com/Nordgaren/EldenRingModLoader

new ini:

[modloader]
load_delay = 1000
show_terminal = 0

; Add the name of the dll here: I.E ErdTools = 1
[loadorder]

P.S. I just figured I wouldn't open a new issue on Mod Load Order Format to post this, as well as this is kinda a solution to the current format being confusing to some users. I do a lot of tech support for people trying to get mods working (mainly in SeamlessCoop right now) and the main thing about the load order thing is that people don't exactly understand what to do.

Nordgaren avatar Aug 30 '22 00:08 Nordgaren

The main thing with the current load ordering system is that mods can be packaged together with their load orders easily without overriding any other files. However I guess it doesn't hurt to have the ability to put the load orders in the mod loader .ini aswell. But it should work together with the original method and should conform with these points:

  • The mod loader must first attempt to read load orders from inside the mods folder for each mod (as it does now), then secondly read the load orders from the main mod loader .ini in the game root directory.
  • The load orders specified in the main mod loader .ini should override whichever load order it read from the mods folder.
  • The mod loader should make a concrete print to the logs that it has read a load order from the main mod loader .ini.

As an extra point, putting load orders in the main mod loader .ini should only be used as an alternative and mods shouldn't be packaged with a modified mod_loader_config.ini.

techiew avatar Sep 03 '22 12:09 techiew

If it works as described above then I'd accept a PR.

techiew avatar Sep 03 '22 12:09 techiew

Right now I just have the load order printing right before it gets added to the list of load orders, like so. Is this what you want, or do you want a print in each case?

            if (extension == ".dll" && path == m_modFolder)
            {
                std::string modName = file.path().stem().string();
                int64_t loadOrder = automaticLoadOrder;

                std::ifstream loadOrderFile(m_modFolder + "\\" + modName + "\\load.txt", std::ios::binary);
                if (loadOrderFile.is_open())
                {
                    std::string line = "";
                    getline(loadOrderFile, line);
                    std::stringstream stringStream(line);
                    stringStream >> loadOrder;
                }

                std::string load = ini["loadorder"].get(modName);
                //Just in case someone adds ".dll" to their load order.  
                if (load == "") {
                    load = ini["loadorder"].get(modName + ".dll");
                }

                if (load != "") {
                    loadOrder = stoi(load);
                }

                m_logger.Log("  %s = %d", modName.c_str(), loadOrder);

                dllMods.push_back(std::make_pair(loadOrder, modName + ".dll"));
            }

Nordgaren avatar Sep 04 '22 14:09 Nordgaren

This is ok, you can create a PR and I'll have a closer look soon.

techiew avatar Sep 04 '22 14:09 techiew