Page 1 of 1

[implemented in 0.11] multi-phase mod loading

Posted: Mon Sep 15, 2014 8:42 am
by AartBluestoke
already there are some issues with "this mod (A) must be loaded before mod B, but mod C likes to be loaded after me"

this typically happens because recipies in mod A want to (conditionally) use use items in mod B

suggestion:
have multi phase mod loading with specific things to be done at different initialization phases:
1. preload: register all items
2. initialize: generate recipies
3. post-init: things related to world gen / other stuff (eg: the recycling mod using all the recipies to add scrap-on-destruction to buildings based on cheapest method of building it)

Having this in place would encourage / provide methods for inter-mod integration without needing complex dependency chain management.

Re: multi-phase mod loading

Posted: Mon Sep 15, 2014 11:59 am
by kovarex
Yes, this is really good suggestion that I was also thinking about.

It wouldn't also be so much work to do, so I'm adding it to our todo for 0.10.11

Re: multi-phase mod loading

Posted: Mon Oct 27, 2014 11:49 am
by kovarex
Done for 0.11.0
changelog 0.11.0 wrote: Added phases to the mod loading. data.lua of all mods is loaded first, then the data-updates.lua and the final-fixes.lua as last.
This allows mods to change the data of other mods without the need to be last. This is used even in the base game, to add the dust effect when a building is created, so the effect is added to mod buildings as well.

Re: multi-phase mod loading

Posted: Mon Nov 03, 2014 2:39 pm
by bobingabout
This is actually why I merged my "Metals and Chemcials" mod with my "Intermediates" mod, I wanted conditional recipes to add items from M&C to make the Intermediates, but then also wanted the optional intermediates to be in some recipes in M&C too, so ended up merging the 2 together to make it possible.