Companion Drones

by Klonan

Adds friends

Content
1 year, 10 months ago
1.1
75.6K
Blueprints

i Modded Fuel

2 years ago

It would be nice if there were some method available to change the fuels used for mods to use different fuels. I'm trying to make this compatible with Nullius, where vanilla fuels like coal or wood aren't available. There's no free oxygen to burn them, and no life on the planet to provide them.

I can override the prototype's fuel_category in the update phase:
data.raw["spider-vehicle"]["companion"].energy_source.fuel_category = "vehicle"

But some of the fuel behavior is hardcoded into the companion.lua script and not exposed to other mods. I think a couple of options for making this more flexible for overhaul mods:
1) A way to have it "just work": In companion.lua get_fuel_items, change the reference from "chemical" to data.raw["spider-vehicle"]["companion"].energy_source.fuel_category. That way a mod can override this prototype and the script will still work. In on_player_created, where it says "coal", change it to reference get_fuel_items and pick something from that list with the closest fuel value to coal.
2) Alternatively, you could define a mod interface that other mods can use to set the fuel category and initial fuel type.

New response