stone = {
frequency = 1,
richness = 1,
size = 0}
I still see stones around.
Could you plz add fields to stop the auto map gen from generating water and stones. It helps when making way different game mode. For now, I have to gen a new surface as empty, and remove stones and water. Or I have to copy tile information from a source while ignore all the others.
Plz add a way to stop map gen algo from generating stones.
-
- Fast Inserter
- Posts: 152
- Joined: Sun Jun 16, 2019 4:04 pm
- Contact:
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Plz add a way to stop map gen algo from generating stones.
The code looks like it's for stone-ore, but what you're saying sounds like you're talking about those decorative stone-rock entities.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
-
- Fast Inserter
- Posts: 152
- Joined: Sun Jun 16, 2019 4:04 pm
- Contact:
Re: Plz add a way to stop map gen algo from generating stones.
My code for now is something likeeradicator wrote: ↑Thu Dec 03, 2020 2:10 pm The code looks like it's for stone-ore, but what you're saying sounds like you're talking about those decorative stone-rock entities.
--Removing water
if event.x>-5 and event.x<5 and (-5<y<)
then surface.get_tile(...).name == "water" or "deepwater"
surface.set_tiles(set to grass-2 or something)
end
--Removing rocks.
local results = surface.find_entities_filtered{area = event.area, type = "simple-entity"}
for k,v in pairs(results)
if v.name == "rock" or big rock or any rock.
v.destroy()
end
end
I saw another way to stop rocks from being generated is in Singistics Mod. The method is inside data.lua. But water is still generated. And it affect the prototypes, so it's not very flexible. If people prefer to mix my mod with others, they would probably encounter some issue.
Re: Plz add a way to stop map gen algo from generating stones.
Code: Select all
for _,rock in pairs(data.raw['simple-entity']) do
rock.autoplace = nil
end
-
- Fast Inserter
- Posts: 152
- Joined: Sun Jun 16, 2019 4:04 pm
- Contact:
Re: Plz add a way to stop map gen algo from generating stones.
Yeah, this is the reason I prefer a per-surface method. People are always inspired by tons of wired ideas and try combining different things from all corners of this planet. Any way, thank you for this idea. I'll look into it later.PFQNiet wrote: ↑Fri Dec 04, 2020 4:46 amShould remove all rocks, including those added by other mods, but when other mods are involved just be careful they don't actually use simple-entity with autoplace for stuff other than rocks.Code: Select all
for _,rock in pairs(data.raw['simple-entity']) do rock.autoplace = nil end
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Plz add a way to stop map gen algo from generating stones.
You need to look into MapGenSettings.
Here's some old code (not tested in 1.1) i once used to create a completely empty map preset. But if you don't need it selectable in the NewGame menu you should be able to just apply it in i.e. on_init.
Here's some old code (not tested in 1.1) i once used to create a completely empty map preset. But if you don't need it selectable in the NewGame menu you should be able to just apply it in i.e. on_init.
Code: Select all
local autoplace_controls = {}
for _,control in pairs(data.raw['autoplace-control']) do
autoplace_controls[control.name] = {
frequency=0.01,
richness=50,
size=0
}
end
local autoplace_settings = {
['decorative'] = {
treat_missing_as_default = false,
},
['entity'] = {
treat_missing_as_default = false,
},
['tile'] = {
treat_missing_as_default = true,
},
}
data.raw['map-gen-presets'].default['er:empty-map'] = {
order = 'zzz',
basic_settings = {
autoplace_controls = autoplace_controls,
-- default_enable_all_autoplace_controls = false, --prevents desert
autoplace_settings = autoplace_settings,
cliff_settings={
-- cliff_elevation_0=10,
-- cliff_elevation_interval=40,
-- name="cliff",
richness=0
},
property_expression_names={ --red desert
["control-setting:aux:bias"]="0.500000",
["control-setting:aux:frequency:multiplier"]="0.166667",
["control-setting:moisture:bias"]="-0.500000",
["control-setting:moisture:frequency:multiplier"]="0.166667"
},
terrain_segmentation=1,
water=0,
starting_area = 0,
seed=553780354,
}
}
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
-
- Fast Inserter
- Posts: 152
- Joined: Sun Jun 16, 2019 4:04 pm
- Contact:
Re: Plz add a way to stop map gen algo from generating stones.
Thank you. I'll look into it tomorrow.
By the way, I planned to write a Factorio tool kit. Something like get_random_point("nauvis"). And already a branch of simple prototypes like projectile prototype without graphics. Or assemblers which don't consume power.
Any idea?