User:Darkfrei/script

From Official Factorio Wiki
< User:Darkfrei
Revision as of 15:49, 5 February 2017 by Darkfrei (talk | contribs) (Created page with "=== Add new oil patch === This creates 9 crude oil patches randomly without collisions: /c local position = nil for i=1,9 do position = game.player.surface.find_non_colli...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Add new oil patch

This creates 9 crude oil patches randomly without collisions:

/c local position = nil
for i=1,9 do
	position = game.player.surface.find_non_colliding_position("crude-oil", game.player.position, 0, i/2+1.5)
	if position then 
		game.player.surface.create_entity({name="crude-oil", amount=5000, position=position})
	end
end