Krastorio 2


An overhaul mod focusing on end-game technologies and moderately increased complexity.

Overhaul
7 months ago
0.18 - 1.1
338K
Transportation Logistics Trains Combat Armor Mining Fluids Logistic network Manufacturing Power Storage

g Vehicle energy consumption of other modded vehicles

4 years ago

Hey there,

I am having an issue getting my modded vehicles compatible with Krastorio. I don't know why, but my vehicles have a much higher energy consumption when Krastorio is active.

My vehicles are copies of the Gunship from the Aircraft mod. They get spawned by script with 100 MJ of fuel energy (both in Krastorio and Vanilla), but in Krastorio this amount lasts far shorter than in vanilla. I don't see any changes in the raw data values however, entity.consumption and entity.consumption_modifier seem to be the same.
Do you have any idea what could cause this?

The issue is (among others) documented here:
https://mods.factorio.com/mod/AircraftDrones/discussion/5f47b6b4a4a4f87a417132ab

4 years ago

Hi, I'm sorry I have not idea, I can tell u that here
Krastorio2\compatibility-scripts\data-final-fixes
U can find files that change aircraft entities, in particular only grids stats
also in:
Krastorio2\prototypes\vanilla-changes\mandatory
there are some files about changes done to vanilla entities, in particular on fuel values, only if the user use the fuel changes option.

I suggest u to hard code a fix when K2 is installed

4 years ago

After testing this some more I have found out, that the cause of this is not the vehicle itself, but the change of the fuel value:
data.raw.item["rocket-fuel"].fuel_value = "20MJ"

It turns out, that the burner has (an invisible?) maximum capacity depending on the fuel type. That means despite inserting the fuel amount manually, the maximum for entity.burner.remaining_burning_fuel will always depend on the fuel type.

That means this what I do...
entity.burner.currently_burning = "rocket-fuel"
entity.burner.remaining_burning_fuel = 100000000
... will throw no error but it will result in the vehicle having only 20.000.000 J instead of the 100.000.000 J energy.

I'm not sure if this is a base game bug or intended behaviour, but I guess I will have to create my own fuel type, to be independant from other mods.

TLDR: You are doing everything correct ;)