🌐Planetaris: Tellus

by Syen_ce

Tellus, a planet full of life, mycelia and chlorophyll, infected by dangerous parasites and clouds of pollen corrode materials. Create and plant living machinery and try to keep it alive

Content
a day ago
2.0 - 2.1
23.1K
Factorio: Space Age Icon Space Age Mod
Planets Logistics Combat Enemies Environment Mining Fluids Logistic network Manufacturing Power

b Crash when loading mod in Factorio 2.1

11 days ago

Hello, when I load Planetaris Unbounded I get the following mod loading error in Planetaris Tellus.

(Error while loading the mod) Fehler beim Laden der Mods: planetaris-tellus/data-updates.lua:264: attempt to index field 'tool' (a nil value) stack traceback: planetaris-tellus/data-updates.lua:264: in main chunk

If I unzip the mod and check the lines 264 - 270 with Notepad++ there are the following lines to be found:

if data.raw["tool"]["planetaris-pathological-science-pack"] then
data.raw["tool"]["planetaris-pathological-science-pack"].spoil_to_trigger_result =
{
items_per_trigger = 1,
trigger = two_medium_premature_wasp
}
end

Maybe it´s relevant to say I didn´t settle on Tellus before updating Factorio to Factorio 2.1.

The crash seems to happen because data.raw["tool"]["planetaris-pathological-science-pack"] is nil at the time data-updates.lua runs (likely because the science pack hasn't been defined yet or depends on a specific mod loading order). When the code tries to index .spoil_to_trigger_result on a nil value, it throws the error.
You can fix this by adding a safety check to ensure the science pack actually exists before trying to modify its spoiling behavior:

if data.raw["tool"] and data.raw["tool"]["planetaris-pathological-science-pack"] then
data.raw["tool"]["planetaris-pathological-science-pack"].spoil_to_trigger_result =
{
items_per_trigger = 1,
trigger = two_medium_premature_wasp
}
end

At least the game starts and loads the mod without error for me. But please countercheck it for any errors because I am unsure whether it affects the spoiling mechanic of the science pack in your info.json file.

Thank your for the great Planetaris mod pack. I really enjoy your planets, especially Hyarion.

New response