Page 1 of 1

research unit(s) can only be items

Posted: Fri Sep 06, 2019 1:58 am
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
--]]

Re: research unit(s) can only be items

Posted: Fri Sep 06, 2019 3:30 am
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.

Re: research unit(s) can only be items

Posted: Fri Sep 06, 2019 6:54 am
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.

Re: research unit(s) can only be items

Posted: Fri Sep 06, 2019 10:15 am
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 =

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

Posted: Fri Sep 06, 2019 9:42 pm
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
--]]