First time modding

Place to get help with not working mods / modding interface.
Post Reply
flaming910
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri May 06, 2016 9:21 am
Contact:

First time modding

Post by flaming910 »

So I was looking around and noticed no one has a better steel furnaces mod, so I wanted to make my own.

So i started by following two tutorials and checking on other furnace related mods, and ended with what is attached below. So I finish the first steel furnace upgrade, and want to test if it works, so I open factorio and get an error, which I then fix. Open it again, another error, fixed it. And now im stuck on two different errors. One only happens when I have WaiTex installed, and one when I remove it. I want to know what I'm doing wrong.

Also, I couldn't find the steel furnaces base LUA file, so I wasn't sure on how to make the energy sources be both boiler and electric, so correct me if my way of doing it is wrong. Also, can someone tell me the path for the steel furnaces?

With WaiTex error: https://gyazo.com/af8f837da1d36b599f7febc3a89425b0

Without WaiTex error: https://gyazo.com/043a02b31a65bea7f0e6fdd57b8e249b
Attachments
MoreFurnaces_0.1.1.rar
(2.34 KiB) Downloaded 104 times

daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: First time modding

Post by daniel34 »

I don't use WaiTex so I don't know about that error, but for vanilla I found the following errors:
  • The vanilla steel furnace uses crafting_categories and crafting_speed instead of smelting_categories and smelting_speed.
    Look it up in your Factorio folder: data\base\prototypes\entity\entities.lua
    I know in the wiki it says smelting_categories, but that info is from 2014 and might be outdated.
  • recipe.lua line 46: processing-unit instead of processing-uni
  • item.lua: the subgroup "production" doesn't exist. Use "smelting-machine" (like the vanilla furnace, so it's in the same row) or create your own subgroup.
  • You are missing the .png file ending for the icon strings in item.lua and technology.lua
  • For testing you'll need to comment out items and recipes for which no entity exists (steel-furnace-mk3 and up) or the mod won't load
Afterwards Factorio loads and your steel-furnace-mk2 is researchable, craftable and placeable.
However, the entity is invisible (check how the vanilla furnace does the animation, your code seems outdated) and 100 inventory slots are a little bit overkill.
quick links: log file | graphical issues | wiki

flaming910
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri May 06, 2016 9:21 am
Contact:

Re: First time modding

Post by flaming910 »

daniel34 wrote:I don't use WaiTex so I don't know about that error, but for vanilla I found the following errors:
  • The vanilla steel furnace uses crafting_categories and crafting_speed instead of smelting_categories and smelting_speed.
    Look it up in your Factorio folder: data\base\prototypes\entity\entities.lua
    I know in the wiki it says smelting_categories, but that info is from 2014 and might be outdated.
  • recipe.lua line 46: processing-unit instead of processing-uni
  • item.lua: the subgroup "production" doesn't exist. Use "smelting-machine" (like the vanilla furnace, so it's in the same row) or create your own subgroup.
  • You are missing the .png file ending for the icon strings in item.lua and technology.lua
  • For testing you'll need to comment out items and recipes for which no entity exists (steel-furnace-mk3 and up) or the mod won't load
Afterwards Factorio loads and your steel-furnace-mk2 is researchable, craftable and placeable.
However, the entity is invisible (check how the vanilla furnace does the animation, your code seems outdated) and 100 inventory slots are a little bit overkill.

Code: Select all

data:extend({
{
    type = "furnace",
    name = "steel-furnace-mk2",
    icon = "__base__/graphics/icons/steel-furnace.png",
    flags = {"placeable-neutral", "placeable-player", "player-creation"},
    minable = {mining_time = 1, result = "steel-furnace"},
    max_health = 200,
    corpse = "medium-remnants",
    vehicle_impact_sound =  { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65 },
    working_sound =
    {
      sound = { filename = "__base__/sound/furnace.ogg" }
    },
    resistances =
    {
      {
        type = "fire",
        percent = 100
      }
    },
    collision_box = {{-0.7, -0.7}, {0.7, 0.7}},
    selection_box = {{-0.8, -1}, {0.8, 1}},
    crafting_categories = {"smelting"},
    result_inventory_size = 1,
    energy_usage = "235kW",
    crafting_speed = 3,
    source_inventory_size = 1,
    energy_source =
    {
      type = "burner",
      effectivity = 0.9,
      emissions = 0.02,
      fuel_inventory_size = 1,
      smoke =
      {
        {
          name = "smoke",
          frequency = 10,
          position = {0.7, -1.2},
          starting_vertical_speed = 0.08,
          starting_frame_deviation = 60
        }
      }
    },
    animation =
    {
      filename = "__base__/graphics/entity/steel-furnace/steel-furnace-working.png",
      priority = "high",
      width = 140,
      height = 76,
      frame_count = 1,
      shift = {1.21875, -0.125}
    },
    idle_animation =
    {
      filename = "__base__/graphics/entity/steel-furnace/steel-furnace-idle.png",
      priority = "high",
      width = 140,
      height = 76,
      frame_count = 1,
      shift = {1.21875, -0.125}
    },
    working_visualisations =
    {
      {
        north_position = {0.0, 0.0},
        east_position = {0.0, 0.0},
        south_position = {0.0, 0.0},
        west_position = {0.0, 0.0},
        animation =
        {
          filename = "__base__/graphics/entity/steel-furnace/steel-furnace-fire.png",
          priority = "high",
          width = 21,
          height = 9,
          frame_count = 28,
          scale = 1.02,
          shift = {0.046875, 0.640625}
        },
        light = {intensity = 1, size = 1}
      },
    {
        north_position = {0.0, 0.0},
        east_position = {0.0, 0.0},
        south_position = {0.0, 0.0},
        west_position = {0.0, 0.0},
        effect = "flicker", -- changes alpha based on energy source light intensity
        animation =
        {
          filename = "__base__/graphics/entity/steel-furnace/steel-furnace-glow.png",
          priority = "high",
          width = 60,
          height = 43,
          frame_count = 1,
          shift = {0.03125, 0.640625},
          blend_mode = "additive"
        }
      },
    },
    fast_replaceable_group = "furnace"
  },
 })
So, I found the steel furnace code and copied it over and switched a few values, would this work?

daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: First time modding

Post by daniel34 »

flaming910 wrote:
daniel34 wrote:I don't use WaiTex so I don't know about that error, but for vanilla I found the following errors:
  • The vanilla steel furnace uses crafting_categories and crafting_speed instead of smelting_categories and smelting_speed.
    Look it up in your Factorio folder: data\base\prototypes\entity\entities.lua
    I know in the wiki it says smelting_categories, but that info is from 2014 and might be outdated.
  • recipe.lua line 46: processing-unit instead of processing-uni
  • item.lua: the subgroup "production" doesn't exist. Use "smelting-machine" (like the vanilla furnace, so it's in the same row) or create your own subgroup.
  • You are missing the .png file ending for the icon strings in item.lua and technology.lua
  • For testing you'll need to comment out items and recipes for which no entity exists (steel-furnace-mk3 and up) or the mod won't load
Afterwards Factorio loads and your steel-furnace-mk2 is researchable, craftable and placeable.

Oh, and don't forget to add an english locale when you're finished with the mod, to replace the unknown-key lines in the game.
However, the entity is invisible (check how the vanilla furnace does the animation, your code seems outdated) and 100 inventory slots are a little bit overkill.

Code: Select all

data:extend({
{
    type = "furnace",
    name = "steel-furnace-mk2",
    icon = "__base__/graphics/icons/steel-furnace.png",
    flags = {"placeable-neutral", "placeable-player", "player-creation"},
    minable = {mining_time = 1, result = "steel-furnace"},
    max_health = 200,
    corpse = "medium-remnants",
    vehicle_impact_sound =  { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65 },
    working_sound =
    {
      sound = { filename = "__base__/sound/furnace.ogg" }
    },
    resistances =
    {
      {
        type = "fire",
        percent = 100
      }
    },
    collision_box = {{-0.7, -0.7}, {0.7, 0.7}},
    selection_box = {{-0.8, -1}, {0.8, 1}},
    crafting_categories = {"smelting"},
    result_inventory_size = 1,
    energy_usage = "235kW",
    crafting_speed = 3,
    source_inventory_size = 1,
    energy_source =
    {
      type = "burner",
      effectivity = 0.9,
      emissions = 0.02,
      fuel_inventory_size = 1,
      smoke =
      {
        {
          name = "smoke",
          frequency = 10,
          position = {0.7, -1.2},
          starting_vertical_speed = 0.08,
          starting_frame_deviation = 60
        }
      }
    },
    animation =
    {
      filename = "__base__/graphics/entity/steel-furnace/steel-furnace-working.png",
      priority = "high",
      width = 140,
      height = 76,
      frame_count = 1,
      shift = {1.21875, -0.125}
    },
    idle_animation =
    {
      filename = "__base__/graphics/entity/steel-furnace/steel-furnace-idle.png",
      priority = "high",
      width = 140,
      height = 76,
      frame_count = 1,
      shift = {1.21875, -0.125}
    },
    working_visualisations =
    {
      {
        north_position = {0.0, 0.0},
        east_position = {0.0, 0.0},
        south_position = {0.0, 0.0},
        west_position = {0.0, 0.0},
        animation =
        {
          filename = "__base__/graphics/entity/steel-furnace/steel-furnace-fire.png",
          priority = "high",
          width = 21,
          height = 9,
          frame_count = 28,
          scale = 1.02,
          shift = {0.046875, 0.640625}
        },
        light = {intensity = 1, size = 1}
      },
    {
        north_position = {0.0, 0.0},
        east_position = {0.0, 0.0},
        south_position = {0.0, 0.0},
        west_position = {0.0, 0.0},
        effect = "flicker", -- changes alpha based on energy source light intensity
        animation =
        {
          filename = "__base__/graphics/entity/steel-furnace/steel-furnace-glow.png",
          priority = "high",
          width = 60,
          height = 43,
          frame_count = 1,
          shift = {0.03125, 0.640625},
          blend_mode = "additive"
        }
      },
    },
    fast_replaceable_group = "furnace"
  },
 })
So, I found the steel furnace code and copied it over and switched a few values, would this work?
After making the changes in the other files I mentioned above, I replaced entity.lua with your new code and it works.
Only (small) bug: When picking up the steel-furnace-mk2, you'll get a steel-furnace back.
To fix this, change line 7 to:

Code: Select all

    minable = {mining_time = 1, result = "steel-furnace-mk2"},
quick links: log file | graphical issues | wiki

flaming910
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri May 06, 2016 9:21 am
Contact:

Re: First time modding

Post by flaming910 »

So I started it up after adding everything, and the technology tree and the items are all being Unknown Entity. Why si that?
daniel34 wrote:
flaming910 wrote:
daniel34 wrote:I don't use WaiTex so I don't know about that error, but for vanilla I found the following errors:
  • The vanilla steel furnace uses crafting_categories and crafting_speed instead of smelting_categories and smelting_speed.
    Look it up in your Factorio folder: data\base\prototypes\entity\entities.lua
    I know in the wiki it says smelting_categories, but that info is from 2014 and might be outdated.
  • recipe.lua line 46: processing-unit instead of processing-uni
  • item.lua: the subgroup "production" doesn't exist. Use "smelting-machine" (like the vanilla furnace, so it's in the same row) or create your own subgroup.
  • You are missing the .png file ending for the icon strings in item.lua and technology.lua
  • For testing you'll need to comment out items and recipes for which no entity exists (steel-furnace-mk3 and up) or the mod won't load
Afterwards Factorio loads and your steel-furnace-mk2 is researchable, craftable and placeable.

Oh, and don't forget to add an english locale when you're finished with the mod, to replace the unknown-key lines in the game.
However, the entity is invisible (check how the vanilla furnace does the animation, your code seems outdated) and 100 inventory slots are a little bit overkill.

Code: Select all

data:extend({
{
    type = "furnace",
    name = "steel-furnace-mk2",
    icon = "__base__/graphics/icons/steel-furnace.png",
    flags = {"placeable-neutral", "placeable-player", "player-creation"},
    minable = {mining_time = 1, result = "steel-furnace"},
    max_health = 200,
    corpse = "medium-remnants",
    vehicle_impact_sound =  { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65 },
    working_sound =
    {
      sound = { filename = "__base__/sound/furnace.ogg" }
    },
    resistances =
    {
      {
        type = "fire",
        percent = 100
      }
    },
    collision_box = {{-0.7, -0.7}, {0.7, 0.7}},
    selection_box = {{-0.8, -1}, {0.8, 1}},
    crafting_categories = {"smelting"},
    result_inventory_size = 1,
    energy_usage = "235kW",
    crafting_speed = 3,
    source_inventory_size = 1,
    energy_source =
    {
      type = "burner",
      effectivity = 0.9,
      emissions = 0.02,
      fuel_inventory_size = 1,
      smoke =
      {
        {
          name = "smoke",
          frequency = 10,
          position = {0.7, -1.2},
          starting_vertical_speed = 0.08,
          starting_frame_deviation = 60
        }
      }
    },
    animation =
    {
      filename = "__base__/graphics/entity/steel-furnace/steel-furnace-working.png",
      priority = "high",
      width = 140,
      height = 76,
      frame_count = 1,
      shift = {1.21875, -0.125}
    },
    idle_animation =
    {
      filename = "__base__/graphics/entity/steel-furnace/steel-furnace-idle.png",
      priority = "high",
      width = 140,
      height = 76,
      frame_count = 1,
      shift = {1.21875, -0.125}
    },
    working_visualisations =
    {
      {
        north_position = {0.0, 0.0},
        east_position = {0.0, 0.0},
        south_position = {0.0, 0.0},
        west_position = {0.0, 0.0},
        animation =
        {
          filename = "__base__/graphics/entity/steel-furnace/steel-furnace-fire.png",
          priority = "high",
          width = 21,
          height = 9,
          frame_count = 28,
          scale = 1.02,
          shift = {0.046875, 0.640625}
        },
        light = {intensity = 1, size = 1}
      },
    {
        north_position = {0.0, 0.0},
        east_position = {0.0, 0.0},
        south_position = {0.0, 0.0},
        west_position = {0.0, 0.0},
        effect = "flicker", -- changes alpha based on energy source light intensity
        animation =
        {
          filename = "__base__/graphics/entity/steel-furnace/steel-furnace-glow.png",
          priority = "high",
          width = 60,
          height = 43,
          frame_count = 1,
          shift = {0.03125, 0.640625},
          blend_mode = "additive"
        }
      },
    },
    fast_replaceable_group = "furnace"
  },
 })
So, I found the steel furnace code and copied it over and switched a few values, would this work?
After making the changes in the other files I mentioned above, I replaced entity.lua with your new code and it works.
Only (small) bug: When picking up the steel-furnace-mk2, you'll get a steel-furnace back.
To fix this, change line 7 to:

Code: Select all

    minable = {mining_time = 1, result = "steel-furnace-mk2"},
Attachments
MoreFurnaces_0.1.1 (1).rar
(2.75 KiB) Downloaded 103 times

Post Reply

Return to “Modding help”