How to create map w/o default ore generation

Place to get help with not working mods / modding interface.
User avatar
Trblz
Long Handed Inserter
Long Handed Inserter
Posts: 63
Joined: Thu Sep 21, 2017 1:23 am
Contact:

How to create map w/o default ore generation

Post 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?
My Mod list: Necormant co-author
orzelek
Smart Inserter
Smart Inserter
Posts: 3928
Joined: Fri Apr 03, 2015 10:20 am
Contact:

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

Post 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.
User avatar
Trblz
Long Handed Inserter
Long Handed Inserter
Posts: 63
Joined: Thu Sep 21, 2017 1:23 am
Contact:

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

Post 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 ;-)
My Mod list: Necormant co-author
orzelek
Smart Inserter
Smart Inserter
Posts: 3928
Joined: Fri Apr 03, 2015 10:20 am
Contact:

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

Post 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 ;)
User avatar
Trblz
Long Handed Inserter
Long Handed Inserter
Posts: 63
Joined: Thu Sep 21, 2017 1:23 am
Contact:

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

Post 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.
My Mod list: Necormant co-author
orzelek
Smart Inserter
Smart Inserter
Posts: 3928
Joined: Fri Apr 03, 2015 10:20 am
Contact:

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

Post 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.
Post Reply

Return to “Modding help”