Forum

factorio - add and ...
 
Notifications
Clear all

factorio - add and remove ores from console

1 Posty
1 Users
0 Reactions
2,803 Widok
0
Topic starter

need command

1 Answer
0
Topic starter

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

Odpowiedź

Author Name

Author Email

Your question *

 
Preview 0 Revisions Saved
Share: