Schall Alien Loot


Dead aliens are now good aliens! Aliens will pay for your base defense! On their death, they bring back the 0.14 alien artifact. They also drop alien ores as loots, which can be morphed into ordinary ores like iron ore. Also adds alien science pack that can be used for research in other tech mods. Well-suited for combat-heavy, no-mining scenarios. (Locale: English, Deutsch, 正體中文, 简体中文, Русский, Português Brasileiro, Español, and 26 Partial)

Content
3 days ago
0.16 - 2.0
22.2K
Enemies

g [Solved] Adding alien science packs to modded labs

4 years ago

I play with both this mod and Bob's Technology mod; the latter has a new "Electric Lab 2" ("lab-2" in the code) that unfortunately does not allow the use of Alien Science Packs. Looking inside entities.lua, I can see that the code there inserts the alien science pack into the lab inputs table, but it only specifies the vanilla lab.

Any way that the mod can be updated so that it finds all lab-type entities and updates their input table accordingly?

4 years ago
(updated 4 years ago)

Of course, it is a reasonable and doable request.
Yet I do not have the time to look into others' mod and/or to test with them, so a formal update may need some time...

In the mean time, please try the following temporary workaround (as you have already found the file).
In entities.lua, replace the contents with the following (actually only line 1 get changed):

for _, lab in pairs(data.raw.lab) do
local notfound = true
for _, v in pairs(lab.inputs) do
if v == "alien-science-pack" then notfound = false end
end
if notfound then table.insert(lab.inputs, "alien-science-pack") end
end

This may or may not work, depending on whether the modded labs are defined or not (many overhaul mods loooove to add new entities in later data phase...), or the lab inputs got overwritten by other mods.
In such case, will need to do in data-updates.lua or data-final-fixes.lua phase.

4 years ago

Yeah I have other mods that insert new inputs to labs (Angel's Bio Processing and Factorio Dawn), and it didn't work at first when dropping the code above in entities.lua. It did work when I placed it on data-updates.lua, so thanks for that!

4 years ago

Great!
I will release a formal update when I have time to do more tests on it.

4 years ago

The recent releases 0.17.11 / 0.18.3 / 1.0.1 should all include the fix mentioned above (and with checking).
So no longer need to make temporary fix yourself now.

New response