Hi,
I play in the assembly of mods (PyAnodons, RSO) and when generating the map I turned off some resources (copper, iron, etc.), is it possible to generate them on the current map (more than one resource through the console), since the database is already very huge?
generate resources on the map.
Re: generate resources on the map.
Changing resource generation only works on newly generated chunks
Re: generate resources on the map.
Since you are using RSO you can regenerate whole map but you will need to edit map settings first to enable resources you disabled.
After you edit map settings you would need to call following commands:
/c remote.call("RSO", "regenConfig")
/c remote.call("RSO", "regenerate")
You can edit map gen settings using this API:
https://lua-api.factorio.com/latest/Lua ... n_settings
I think you need to read them as a table, modify and then assign whole table again.
After you edit map settings you would need to call following commands:
/c remote.call("RSO", "regenConfig")
/c remote.call("RSO", "regenerate")
You can edit map gen settings using this API:
https://lua-api.factorio.com/latest/Lua ... n_settings
I think you need to read them as a table, modify and then assign whole table again.
-
- Inserter
- Posts: 23
- Joined: Wed Jan 03, 2018 4:44 am
- Contact:
Re: generate resources on the map.
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...
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.
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:
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.
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
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
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
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.