Page 1 of 1

How to create map w/o default ore generation

Posted: Thu Jan 03, 2019 7:19 pm
by Trblz
I'm trying to create a map w/ voids and custom ores. However when i trigger the map creation in factorio, it always creates default ore profiles.

this part works well at map generation and when new chunks are generated:

Code: Select all


Event.register(defines.events.on_chunk_generated, function(event)
-- create voids in new chunks
-- create custom ores in new chunks randomly
end)

but it still produces the vanilla ore fields - how can i prevent that completely from happening?

Re: How to create map w/o default ore generation

Posted: Thu Jan 03, 2019 8:18 pm
by orzelek
Grab RSO and take a look in data.lua.
You need to disable generation of vanilla ores which is done there or alternatively delete them from map by searching for ore entitites and deleting them.

Re: How to create map w/o default ore generation

Posted: Fri Jan 04, 2019 12:30 am
by Trblz
This is what i found in the RSO data.lua:

Code: Select all

if not RsoMod then
	RsoMod = {}
end
:o

i'll check control.lua - at least it has more lines of code ;-)

Re: How to create map w/o default ore generation

Posted: Fri Jan 04, 2019 12:40 am
by orzelek
Trblz wrote: Fri Jan 04, 2019 12:30 am This is what i found in the RSO data.lua:

Code: Select all

if not RsoMod then
	RsoMod = {}
end
:o

i'll check control.lua - at least it has more lines of code ;-)
Opsie sorry thats only mod marker.
All the useful stuff is in data-final-fixes.lua.
Might be worth also looking at docs here - it will explain what the files do:
https://lua-api.factorio.com/0.16.51/Da ... cycle.html

control.lua might be a bit heavy lecture ;)

Re: How to create map w/o default ore generation

Posted: Fri Jan 04, 2019 1:22 am
by Trblz
From what I quickly found in RSO, it works as followed something like

for chunks not in starting area
{
destroy ores
create rso_ores
}

which works for me - haven't thought of this way of doing it before.

Re: How to create map w/o default ore generation

Posted: Fri Jan 04, 2019 7:59 am
by orzelek
Trblz wrote: Fri Jan 04, 2019 1:22 am From what I quickly found in RSO, it works as followed something like

for chunks not in starting area
{
destroy ores
create rso_ores
}

which works for me - haven't thought of this way of doing it before.
RSO doesn't destroy ores.
It uses this method:

Code: Select all

function resetRichness(ent)
	if ent and ent.autoplace then
		ent.autoplace.richness_multiplier = 0
		ent.autoplace.richness_base = 0
	end
end
to set resources to have no richness which means they don't spawn. It's a bit of a cheat and it changes between Factorio version - previously it used to set whole autoplace to null but it didn't work well in 0.16.