Advanced Chemical Plant K2

by tshakah

Ports the advanced chemical plant from Krastorio to vanilla, with vanilla-esque balance

Content
14 days ago
1.1 - 2.0
3.14K
Fluids

i [solved] Subgroup change

1 year, 5 months ago

data.lua; string 88:
subgroup = "production-machine",
Please change it to:
subgroup = "chemistry",
So in "Crafting" tab it will be in same place as Chemical Plant.

1 year, 5 months ago

Done!

1 year, 5 months ago
(updated 1 year, 5 months ago)

"Failed to load mods: Error in assignID: item-subgroup with name 'chemistry' does not exist. Source: kr-advanced-chemical-plant(Item)."

Is the 'chemistry' sub-group added from another mod?
May need to add an if check around there.

I changed data.lua item code to this, seems to work now.

--item
local chemical_plant_item = {
  type = "item",
  name = "kr-advanced-chemical-plant",
  icon = graphics_path .. "icons/advanced-chemical-plant.png",
  icon_size = 64,
  icon_mipmaps = 4,
  order = "e[chemical-plant]-b[advanced-chemical-plant]",
  place_result = "kr-advanced-chemical-plant",
  stack_size = 50,
}
--check if 'chemistry' subgroup exists
if data.raw["item-subgroup"]["chemistry"] then
  chemical_plant_item.subgroup = "chemistry"
else
  chemical_plant_item.subgroup = "production-machine"
end
data:extend({chemical_plant_item})
1 year, 5 months ago
(updated 1 year, 5 months ago)

I've released an update that handles the missing group. Thanks for reporting the error.

1 year, 5 months ago
(updated 1 year, 5 months ago)

Is the 'chemistry' sub-group added from another mod?

Oh yeah, my bad. I forget about vanila factorio do not have so much of subroups.
Looks like for me it added by Space Exploration.

Also because of mod loading order (alphabetical?) it now placed back with production-machines again.
https://imgur.com/a/03G5j2g
To fix this we need Space Exploration as optonal dependency. With this ACP will be loaded after SE and will "see" whai it adds.
Also I can guess that this mod will have conflict with K2 itself so woul be better to add it as "conflict mod".
info.json; string 9:
"dependencies": [ "base >= 1.1", "? space-exploration", "! Krastorio2" ],
I checked it myself and it works fine — subgroup is "chemistry" again with SE.
Sorry to bother you so much 😅

1 year, 5 months ago
(updated 1 year, 5 months ago)

That's okay. I think mostly what you've shown is that I need to look into the mod CI/CD story.

This mod checks for K2 and does nothing if you're using it

1 year, 5 months ago

I've released the change to add SE as optional. As K2 doesn't break since I already check for it, I didn't add that change.

1 year, 5 months ago

Also because of mod loading order (alphabetical?) it now placed back with production-machines again.
https://imgur.com/a/03G5j2g
To fix this we need Space Exploration as optonal dependency. With this ACP will be loaded after SE and will "see" whai it adds.

What is the mod you're using in the image?? That looks really helpful!

ah good point! The load order, yeah from what I remember, it loads mods in order of dependencies, then will sort in natural order. (alphanumeric probably)
Good catch!

1 year, 5 months ago
(updated 1 year, 5 months ago)

What is the mod you're using in the image?? That looks really helpful!

What do you mean about mod? If you about detailed tooltip then it's not mod. It's debug info.

Press [F4] then check-box [show-debug-info-in-tooltips].

edit: https://imgur.com/a/l5Ondj4

1 year, 5 months ago

Press [F4] then check-box [show-debug-info-in-tooltips].

Dang i need to look at more of these debug options! thank you

New response