How to create additional enemy bases?

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
DJ_M1k3
Burner Inserter
Burner Inserter
Posts: 7
Joined: Fri Feb 24, 2017 1:27 pm
Contact:

How to create additional enemy bases?

Post by DJ_M1k3 »

Hello. I created the world but as a beginner I have set up a small number of enemy bases because I did not know that I need it to research .. now I can not research because there have little amount of enemies ... I just wanted to somehow reconfigure it :)
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Small amount of enemies

Post by darkfrei »

This creates one respawner every 32x32 tiles:

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
DJ_M1k3
Burner Inserter
Burner Inserter
Posts: 7
Joined: Fri Feb 24, 2017 1:27 pm
Contact:

Re: How to create additional enemy bases?

Post by DJ_M1k3 »

Thanks but i dont know anything about codes.. where do I put that code
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: How to create additional enemy bases?

Post by darkfrei »

DJ_M1k3 wrote:Thanks but i dont know anything about codes.. where do I put that code
Open console, Ctrl+V this code, Enter.
Repeat.

You must create a lot of turrets everywhere. Before you enter this code, yeah.
DJ_M1k3
Burner Inserter
Burner Inserter
Posts: 7
Joined: Fri Feb 24, 2017 1:27 pm
Contact:

Re: How to create additional enemy bases?

Post by DJ_M1k3 »

I tottaly destroyed my base :D Is there command that create it only 32 block around me not create it on the whole map? :D
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: How to create additional enemy bases?

Post by darkfrei »

DJ_M1k3 wrote:I tottaly destroyed my base :D Is there command that create it only 32 block around me not create it on the whole map? :D
This creates one respawner every 32x32 tiles, chances around 10:90
old code

Code: Select all

/c local surface = game.player.surface
for c in surface.get_chunks() do
  if (math.random(1,100) < 10) then
    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
end
Last edited by darkfrei on Wed Mar 28, 2018 10:33 am, edited 1 time in total.
DJ_M1k3
Burner Inserter
Burner Inserter
Posts: 7
Joined: Fri Feb 24, 2017 1:27 pm
Contact:

Re: How to create additional enemy bases?

Post by DJ_M1k3 »

It dont work... .D
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: How to create additional enemy bases?

Post by darkfrei »

DJ_M1k3 wrote:It dont work... .D
You must write it twice, but you get no achievements.
User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: How to create additional enemy bases?

Post by impetus maximus »

does this still work? will this work for a world that has nests set to 'none'?

thanks
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: How to create additional enemy bases?

Post by darkfrei »

impetus maximus wrote:does this still work? will this work for a world that has nests set to 'none'?

thanks
Yes, try it twice (after the first you get some warning the your achievements will be disabled).
User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: How to create additional enemy bases?

Post by impetus maximus »

ok thanks. i tried it (entered twice) and it didn't seem to work for me.
the person i was trying to help on steam had success with the command.

thanks for the help.
Post Reply

Return to “Technical Help”