Alright, I'll make a post on that other mod. What I'm doing locally, if you do want to do this yourself in a way that is mod-agnostic, is to do something like this:
local function inherit_grid(type_name, from_name, to_name)
-- Do these entries even exist?
if not data.raw[type_name][from_name] or not data.raw[type_name][to_name] then
return
end
-- Skip inheriting if a grid is already defined earlier.
if data.raw[type_name][to_name].equipment_grid then
return
end
-- We also only want to inherit if there's something *to* inherit.
local new_grid = data.raw[type_name][from_name].equipment_grid
if not new_grid then
return
end
-- We can now finally copy over to use the base equipment grid.
data.raw[type_name][to_name].equipment_grid = new_grid
end
inherit_grid("locomotive", "locomotive", "electric-locomotive")
inherit_grid("cargo-wagon", "cargo-wagon", "electric-cargo-wagon")
inherit_grid("fluid-wagon", "fluid-wagon", "electric-fluid-wagon")
This will make the electric prototypes use whatever the base locomotive equipment grid uses, since it is crafted from a base locomotive. In K2's case, it will inherit "kr-locomotive-grid" or "kr-wagons-grid" which is just a string. All else that is needed is to mark Krastorio2 has an optional dependency to ensure that it loads first. Alternatively, maybe this property can be set at a later phase like data-final-fixes or data-updates so you don't need to do that with any other mod that adds locomotive equipment grids.