How to add a mineable fluid resource that only spawns one entity per patch?

Place to get help with not working mods / modding interface.
Zeritor
Burner Inserter
Burner Inserter
Posts: 5
Joined: Thu Mar 24, 2016 12:04 pm
Contact:

How to add a mineable fluid resource that only spawns one entity per patch?

Post by Zeritor »

After reading through all the prototypes around resources and map gen settings/autoplace settings, I can't see a way to make it only spawn one of the entity.

I want a fixed yield, with a fixed size and just one to appear anywhere the resource is "rolled". I can't see an easy way to do this. Is it to with the noise generation? Do I need a basically black/white noise distributed to roughly what I'm after?
robot256
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: How to add a mineable fluid resource that only spawns one entity per patch?

Post by robot256 »

I don't remember exactly how it's done, but Krastorio does this for Immersite deposits. You could check the source code there for reference.
My mods: Multiple Unit Train Control, RGB Pipes, Shipping Containers, Rocket Log, Smart Artillery Wagons.
Maintainer of Auto Deconstruct, Cargo Ships, Vehicle Wagon, Honk, Shortwave.
Zeritor
Burner Inserter
Burner Inserter
Posts: 5
Joined: Thu Mar 24, 2016 12:04 pm
Contact:

Re: How to add a mineable fluid resource that only spawns one entity per patch?

Post by Zeritor »

I was trying to think of all the mods that did this and rememebered some from my K2SE playthrough, then ruled it out as SE isn't 2.0 yet... Totally forgetting Immersite is from K2. Thank you, I will do just that.
Natha
Filter Inserter
Filter Inserter
Posts: 282
Joined: Sun Mar 15, 2015 1:48 pm
Contact:

Re: How to add a mineable fluid resource that only spawns one entity per patch?

Post by Natha »

Also pyrawores does that with e.g. aluminium rock. It's basically a very low spawning probability
meifray
Long Handed Inserter
Long Handed Inserter
Posts: 96
Joined: Sat May 29, 2021 6:12 pm
Contact:

Re: How to add a mineable fluid resource that only spawns one entity per patch?

Post by meifray »

In vanilla, we use EntityPrototype.map_generator_bounding_box to indirectly limit how much it can be created in a patch.
Post Reply

Return to “Modding help”