Easy assembling machine remake?
Easy assembling machine remake?
I'm having trouble understanding this coding language. I want to be able to make a clone of the vanilla assembling machine with only a change in the recipe category set that it uses. I have a somewhat basic understanding of java code, but it doesn't seem to help when I'm reading the wiki or looking through the posts. I think it would be easy if it were java code (I'd just have to make the new class extend the class for the assembling machine and change the category variable). But seeing as how it's not java code, I don't even know where to start. Help would be greatly appreciated here.
Re: Easy assembling machine remake?
The classes are not exposed for editing. All you can do is set some properties in the data files (data/base/prototypes/entity).
The field you want to edit is called crafting_categories.
The field you want to edit is called crafting_categories.
Re: Easy assembling machine remake?
But what I want to know is how I edit that to do what I want.
Re: Easy assembling machine remake?
What sticky thread? Sorry if the answer is obvious, but I can't tell what the difference is (unless you are referring to the one about mod help references, in which case, I looked at the wiki pages that were linked and it was too confusing for me.)
Re: Easy assembling machine remake?
Well, the modding tutorial does seem to cover the basic structure of the code, but it didn't quite tell me how to make structures. But at least now I have some knowledge on the language. So, is there any help about how to remake the assembling machine?
Re: Easy assembling machine remake?
Factorio\data\base\prototypes\entity\demo-entities.lua > line 1876
Can change what you want and can add some properties.
You can't create an entity new, but current entities are extensive
Code: Select all
{
type = "assembling-machine",
name = "assembling-machine-1",
icon = "__base__/graphics/icons/assembling-machine-1.png",
flags = {"placeable-neutral", "placeable-player", "player-creation"},
minable = {hardness = 0.2, mining_time = 0.5, result = "assembling-machine-1"},
max_health = 200,
corpse = "big-remnants",
dying_explosion = "huge-explosion",
resistances =
{
{
type = "fire",
percent = 70
}
},
collision_box = {{-1.2, -1.2}, {1.2, 1.2}},
selection_box = {{-1.5, -1.5}, {1.5, 1.5}},
fast_replaceable_group = "assembling-machine",
animation =
{
filename = "__base__/graphics/entity/assembling-machine-1/assembling-machine-1.png",
priority="high",
width = 99,
height = 102,
frame_count = 32,
line_length = 8,
shift = {0.25, -0.1}
},
crafting_categories = {"crafting"},
crafting_speed = 0.5,
energy_source =
{
type = "electric",
usage_priority = "secondary-input",
emissions = 0.05 / 1.5
},
energy_usage = "90kW",
ingredient_count = 2,
open_sound = { filename = "__base__/sound/machine-open.ogg", volume = 0.85 },
close_sound = { filename = "__base__/sound/machine-close.ogg", volume = 0.75 },
working_sound =
{
sound = {
{
filename = "__base__/sound/assembling-machine-t1-1.ogg",
volume = 0.8
},
{
filename = "__base__/sound/assembling-machine-t1-2.ogg",
volume = 0.8
},
},
idle_sound = { filename = "__base__/sound/idle1.ogg", volume = 0.6 },
apparent_volume = 1.5,
}
},
You can't create an entity new, but current entities are extensive
Re: Easy assembling machine remake?
When you want to do what you're trying to do the fastest (and most reliable) way is to deepcopy the existing data.raw entry and make changes to that.
Something like this in your data.lua (or other staged variant):
You will of course need to define the "newcraftingcategory" unless you're simply switching the category to a different existing one.
Something like this in your data.lua (or other staged variant):
Code: Select all
local myAssemblyMachine = util.table.deepcopy(data.raw["assembling-machine"]["assembling-machine-1"])
myAssemblyMachine["name"] = "assembling-machine-test"
myAssemblyMachine["crafting_categories"] = {"newcraftingcategory"}
data:extend({myAssemblyMachine})
If you want to get ahold of me I'm almost always on Discord.
Re: Easy assembling machine remake?
This is precisely what I was looking for. Now how do I define the catagory?Rseding91 wrote:When you want to do what you're trying to do the fastest (and most reliable) way is to deepcopy the existing data.raw entry and make changes to that.
Something like this in your data.lua (or other staged variant):
You will of course need to define the "newcraftingcategory" unless you're simply switching the category to a different existing one.Code: Select all
local myAssemblyMachine = util.table.deepcopy(data.raw["assembling-machine"]["assembling-machine-1"]) myAssemblyMachine["name"] = "assembling-machine-test" myAssemblyMachine["crafting_categories"] = {"newcraftingcategory"} data:extend({myAssemblyMachine})
Re: Easy assembling machine remake?
donoya wrote:This is precisely what I was looking for. Now how do I define the catagory?Rseding91 wrote:When you want to do what you're trying to do the fastest (and most reliable) way is to deepcopy the existing data.raw entry and make changes to that.
Something like this in your data.lua (or other staged variant):
You will of course need to define the "newcraftingcategory" unless you're simply switching the category to a different existing one.Code: Select all
local myAssemblyMachine = util.table.deepcopy(data.raw["assembling-machine"]["assembling-machine-1"]) myAssemblyMachine["name"] = "assembling-machine-test" myAssemblyMachine["crafting_categories"] = {"newcraftingcategory"} data:extend({myAssemblyMachine})
Code: Select all
data:extend({{type = "recipe-category", name = "newcraftingcategory"}})
If you want to get ahold of me I'm almost always on Discord.