factorio - add and remove ores from console« Wróć do listy pytań

need command
Wysłane przez mrmucha
Zadane przez 31/07/2016 12:34
0

ADD some small ore field near player

1
2
3
4
5
6
/c local surface = game.player.surface;
for y=-4,4 do
 for x=-4,4 do
  surface.create_entity({name="uranium-ore", amount=5000, position={game.player.position.x+x, game.player.position.y+y}})
 end
end
/c local surface = game.player.surface;
for y=-4,4 do
 for x=-4,4 do
  surface.create_entity({name="uranium-ore", amount=5000, position={game.player.position.x+x, game.player.position.y+y}})
 end
end

REMOVE uranium-ore near player

1
2
3
4
5
6
7
/c for _, entity in ipairs(game.player.surface.find_entities_filtered{
        area={{game.player.position.x-32, game.player.position.y-32},
            {game.player.position.x+32, game.player.position.y+32}},
            name="uranium-ore"})
do
    entity.destroy()
end
/c for _, entity in ipairs(game.player.surface.find_entities_filtered{
        area={{game.player.position.x-32, game.player.position.y-32},
            {game.player.position.x+32, game.player.position.y+32}},
            name="uranium-ore"})
do
    entity.destroy()
end
Wysłane przez mrmucha
Odpowiedziane 31/07/2016 12:46