[1.1.74] Cloning a rocket silo doesn't work

Bugs that are actually features.
Piratux
Manual Inserter
Manual Inserter
Posts: 2
Joined: Mon Jan 30, 2023 12:09 pm
Contact:

[1.1.74] Cloning a rocket silo doesn't work

Post by Piratux »

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
Rseding91
Factorio Staff
Factorio Staff
Posts: 15875
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [1.1.74] Cloning a rocket silo doesn't work

Post by Rseding91 »

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 want to get ahold of me I'm almost always on Discord.
Piratux
Manual Inserter
Manual Inserter
Posts: 2
Joined: Mon Jan 30, 2023 12:09 pm
Contact:

Re: [1.1.74] Cloning a rocket silo doesn't work

Post by Piratux »

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.
Post Reply

Return to “Not a bug”