Console command to create new oil wells?
Console command to create new oil wells?
I'm playing a test map, "wide ribbon"-style, 672 tiles tall and infinite width, but I seem to have extremely few sources of Oil.
Are there console commands that can create new Oil Wells for me? I know how to create oil barrels via the usual gift-item console command, but I'd rather have some Oil Wells to use Pumpjacks on.
Are there console commands that can create new Oil Wells for me? I know how to create oil barrels via the usual gift-item console command, but I'd rather have some Oil Wells to use Pumpjacks on.
Re: Console command to create new oil wells?
Stand where you want the well to be created, then run
Point your mouse cursor at the new well and run
edit: ...and just figured out you can already pass the amount in the create_entity call.
Code: Select all
game.player.surface.create_entity{name="crude-oil", position=game.player.position}
Code: Select all
game.player.selected.amount=10000
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
Re: Console command to create new oil wells?
I tested this, and it works, and amount=10k gives 133% yield, 20k gives 266%, so it's linear:
/c game.player.surface.create_entity{name="crude-oil", position=game.player.position, amount=10000}
Thanks!
/c game.player.surface.create_entity{name="crude-oil", position=game.player.position, amount=10000}
Thanks!
Re: Console command to create new oil wells?
Thanks again.
What's the equivalent command to spawn a patch of ore? Especially ores from mods, such as the Uraninite and Flourite from the Atomic Power mod?
What's the equivalent command to spawn a patch of ore? Especially ores from mods, such as the Uraninite and Flourite from the Atomic Power mod?
Re: Console command to create new oil wells?
Replace crude-oil with the name of the resource. Point the mouse cursor at an existing patch and /c game.player.print(game.player.selected.name) to find out what it's called, or dig through the mod's source if no such patch yet exists.
edit: ...and if you want more than a single tile,
edit edit: in case a simple square is still not fancy enough: (need the whitespace in front of every line so you can just paste the whole thing into the console)
edit: ...and if you want more than a single tile,
Code: Select all
for a = -10, 10 do
for b = -10, 10 do
game.player.surface.create_entity{name="coal", position={game.player.position.x+a, game.player.position.y+b}, amount=500}
end
end
Code: Select all
complex = {
new = function(r, i)
local a = {r=r, i=i,
abs = function(x)
return math.sqrt(x.r^2 + x.i^2)
end,
}
setmetatable(a, complex)
return a
end,
__add = function(a, b)
return complex.new(a.r + b.r, a.i + b.i)
end,
__mul = function(a, b)
local new_r = a.r * b.r - a.i * b.i
local new_i = a.r * b.i + a.i * b.r
return complex.new(new_r, new_i)
end,
}
local size = 200
local max_iter = 100
local top = game.player.position.y-size/2
local left = game.player.position.x-size/2
for y = 1, size do
for x = 1, size do
local z = complex.new(0, 0)
local c = complex.new(2.5*x/size - 2, 2.5*y/size - 1.25)
local res = "coal"
for n = 1, max_iter do
if z:abs() > 2 then
if n < 8 then
res = nil
elseif n < 15 then
res = "iron-ore"
else
res = "copper-ore"
end
break
end
z = z*z + c
end
if res then
game.player.surface.create_entity{name=res, position={left+x, top+y}, amount=1000}
end
end
end
- Attachments
-
- mandelbrot.jpg (289.57 KiB) Viewed 95500 times
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
Re: Console command to create new oil wells?
Thanks!
For some weird reason, "flourite" doesn't work with the Uranium Power mod. I've tried to look into the mod files to see what it's called, but haven't been able to find it. "uraninite" works fine, and that was the mineral that hadn't occured on my RSO/Tall_Ribbon map.
In general, I think combining RSO, Uranium Power and the Tall_Ribbon playstyle might be advisable only if the ribbon is very tall. I play on a 672 tall ribbon (3 regions tall) and with water set to "medium" that seems to cause problems with abundance of special minerals. It'd probably work fine with a ribbon height of 1120, 5 regions, but at that point it's not really a ribbon any more. It doen't really create the effect that you fairly quickly end up defending only 2 fronts, left and right, while up and down are safe.
For some weird reason, "flourite" doesn't work with the Uranium Power mod. I've tried to look into the mod files to see what it's called, but haven't been able to find it. "uraninite" works fine, and that was the mineral that hadn't occured on my RSO/Tall_Ribbon map.
In general, I think combining RSO, Uranium Power and the Tall_Ribbon playstyle might be advisable only if the ribbon is very tall. I play on a 672 tall ribbon (3 regions tall) and with water set to "medium" that seems to cause problems with abundance of special minerals. It'd probably work fine with a ribbon height of 1120, 5 regions, but at that point it's not really a ribbon any more. It doen't really create the effect that you fairly quickly end up defending only 2 fronts, left and right, while up and down are safe.
Re: Console command to create new oil wells?
Haven't looked at that mod, so just a guess, but... maybe try "fluorite"?
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
Re: Console command to create new oil wells?
Ohh pretty mandelbrot resources.
Don't tempt me to add fractal resources to RSO
Do I understand correctly that you are having problems with fluorite not being spawned by RSO on ribbon map?
Amount of water is important for RSO - if whole resource patch lands in the water you will simply lose it. There is no mechanics to compensate for that.
Both uraninite and fluorite have quite low spawn chances so might be rare.
Don't tempt me to add fractal resources to RSO

Do I understand correctly that you are having problems with fluorite not being spawned by RSO on ribbon map?
Amount of water is important for RSO - if whole resource patch lands in the water you will simply lose it. There is no mechanics to compensate for that.
Both uraninite and fluorite have quite low spawn chances so might be rare.
Re: Console command to create new oil wells?
That mandelbrot ore patch is glorious!
OS: Linux Mint 19 x64 | desktop: Awesome 4.2 | Intel Core i5 8600k | 16GB DDR4 | NVidia GTX 1050 Ti (driver version: 410.104) (2019-03)
Re: Console command to create new oil wells?
Sad part is - it would be difficult to mine.Gandalf wrote:That mandelbrot ore patch is glorious!
But placing it somewhere far and random as an easter egg in RSO is still tempting.
Re: Console command to create new oil wells?
Mandelbrot resources....what do they mean?!
Re: Console command to create new oil wells?
Mandelbrot is the name of fractal used to generate resource picture in this thread some posts above.katyal wrote:Mandelbrot resources....what do they mean?!
- Twisted_Code
- Fast Inserter
- Posts: 109
- Joined: Sat Jun 06, 2015 1:15 am
- Contact:
Re: Console command to create new oil wells?
Do it! Do it! Do it! *begins chanting*orzelek wrote:Sad part is - it would be difficult to mine.Gandalf wrote:That mandelbrot ore patch is glorious!
But placing it somewhere far and random as an easter egg in RSO is still tempting.
How to report bugs effectively (archived version)because everyone should know this.
Factorio 1.0 tech tree, a visual reference guide.
Factorio 1.0 tech tree, a visual reference guide.
Re: Console command to create new oil wells?
I took the OP to be a reference to the double rainbow guy:https://www.youtube.com/watch?v=OQSNhk5ICTIorzelek wrote:Mandelbrot is the name of fractal used to generate resource picture in this thread some posts above.katyal wrote:Mandelbrot resources....what do they mean?!
Re: Console command to create new oil wells?
Whenever I try to use the lua command console i keep getting the error "cannot execute command. error: [insert command here]:1: LuaPlayer doesn't contain key surface. Anyone have any ideas of what i'm doing wrong? Trying to use the console command for making oil, ores, etc as a test.
I attached a screenshot of the error
I attached a screenshot of the error
- Attachments
-
- this a screenshot of the error.
- factorio error.jpg (685.92 KiB) Viewed 66924 times
Re: Console command to create new oil wells?
You're using a pre-0.12 version which doesn't contain support for multiple surfaces yet. Just use game.createentity or update to 0.12 (enable experimental updates in the settings)korthan wrote:Whenever I try to use the lua command console i keep getting the error "cannot execute command. error: [insert command here]:1: LuaPlayer doesn't contain key surface. Anyone have any ideas of what i'm doing wrong? Trying to use the console command for making oil, ores, etc as a test.
I attached a screenshot of the error
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
Re: Console command to create new oil wells?
Sorry for the necro but for anyone reading this thread: the number you put in for amount is the number of cycles left in case of an oil well. There are 75 cycles for 1% so 10000 cycles would be 10000 / 75 = 133% (rounded down)Peter34 wrote:I tested this, and it works, and amount=10k gives 133% yield, 20k gives 266%, so it's linear:
/c game.player.surface.create_entity{name="crude-oil", position=game.player.position, amount=10000}
Thanks!
This number includes the 10% the well cannot go under.
Note: recently the number of cycles per % was doubled to 150 so 10000 cycles now equals 66% (rounded down)