Can I spawn hundreds of biter-spawner entity's around my base for fun?

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
XGhozt
Burner Inserter
Burner Inserter
Posts: 17
Joined: Tue Aug 09, 2016 9:24 pm
Contact:

Can I spawn hundreds of biter-spawner entity's around my base for fun?

Post by XGhozt »

I figured out this much:

Code: Select all

/c game.players[1].surface.create_entity{name = "biter-spawner", position = {410, -95}}
But I'm wondering if I can one-liner a command that would randomize the position to values within a specific range which runs 100 times.

Anyone know how to do that?

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

Re: Can I spawn hundreds of biter-spawner entity's around my base for fun?

Post by DaveMcW »

Code: Select all

/c for i = 1, 100 do game.player.surface.create_entity{name = "biter-spawner", position = {math.random(-999, 999), math.random(-999, 999)}} end

XGhozt
Burner Inserter
Burner Inserter
Posts: 17
Joined: Tue Aug 09, 2016 9:24 pm
Contact:

Re: Can I spawn hundreds of biter-spawner entity's around my base for fun?

Post by XGhozt »

Yeesssss! Thank you :)

Post Reply

Return to “Gameplay Help”