Page 1 of 1

Running commands in factorio

Posted: Sun Jul 10, 2016 3:28 am
by exstreamrider
in factorio there has always been something that caused me to have issues. Commands.... i really want to play around with them but they aren't horribly accessible such as converting a save to a map where you can add stuff to the map so perhaps a bit of help with that i really would gladly appreciate any suggestions on how to work with commands :?

Re: Running commands in factorio

Posted: Sun Jul 10, 2016 3:49 am
by exstreamrider
to be more specific i wish to spawn in some oil in my world due to the lack of it anywhere
EDIT- i found this code but an error occurs in the code when using it since the update
/c local surface = game.local_player.surface;
for y=-5, 5 do
for x=-5, 5 do
surface.create_entity({name="Oil", amount=15000, position={game.local_player.position.x+x, game.local_player.position.y+y}})
end
end

Re: Running commands in factorio

Posted: Sun Jul 10, 2016 8:34 am
by prg
It's now just "player" instead of "local_player" and the entity has always been called "crude-oil" instead of "Oil".

Also you might want to increase the spacing between the patches a bit, like position={game.player.position.x+3*x, game.player.position.y+3*y}.

Re: Running commands in factorio

Posted: Mon Jul 11, 2016 11:42 pm
by exstreamrider
prg wrote:It's now just "player" instead of "local_player" and the entity has always been called "crude-oil" instead of "Oil".

Also you might want to increase the spacing between the patches a bit, like position={game.player.position.x+3*x, game.player.position.y+3*y}.
thanks a lot :D