SeaWorld


You are stuck on an Island. Escape it

Mod packs
6 months ago
1.1
769

g Spidertron variant compatibility

6 months ago

Spidertrons (such as Companion drone; https://mods.factorio.com/mod/Companion_Drones) require fuel but may not have a burnt result output.

Something like this adds it:

for _, entity in pairs(data.raw) do
    for _, definition in pairs(entity) do
        if definition.energy_source then
            if definition.type == "spider-vehicle" then
                definition.energy_source.burnt_inventory_size = 1
            end
        end
    end
end
6 months ago

Thanks, I be sure to add burnt inventory to them.

6 months ago
(updated 6 months ago)

This needs to be done in data-updates.lua or data-final-fixes.lua not data.lua otherwise there is dependency ordering issue.

At least when using https://mods.factorio.com/mod/companions-use-k2-vehicle-fuel

6 months ago
(updated 6 months ago)

Actually the example you provided should have been using table.insert

if mods["Krastori2"] then 
  table.insert(data.raw["spider-vehicle"]["companion"].energy_source.fuel_categories, "vehicle-fuel")
end
if mods["aai-industry"] then
  table.insert(data.raw["spider-vehicle"]["companion"].energy_source.fuel_categories,, "processed-chemical")
end

New response