research unit(s) can only be items

Place to get help with not working mods / modding interface.
Post Reply
User avatar
jamiechi1
Fast Inserter
Fast Inserter
Posts: 196
Joined: Wed Jan 03, 2018 10:12 pm

research unit(s) can only be items

Post by jamiechi1 »

I get this dialog error when trying to modify science pack recipes.
(I saw 1 reference to this in a thread but it was in German but my understanding of German is pretty weak.)
I really would like to modify science pack recipes.

The code in data-final-fixes.lua that causes the error:

Code: Select all


-- It appears that the Developers have disabled the ability to 
-- change science packs so the following does not work.

-- nerf science packs a bit
----[[
-- purple Production science pack
data.raw.technology["production-science-pack"].unit.ingredients = 
{
  {"electric-furnace", 1},
  {"productivity-module", 1},
  --{"rail", 30}
  {"rail", 10}
}
data.raw.technology["production-science-pack"].unit.energy_required = 15
data.raw.technology["production-science-pack"].unit.result_count = 4

if mods["Bio_Industries"] 
then
  data.raw.technology["production-science-pack"].unit.ingredients = 
  {
    {"electric-furnace", 1},
    {"productivity-module", 1},
    --{"rail", 30}
    {"bi-rail-wood", 10}
  }

--data.raw.technology["bi_recipe_production_science_pack"].unit.energy_required = 15
--data.raw.technology["bi_recipe_production_science_pack"].unit.result_count = 4
end

-- yellow Utility science pack

data.raw.technology["utility-science-pack"].unit.ingredients =
{
  {"low-density-structure", 2},
  {"processing-unit", 2},
  {"flying-robot-frame", 1}
}
data.raw.technology["utility-science-pack"].unit.energy_required = 15
data.raw.technology["utility-science-pack"].unit.result_count = 4
--]]

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: research unit(s) can only be items

Post by Rseding91 »

Thanks for the report. Science packs can only be tool type items (as the error states). That's not a bug.

You've told the game to use electric furnaces as science packs but haven't changed the electric furnace item from type "item" to type "tool".

Moving to modding help.
If you want to get ahold of me I'm almost always on Discord.

User avatar
EpicSlayer7666
Inserter
Inserter
Posts: 38
Joined: Mon Sep 02, 2019 7:52 am
Contact:

Re: research unit(s) can only be items

Post by EpicSlayer7666 »

wow that in one way makes sense and not... meaning you could not use Oil as a science pack even tho science packs decreases it's meta data to use it self (like an internal quantity) over time and Oil is available in doted values (floating points)... the reason it makes sense that items do not work is that very meta data... yet having liquid science would make total sense since those science potions contains liquids that are it's meta data.

having a way to accept liquid would be nice... tho i still cannot understand why you put furnaces and processors in a soup instead of upgrading the research center with those... like using the furnace to make experiments and use the processors to analyze it... yellow potions would definitely be sulfur!

for items... you would need the research Lab to have an internal buffer values per slots of 100.0 (floating point) and the time it takes would burn that value instead, over the time value specified in the research... when it consumes the potion, it would work like other items... (making it disappear until the process is done THEN consume it for real.)

still i never considered that items would not work... but when you say tool, then i think of the pick axe's durability and it make sense that i can have half used potions now.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: research unit(s) can only be items

Post by eradicator »

It looks like @OP is trying to change the recipe cost of science packs, yet the code tries to alter the *reserach cost* of the technology that *unlocks* each science pack.

Wrong:

Code: Select all

data.raw.technology["production-science-pack"].unit.ingredients = 
Slightly better:

Code: Select all

data.raw.recipe["production-science-pack"].ingredients =
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

User avatar
jamiechi1
Fast Inserter
Fast Inserter
Posts: 196
Joined: Wed Jan 03, 2018 10:12 pm

[Fixed] research unit(s) can only be items

Post by jamiechi1 »

Thank you eradicator, that was it. And Thank you everyone else for your comments.
The corrected code:

Code: Select all


-- nerf science packs a bit
----[[
-- purple Production science pack
data.raw.recipe["production-science-pack"].ingredients = 
{
  {"electric-furnace", 1},
  {"productivity-module", 1},
  --{"rail", 30}
  {"rail", 10}
}
data.raw.recipe["production-science-pack"].energy_required = 15
data.raw.recipe["production-science-pack"].result_count = 4

if mods["Bio_Industries"] 
then
  data.raw.recipe["bi_recipe_production_science_pack"].ingredients = 
  {
    {"electric-furnace", 1},
    {"productivity-module", 1},
    --{"rail", 30}
    {"bi-rail-wood", 10}
  }

-- don't need these two things
--data.raw.recipe["bi_recipe_production_science_pack"].energy_required = 15
--data.raw.recipe["bi_recipe_production_science_pack"].result_count = 4
end

-- yellow Utility science pack

data.raw.recipe["utility-science-pack"].ingredients =
{
  {"low-density-structure", 2},
  {"processing-unit", 2},
  {"flying-robot-frame", 1}
}
data.raw.recipe["utility-science-pack"].energy_required = 15
data.raw.recipe["utility-science-pack"].result_count = 4
--]]

Post Reply

Return to “Modding help”