I want to make a copy of the vanilla smelters to tweak some settings (extreme pollution).
What is the best way to do this? Do a deep copy of data.raw and then update some values (like pollution rate, graphics and research)?
How do I assign a modded item only to work for the new entities and not the vanilla ones?
New smelting entities - advice on approach
New smelting entities - advice on approach
My Mod list: Necormant co-author
- eradicator
- Smart Inserter
- Posts: 5207
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: New smelting entities - advice on approach
Yes deepcopy.
Recipe: change name and result
Item: change name and place_result
Entity: change name and minable.result
Best practice is to add a prefix to the name to avoid incompabilities with other mods. I.e. "trblz-dirty-furnace"
Recipe: change name and result
Item: change name and place_result
Entity: change name and minable.result
Best practice is to add a prefix to the name to avoid incompabilities with other mods. I.e. "trblz-dirty-furnace"
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.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: New smelting entities - advice on approach
What does item.place_result do? Wiki mentions "Name of prototype/Entity that can be built using this item" so I read this as the list of outputs that this item can generate.eradicator wrote: ↑Sun Feb 23, 2020 6:09 pm Yes deepcopy.
Recipe: change name and result
Item: change name and place_result
Entity: change name and minable.result
Best practice is to add a prefix to the name to avoid incompabilities with other mods. I.e. "trblz-dirty-furnace"
I will give this a try. The mod already has a prefix for everything.
My Mod list: Necormant co-author
Re: New smelting entities - advice on approach
Recipe, item and entity can have different names.
Code: Select all
item.name = "custom-furnace" -- item name
item.place_result = "nice-furnace" -- entity name
entity.name = "nice-furnace" -- entity name
entity.minable.result = "custom-furnace" -- item name
recipe.name = "custom-recipe-for-nice-custom-furnace" -- recipe name
recipe.result = "custom-furnace" -- item name
Re: New smelting entities - advice on approach
I have made the new entities using the deep copy step.
Next is to figure out the data.raw change to redirect a vanilla ore from vanilla burner to my custom burner
Next is to figure out the data.raw change to redirect a vanilla ore from vanilla burner to my custom burner
My Mod list: Necormant co-author
Re: New smelting entities - advice on approach
Don't forget to add your new prototypes to the data.raw:
Code: Select all
data:extend({item, entity, recipe})
Re: New smelting entities - advice on approach
I am missing something that should be right in front of me
I define the new entity, recipe and technology for "cdmo-stone-furnace":
if i do it like this, how do i force that iron-ore can be smelted in "cdmo-stone-furnace" and not anymore vanilla.stone-furnace?
I define the new entity, recipe and technology for "cdmo-stone-furnace":
Code: Select all
--define new entity
local fn1 = table.deepcopy(data.raw["furnace"]["stone-furnace"])
fn1.name = "cdmo-stone-furnace"
fn1.icon = "__cdmo__/graphics/icons/stone-furnace.png"
fn1.icon_size = 32
fn1.icon_mipmaps = nil
fn1.minable.result = fn1.name
fn1.next_upgrade = "cdmo-steel-furnace"
fn1.animation.layers[1].filename = "__cdmo__/graphics/entity/stone-furnace/stone-furnace.png"
fn1.animation.layers[1].hr_version.filename = "__cdmo__/graphics/entity/stone-furnace/hr-stone-furnace.png"
data.extend({fn1})
--define recipe
data:extend({
{
type = "recipe",
name = "cdmo-stone-furnace",
enabled = false,
energy_required = 5,
ingredients = { {"stone-furnace", 1},{"steel-plate", 10}},
result = "cdmo-stone-furnace"
}
})
-- define technology
data:extend({
{
type = "technology",
name = "cdmo-stone-furnace",
icon_size = 32,
icon = "__base__/graphics/technology/oil-processing.png",
prerequisites = {"advanced-oil-processing"},
effects = {
{
type = "unlock-recipe",
recipe = "cdmo-stone-furnace"
},
},
unit = {
count = 1,
ingredients = {{"automation-science-pack", 1},{"production-science-pack", 1}
},
time = 30
},
order = "d-c"
},
})
My Mod list: Necormant co-author
Re: New smelting entities - advice on approach
Set up the new recipe category, change it by smelting recipe and set it by your furnace.
https://wiki.factorio.com/Prototype/RecipeCategory
https://wiki.factorio.com/Data.raw#recipe-category
https://wiki.factorio.com/Prototype/RecipeCategory
https://wiki.factorio.com/Data.raw#recipe-category