How to make a resource only spawn on non-homeworld planets
How to make a resource only spawn on non-homeworld planets
Hi, I was wondering if anyone knew how to make a resource only spawn on planets and moons(and not homeworlds) when space exploration is enabled. I tried tapping into SE's universe.lua file during the data stage and adding my ore into default_resource_order, resource_word_rules.not_space, and resource_word_rules.not_homeworld, but it still appears in all those places. any ideas?
Re: How to make a resource only spawn on non-homeworld planets
What you could do is to apply your resources's autoplace settings after surface creation:
- register on_surface_created
- call SE remote function `get_zone_from_surface_index` and to get the zone check if `is_homeworld` is false
- then apply map settings on this surface by adding your resource:
if neccessary, add with a custom noise expression that reflects richness.
- register on_surface_created
- call SE remote function `get_zone_from_surface_index` and to get the zone check if `is_homeworld` is false
- then apply map settings on this surface by adding your resource:
Code: Select all
mapgen.autoplace_settings.entity.settings.settings["your-resource"] = {frequency=1, size=1, richness=1}
Code: Select all
mapgen.property_expression_names["your-resource:richness"] = "your-noise-expression"
Re: How to make a resource only spawn on non-homeworld planets
Great! I'll try it out.