Research can not see it in game

Place to get help with not working mods / modding interface.
Lee_newsum
Filter Inserter
Filter Inserter
Posts: 436
Joined: Wed Jan 15, 2014 9:41 am
Contact:

Research can not see it in game

Post by Lee_newsum »

I copied the technology follower-robot-count-1 (file=combat-robots) looking all A lot more Research that dues nothink.
the game loads ok new game do not see my tech. what am I missing?

Code: Select all

function Lot_Research(level, pack1, pack2, pack3, alienpack, count, addition)
  local result =
  {
    type = "technology",
    name = "Lot_Research",
    icon = "__base__/Lot-Research.png",
    effects =
    {
      
    },
    unit =
    {
      ingredients = {},
      time = 30
    },
    upgrade = "false",
    order = "e-p-b-c"
}  
  result.name = "Lot-Research" .. level
  if level == 1 then
    result.prerequisites = {"Lot-Research"}
  else
    result.prerequisites = {"Lot-Researcht-count-" .. (level - 1)}
    if level == 8 then
      result.prerequisites[#result.prerequisites + 1] = "Lot-Research-3"
    end
  end
  result.unit.count = count
  if pack1 ~= 0 then
    table.insert(result.unit.ingredients, {"science-pack-1", pack1})
  end
  if pack2 ~= 0 then
    table.insert(result.unit.ingredients, {"science-pack-2", pack2})
  end
  if pack3 ~= 0 then
    table.insert(result.unit.ingredients, {"science-pack-3", pack3})
  end
  if alienpack ~= 0 then
    table.insert(result.unit.ingredients, {"alien-science-pack", alienpack})
  end
  return result
end

 for i=1,2 do
 data:extend(
{
  createfollowerupgrade(i, 1, 1, 0, 0, i * 50, 1)
})
end
 for i=3,5 do
 data:extend(
{
  createfollowerupgrade(i, 1, 1, 1, 0, i * 50, 2)
})
end

for i=6,10 do
 data:extend(
{
  createfollowerupgrade(i, 1, 1, 1, 1, 20*5 + (i - 5) * 20 * 5, 5)
})
end

for i=11,20 do
 data:extend(
{
  createfollowerupgrade(i, 1, 1, 1, 1, 20 * 5 + 5 * 20 * 5 + (i - 10) * 20 * 10, 10)
})
end
full files https://www.dropbox.com/s/grfyj60vh7ru4 ... 0.zip?dl=0
thanks for your help
User avatar
L0771
Filter Inserter
Filter Inserter
Posts: 516
Joined: Tue Jan 14, 2014 1:51 pm
Contact:

Re: Research can not see it in game

Post by L0771 »

Code: Select all

icon = "__base__/Lot-Research.png",
don't exist, may use

Code: Select all

icon = "__Research__/Lot-Research.png",
addition
is not used, may add this in your function

Code: Select all

    effects =
    {
      {
        type = "maximum-following-robots-count",
        modifier = addition
      }
    },
prerequisites ... are wrong, "Lot-Research" don't exist and "Lot-Researcht-count-" .. (level - 1) also. try whit it

Code: Select all

  if level == 1 then
    result.prerequisites = {}
  else
    result.prerequisites = {"Lot-Research" .. (level - 1)}
    if level == 8 then
      result.prerequisites[#result.prerequisites + 1] = "Lot-Research3"
    end
  end
aaaand the most important...

Code: Select all

 for i=1,2 do
 data:extend(
{
  createfollowerupgrade(i, 1, 1, 0, 0, i * 50,1)
})
end
must be

Code: Select all

 for i=1,2 do
 data:extend(
{
  Lot_Research(i, 1, 1, 0, 0, i * 50,1)
})
end
createfollowerupgrade call the original function, your function don't have errors because is don't used.
Lee_newsum
Filter Inserter
Filter Inserter
Posts: 436
Joined: Wed Jan 15, 2014 9:41 am
Contact:

Re: Research can not see it in game

Post by Lee_newsum »

ok fix them a new bug

Code: Select all

Error None: Error in assignID, 'Lot-Researcht-count-7' was not recognized id of technology

Code: Select all

function Lot_Research(level, pack1, pack2, pack3, alienpack, count, addition)
  local result =
  {
    type = "technology",
    name = "Lot_Research",
    icon = "__Research__/Lot-Research.png",
    effects =
    {
      
    },
    unit =
    {
      ingredients = {},
      time = 30
    },
    upgrade = "false",
    order = "e-p-b-c"
}  
  result.name = "Lot-Research-count-" .. level
  if level == 1 then
    result.prerequisites = {"combat-robotics"}
  else
    result.prerequisites = {"Lot-Researcht-count-" .. (level - 1)}
 end
  result.unit.count = count
  if pack1 ~= 0 then
    table.insert(result.unit.ingredients, {"science-pack-1", pack1})
  end
  if pack2 ~= 0 then
    table.insert(result.unit.ingredients, {"science-pack-2", pack2})
  end
  if pack3 ~= 0 then
    table.insert(result.unit.ingredients, {"science-pack-3", pack3})
  end
  if alienpack ~= 0 then
    table.insert(result.unit.ingredients, {"alien-science-pack", alienpack})
  end
  return result
end

 for i=1,2 do
 data:extend(
{
  Lot_Research(i, 1, 1, 0, 0, i * 50, 1)
})
end
 for i=3,5 do
 data:extend(
{
  Lot_Research(i, 1, 1, 1, 0, i * 50, 2)
})
end

for i=6,10 do
 data:extend(
{
  Lot_Research(i, 1, 1, 1, 1, 20*5 + (i - 5) * 20 * 5, 5)
})
end

for i=11,20 do
 data:extend(
{
  Lot_Research(i, 1, 1, 1, 1, 20 * 5 + 5 * 20 * 5 + (i - 10) * 20 * 10, 10)
})
end
Post Reply

Return to “Modding help”