You can also generate resources from the console (hit ~ to bring it up). Be sure to consider that entering a console command like this will disable all achievements. Yeah, it's probably "cheating" but I use this for really big megabases where it's not practical to fetch ore from all the across the map each time.
An example console command is...
Code: Select all
/c local surface = game.player.surface; for y=0,40 do for x=0,24 do surface.create_entity({name="iron-ore", amount=5000000, position={game.player.position.x+x, game.player.position.y+y}}) end end
This creates a patch of ore that is of X density (I used 5 million as a nice round number). It reads the coordinates (for y=0,40 do for x=0,24) and creates an ore chunk. In this case, it is going to create iron going 24 squares to the right and 40 squares down, so a total of 960 chunks. If you want to go up and left, you would put.. (for y=-40,0 do for x=-24,0)
You can generate iron-ore, copper-ore, uranium-ore or stone this way (among others). There are similar commands to add oil if you need it.
As a corollary, you can also delete resources the same way. The format is slightly different, but the idea is the same.
Code: Select all
/c for _, entity in ipairs(game.player.surface.find_entities_filtered{ area={{game.player.position.x, game.player.position.y}, {game.player.position.x+24, game.player.position.y+40}}, name="iron-ore"}) do entity.destroy() end
This one goes right 24 spaces and down 40. If you want to adjust that up or down, change your X and Y numbers to be negative. (i.e. x-24 is left, y-24 is up)
You can destroy the same materials as you can create. As a bonus, you can also delete trees using the same kind of command, with a slightly different syntax, using a type instead of a name:
Code: Select all
/c for _, entity in ipairs(game.player.surface.find_entities_filtered{ area={{game.player.position.x, game.player.position.y}, {game.player.position.x+24, game.player.position.y+40}}, type="tree"}) do entity.destroy() end
I haven't figured out a way to do this for rocks - If someone else knows the syntax, I'd like to know, as I spend a lot of time clearing them out.
It's very, very easy to mess this up - Be SURE to save your game before generating ore and reload it if things don't work as you expected them to.