Cloning a rocket doesn't clone it properly. The cloned rocket's inventory (for ex.: satellite) disappears, and no rocket is launched when clicking "launch" button.
I can see the issue has been mentioned a while ago here and it seems all the issues described here remain: 67635
[1.1.74] Cloning a rocket silo doesn't work
Re: [1.1.74] Cloning a rocket silo doesn't work
Thanks for the report however this is working correctly: cloning just the rocket silo does not clone the rocket. This is because the rocket is its own entity separate from the silo and just happens to be launched through the rocket silo GUI.
If you are using the https://lua-api.factorio.com/latest/Lua ... e_entities function and provide both the rocket silo and the rocket it will clone as you are wanting. If you just do one of the entities it will not do the other.
If you are using the https://lua-api.factorio.com/latest/Lua ... e_entities function and provide both the rocket silo and the rocket it will clone as you are wanting. If you just do one of the entities it will not do the other.
If you want to get ahold of me I'm almost always on Discord.
Re: [1.1.74] Cloning a rocket silo doesn't work
Ah sorry, looks like I was wrong, cloning entities one by one doesn't work:
/c
people = game.player.surface.find_entities_filtered{position=game.player.position, radius = 15}
for i,j in pairs(people) do
if j.name == 'rocket-silo' or j.name == 'rocket-silo-rocket' or j.name == 'rocket-silo-rocket-shadow' then
local pos = game.player.position
pos.y = pos.y - 30
j.clone{position = pos}
end
end
But using clone_entities works:
/c
local entities = {}
local offset = {x = 0, y = -50}
people = game.player.surface.find_entities_filtered{position=game.player.position, radius = 15}
for i,j in pairs(people) do
if j.name == 'rocket-silo' or j.name == 'rocket-silo-rocket' or j.name == 'rocket-silo-rocket-shadow' then
entities[#entities+1] = j
end
end
game.player.surface.clone_entities{entities = entities, destination_offset = offset}
Thanks for the reply.
/c
people = game.player.surface.find_entities_filtered{position=game.player.position, radius = 15}
for i,j in pairs(people) do
if j.name == 'rocket-silo' or j.name == 'rocket-silo-rocket' or j.name == 'rocket-silo-rocket-shadow' then
local pos = game.player.position
pos.y = pos.y - 30
j.clone{position = pos}
end
end
But using clone_entities works:
/c
local entities = {}
local offset = {x = 0, y = -50}
people = game.player.surface.find_entities_filtered{position=game.player.position, radius = 15}
for i,j in pairs(people) do
if j.name == 'rocket-silo' or j.name == 'rocket-silo-rocket' or j.name == 'rocket-silo-rocket-shadow' then
entities[#entities+1] = j
end
end
game.player.surface.clone_entities{entities = entities, destination_offset = offset}
Thanks for the reply.