msakuta / Factorio-LateUpgrades-Mod

A Mod for Factorio that adds many upgrades for late game
0 stars 2 forks source link

`toolbelt-2` mod conflict #3

Open OvermindDL1 opened 8 years ago

OvermindDL1 commented 8 years ago

Bob's Mods already adds a toolbelt-2 addon (though his is cheaper oddly). Depending on the mod loading order between this mod and boblogistics it may or may not be applied. To fix this if you put a soft dependency (via ? boblogistics) then his mod will load first allowing yours to overwrite his with the more expensive recipe.

In addition, he also has a toolbelt-3, which is considerably more expensive than this mods toolbelt-2 due to his inclusion of science-pack-4. Any chance on adding a toolbelt-3 to this mod that overrides his with the same recipe as he already uses:

      count = 150,
      ingredients =
      {
        {"science-pack-1", 1},
        {"science-pack-2", 1},
        {"science-pack-3", 1},
        {"alien-science-pack", 1},
      },
      time = 30

However making the count much higher, say CountFactor * 1000 or so?

msakuta commented 8 years ago

Now that I know how to use soft dependency and to examine contents of data.raw, I think I managed rewriting the codes to avoid overwriting Bob's toolbelt-2 except research count. I believe it works for both vanilla and Bob's mod, but if another mod has also researches named toolbelt-2 or 3, I couldn't find a way to distinguish it from Bob's. The reason is that I can't access game.active_mods in data.lua, because game object is not initialized at that point.

Anyway, here is my try: a081b798de050ff0a46de6ea7bbf147ca0b9f044. Let me hear if it works for you.

OvermindDL1 commented 8 years ago

Will try next chance I get. And yeah, that is why it is usually best to mutate existing ones (say a Math.max count value or a simple multiplier or so, that is what the Science Overhaul Mod does).