Help with mod Load Order

Place to get help with not working mods / modding interface.
Zoryn
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun May 11, 2014 11:30 pm
Contact:

Help with mod Load Order

Post by Zoryn »

How would I go about forcing a specific mod to always load last in the load order?
(IE: Mods A, B, C, X, and Z are installed loading in the order of A, C, B, Z, X - How would I force mod C to load after mod X when neither mod C nor X depend on any other mod but base?)

Edit: If anyone would like to know why or could give me a better way to do what I need, this is my goal:
All types are loaded into data.raw with the game loading
I need to get all values from a specific type programmatically and change one or more of their values
If my mod is loading before a mod that adds more data of this type to data.raw my mod doesn't edit it
That is where I need my mod to load after

If any of that is wrong please inform me, I'm not entirely certain of the loading structure of Factorio
Last edited by Zoryn on Sun May 11, 2014 11:49 pm, edited 1 time in total.
User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: Help with mod Load Order

Post by FreeER »

to force X to load before C, you can add a dependency to mod C for mod X (so that x will be loaded first). If it's not a 'true' dependency (ie X does not need to exist for C to work, you can use "? X" to state that X doesn't need to exist, but that if it does then it must be loaded before C). However I do not know of any way to actually force a mod to load last (what would happen if multiple mods tried to do that?).

Dependencies are stated in the info.json file with the line: "dependencies": ["dependency1", "dependency2"...], here's an example from my blast mining mod:

Code: Select all

"dependencies": ["base >= 0.7.4", "? Industrio >= 0.3.2", "? dna"]
which states that the mod depends upon the mod named "base" existing and it's version being greater than or equal to 0.7.4, if Industrio exists then it's version must be greater than or equal to 0.3.2 and be loaded first, and if dna exists it must be loaded first. If "dependencies" is not stated at all in info.json it will default to ["base"] (just fyi)

I hope that helps you :D
<I'm really not active any more so these may not be up to date>
~FreeER=Factorio Modding
- Factorio Wiki
- My Factorio Modding Guide
- Wiki Modding Guide
Feel free to pm me :)
Or drop into #factorio on irc.esper.net
Zoryn
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun May 11, 2014 11:30 pm
Contact:

Re: Help with mod Load Order

Post by Zoryn »

FreeER wrote:to force X to load before C, you can add a dependency to mod C for mod X (so that x will be loaded first). If it's not a 'true' dependency (ie X does not need to exist for C to work, you can use "? X" to state that X doesn't need to exist, but that if it does then it must be loaded before C). However I do not know of any way to actually force a mod to load last (what would happen if multiple mods tried to do that?).

Dependencies are stated in the info.json file with the line: "dependencies": ["dependency1", "dependency2"...], here's an example from my blast mining mod:

Code: Select all

"dependencies": ["base >= 0.7.4", "? Industrio >= 0.3.2", "? dna"]
which states that the mod depends upon the mod named "base" existing and it's version being greater than or equal to 0.7.4, if Industrio exists then it's version must be greater than or equal to 0.3.2 and be loaded first, and if dna exists it must be loaded first. If "dependencies" is not stated at all in info.json it will default to ["base"] (just fyi)

I hope that helps you :D
While this works specifically for the mod that I am targeting for now (DyTech), it won't apply if any mod loads after DyTech and my own.
User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: Help with mod Load Order

Post by FreeER »

Zoryn wrote:While this works specifically for the mod that I am targeting for now (DyTech), it won't apply if any mod loads after DyTech and my own.
True, unfortunately there is nothing that can really be done about it other than continuing to add mods that need to be loaded first to your dependencies (there probably aren't that many right now...), sorry if it's not the easiest method for modders to work with but that's how Factorio's modding interface currently works (and has since dependencies were introduced) :)
Schmendrick
Fast Inserter
Fast Inserter
Posts: 226
Joined: Wed Apr 30, 2014 11:17 pm
Contact:

Re: Help with mod Load Order

Post by Schmendrick »

How is mod load order (absent dependencies) currently handled? Alphabetic? File timestamp? Order of introduction to Factorio (if so, what is the subordering for simultaneously installed mods)?
Like my mods? Check out another! Or see older, pre-0.12.0 mods.
User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: Help with mod Load Order

Post by FreeER »

Hm...I'm not certain...but I want to say it's the order added to Factorio and I believe, though I could be wrong, that the order is duplicated in the mods\mod-list.json file, so you could take a look there, and/or you could also create a few mods with print statements and see what order they print in. Of course it'd be nice if you posted the results of such checking here :)
User avatar
rk84
Filter Inserter
Filter Inserter
Posts: 556
Joined: Wed Feb 13, 2013 9:15 am
Contact:

Re: Help with mod Load Order

Post by rk84 »

It has been while since I checked this, but... mod listing is sorted first by rank and second by name. Rank is basicly a depency count. Zero ranks are first in list. And it might have been that rank of depended mod adds up rank of requesting mod. Absent mods do not count.

Also note that mod-list.json is updated after you quit factorio and active order is visible in Mods -window.

Edit: Alternative way of loading/editing data. Post data editing during loading.
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
Post Reply

Return to “Modding help”