Page 1 of 1
explain some console commands
Posted: Thu Apr 28, 2016 9:58 pm
by Offsetpeter
i am trying to use the console command to add a resources patch but i dont understand the wikipedia
/c local surface = game.local_player.surface;
for y=-2,2 do
for x=-2,2 do
surface.create_entity({name="stone", amount=5000, position={game.local_player.position.x+x, game.local_player.position.y+y}})
end
end
can someone tell me how to correctly insert this in the console command
thank you
-Offsetpeter
Re: explain some console commands
Posted: Thu Apr 28, 2016 10:14 pm
by prg
Open console with ~ or whatever you might have configured, ctrl+v, enter.
Re: explain some console commands
Posted: Thu Apr 28, 2016 10:38 pm
by Offsetpeter
prg wrote:Open console with ~ or whatever you might have configured, ctrl+v, enter.
i know that yes but the command it self
Add new resource patch
This creates a new 5x5 patch of resources, centered on the player character. For resources other than stone, just change "stone" to "iron-ore", "copper-ore", or "coal"
/c local surface = game.local_player.surface;
for y=-2,2 do
for x=-2,2 do
surface.create_entity({name="stone", amount=5000, position={game.local_player.position.x+x, game.local_player.position.y+y}})
end
end
is what i dont understand
Re: explain some console commands
Posted: Thu Apr 28, 2016 10:52 pm
by prg
Could you rephrase your question? I have no idea what your problem is with this command then. You want a line by line explanation of how it works?
Re: explain some console commands
Posted: Thu Apr 28, 2016 11:00 pm
by Offsetpeter
if you want yes please
let me ask it like this
for example what do i need to put in the console command if i want a 5x5 iron ore deposit
Re: explain some console commands
Posted: Thu Apr 28, 2016 11:24 pm
by DaveMcW
/c local surface = game.local_player.surface;
for y=-2,2 do
for x=-2,2 do
surface.create_entity({name="iron-ore", amount=5000, position={game.local_player.position.x+x, game.local_player.position.y+y}})
end
end
Re: explain some console commands
Posted: Fri Apr 29, 2016 10:54 am
by Offsetpeter
so if i copy paste this :
/c local surface = game.local_player.surface;
for y=-2,2 do
for x=-2,2 do
surface.create_entity({name="iron-ore", amount=5000, position={game.local_player.position.x+x, game.local_player.position.y+y}})
end
end
it wil give me a 5x5 iron ore patch ??
Re: explain some console commands
Posted: Fri Apr 29, 2016 1:10 pm
by prg
If only there was a way to find out...
Re: explain some console commands
Posted: Fri Apr 29, 2016 1:22 pm
by Offsetpeter
so no that dose not work
Re: explain some console commands
Posted: Fri Apr 29, 2016 1:25 pm
by prg
You have a stray ` at the end.
Re: explain some console commands
Posted: Fri Apr 29, 2016 2:04 pm
by Offsetpeter
prg wrote:You have a stray ` at the end.
nice that workt thank you
Re: explain some console commands
Posted: Mon Aug 08, 2016 8:18 pm
by Sub

- Bez tytułu.png (2.21 MiB) Viewed 4298 times
i have this problem pleas help
Re: explain some console commands
Posted: Mon Aug 08, 2016 8:50 pm
by prg
Nowadays it's just player instead of local_player.
Also for crude oil you probably want to add some spacing so you're able to place the pumpjacks. Try {game.player.position.x+3*x, game.player.position.y+3*y} as the position.
edit: ...better use at least one 4 there somewhere if you also care about pipes.
Re: explain some console commands
Posted: Mon Aug 08, 2016 9:08 pm
by Sub
thank you so much.
Re: explain some console commands
Posted: Tue Aug 09, 2016 11:17 pm
by ssilk
1. This is moved from General to Gameplay Help
2. Please use the code-block to show code.
Code: Select all
/c local surface = game.local_player.surface;
for y=-2,2 do
for x=-2,2 do
surface.create_entity({name="iron-ore", amount=5000, position={game.local_player.position.x+x, game.local_player.position.y+y}})
end
end
Looks much better than
/c local surface = game.local_player.surface;
for y=-2,2 do
for x=-2,2 do
surface.create_entity({name="iron-ore", amount=5000, position={game.local_player.position.x+x, game.local_player.position.y+y}})
end
end
and avoids wrong quoting.