Console command for killing spawners?

Post all other topics which do not belong to any other category.
Post Reply
SkySo1dier
Inserter
Inserter
Posts: 26
Joined: Sat Jul 26, 2014 2:34 am
Contact:

Console command for killing spawners?

Post by SkySo1dier »

Guys, is there a console command for killing all spawners, biters, warms?

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Console command for killing spawners?

Post by DaveMcW »

You can't kill all spawners on an infinite map, but you can kill them in as big an area as you like.

Code: Select all

/c radius = 500;
p = game.player.position;
for _,type in pairs{"unit", "unit-spawner", "turret"} do;
enemies = game.get_surface(1).find_entities_filtered{area={{p.x-radius,p.y-radius},{p.x+radius,p.y+radius}}, type=type, force=game.forces.enemy};
for _,enemy in pairs(enemies) do enemy.destroy(); end;
end;
Last edited by DaveMcW on Wed Aug 12, 2015 8:08 am, edited 1 time in total.

SkySo1dier
Inserter
Inserter
Posts: 26
Joined: Sat Jul 26, 2014 2:34 am
Contact:

Re: Console command for killing spawners?

Post by SkySo1dier »

Thank you! This worked perfectly!

User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2633
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: Console command for killing spawners?

Post by steinio »

Hello,

i used this and first wondered about no effect on map.
It would be useful to mention that radar has to rescan the map to see the effect.

Is there a command to respawn the enemies?

Greetings steinio
Image

Transport Belt Repair Man

View unread Posts

Post Reply

Return to “General discussion”