Page 1 of 1

Enable Enemies Mid-Game

Posted: Fri Nov 02, 2018 7:43 pm
by LtKronos
I have played a while now without enemies (No Enemy bases). But now i have a good running factory and i want to have enemies now. Is it possible to turn them on using the console?

Re: Enable Enemies Mid-Game

Posted: Fri Nov 02, 2018 9:06 pm
by eradicator

Code: Select all

/c 
local s = game.player.surface.map_gen_settings
s["enemy-base"] = {
  frequency = "normal",
  richness = "normal",
  size = "normal"}
game.player.surface.map_gen_settings = s
This will reenable the generation, so when you explore new sectores they will have enemies. If you play with mods that add new enemy spawners additional tweaks might be required.

Re: Enable Enemies Mid-Game

Posted: Sun Nov 04, 2018 12:37 pm
by LtKronos
Tank you for the answer!

I tried it but it did not worked for me. Maybe because of the mods i play with.
But is it possible to just spawn the biter nests manually an then wait till they expand?

Re: Enable Enemies Mid-Game

Posted: Sun Nov 04, 2018 12:39 pm
by darkfrei
Beware enemies!

Code: Select all

/c local surface = game.player.surface
for c in surface.get_chunks() do
	local position = surface.find_non_colliding_position("biter-spawner", {x=c.x*32+16, y=c.y*32+16}, 10, 3)
	if position and surface.is_chunk_generated(c) then
		surface.create_entity{name="biter-spawner", position=position}
	end
end

Re: Enable Enemies Mid-Game

Posted: Sun Nov 04, 2018 12:50 pm
by LtKronos
Thanks, this one worked. But now i have enemies in every free position on the map :D. Including my base :/.

Re: Enable Enemies Mid-Game

Posted: Sun Nov 04, 2018 1:37 pm
by darkfrei
LtKronos wrote: Sun Nov 04, 2018 12:50 pm Thanks, this one worked. But now i have enemies in every free position on the map :D. Including my base :/.
Just kill them all, it's for balance of no-biters-on-start :D