[implemented in 0.11] multi-phase mod loading

Suggestions that have been added to the game.

Moderator: ickputzdirwech

Post Reply
AartBluestoke
Inserter
Inserter
Posts: 36
Joined: Sun Jun 29, 2014 4:50 am
Contact:

[implemented in 0.11] multi-phase mod loading

Post 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.

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: multi-phase mod loading

Post 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

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: multi-phase mod loading

Post 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.

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: multi-phase mod loading

Post 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.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

Post Reply

Return to “Implemented Suggestions”