Page 1 of 1

[0.17.2] VOID energy_source doesn't work for vehicles or equipment

Posted: Wed Feb 27, 2019 11:29 pm
by Avacado
Maybe this is intentional and that is fine, but playing around with VOID and set EVERY energy source in data.raw to void:

Code: Select all

for category_name,category in pairs(data.raw) do
    for entity_name,entity in pairs(category) do
        if type(entity) == "table" and type(entity.energy_source) == "table" then
            entity.energy_source.type = "void"
        end
    end
end
Works for most things. But vehicle (cars, tanks locomotives) still demand fuel and won't run without fuel. Also equipment like exoskeletons won't work without a fusion reactor or some other electricity source.

It makes a bit of sense for vehicles, since VOID would take away their ability to get fuel bonuses.

Re: [0.17.2] VOID energy_source doesn't work for vehicles or equipment

Posted: Wed Feb 27, 2019 11:37 pm
by Rseding91
Thanks for the report however yes they do: vehicles use "burner" for their energy source definition so your check for "has energy_source" will fail on those and never set the type to void.

You need to remove the "burner" definition and add energy_source { type = void }.

Re: [0.17.2] VOID energy_source doesn't work for vehicles or equipment

Posted: Wed Feb 27, 2019 11:40 pm
by Avacado
My mistake! Thank you for your fast reply! I'll check if that was a similar issue happening to my equipment.