I create a custom assembling machine. This machine is placed in "script.on_event(defines.events.on_chunk_generated)" event with :
Code: Select all
game.surfaces[1].create_entity({
name=object,
position = {x,y},
force = game.forces.neutral
})
Code: Select all
{
type = "assembling-machine",
enable_inventory_bar = false,
name = "big-ship-wreck-4",
icon = "__crash-landings__/graphics/big-ship-wreck-1.png",
flags = {"placeable-neutral", "placeable-player", "player-creation"},
subgroup = "wrecks",
order = "d[remnants]-d[ship-wreck]-a[big]-a",
max_health = 300,
corpse = "big-remnants",
dying_explosion = "medium-explosion",
resistances =
{
{
type = "physical",
percent = 100
},
{
type = "explosion",
percent = 100
},
{
type = "acid",
percent = 100
},
{
type = "fire",
percent = 100
}
},
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",
crafting_categories = {"crafting", "advanced-crafting", "crafting-with-fluid"},
crafting_speed = 0.5,
energy_source = {
type = "burner",
effectivity = 1,
fuel_inventory_size = 1,
emissions = 0.01,
smoke =
{
{
name = "smoke",
deviation = {0.1, 0.1},
frequency = 8,
position = {-2, -2.3},
starting_vertical_speed = 0.1
}
}
},
energy_usage = "90kW",
ingredient_count = 6,
open_sound = { filename = "__base__/sound/machine-open.ogg", volume = 0.85 },
close_sound = { filename = "__base__/sound/machine-close.ogg", volume = 0.75 },
vehicle_impact_sound = { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65 },
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,
},
animation =
{
layers =
{
{
filename = "__crash-landings__/graphics/big-ship-wreck-assembling-machine.png",
priority="medium",
width = 256,
height = 212,
frame_count = 3,
line_length = 3,
shift = util.by_pixel(0, 2),
animation_speed = 0.5,
},
},
},
},
Thanks in advance !
EDIT : I figured out what's wrong. It's because I placed this entity at neutral force so techs of player force don't update neutral tech. But now bitters can attack this :/