Quality Ore Patch?

Place to get help with not working mods / modding interface.
OilyMac
Manual Inserter
Manual Inserter
Posts: 3
Joined: Mon Dec 20, 2021 4:57 am
Contact:

Quality Ore Patch?

Post by OilyMac »

I'm trying to create quality ore patches. So for example, if you mined from an uncommon iron ore patch, you'd always get uncommon iron ore (ignoring quality modifiers from the mining drill). But I haven't been able to find a way to make it work. The closest I've gotten is to make my own "uncommon-iron-ore" resource and item, and then situationally deplete an existing iron ore resource entity and replace it with my uncommon one. But I couldn't find a way to turn the "uncommon-iron-ore" into iron-ore of uncommon quality.

I'm totally new to factorio modding, so before deciding it is impossible, I wanted to ask here.
Osmo
Long Handed Inserter
Long Handed Inserter
Posts: 83
Joined: Wed Oct 23, 2024 12:08 pm
Contact:

Re: Quality Ore Patch?

Post by Osmo »

You might be able to get away with setting the quality of resource entities by script inside on_chunk_generated event, but not sure if this will make mining it return oreof thesame quality.
Otherwise the only option would be to replace every mined item by script, which can practically only be done by making an "uncommon-iron-ore" item with a 1 tick spoil time, and a spoil_to_trigger_result that will replace that item with an iron ore of uncommon quality.
OilyMac
Manual Inserter
Manual Inserter
Posts: 3
Joined: Mon Dec 20, 2021 4:57 am
Contact:

Re: Quality Ore Patch?

Post by OilyMac »

Sadly, passing quality into create_entity for a resource patch doesn't seem to do anything, probably because the prototype doesn't have quality. There's also result_quality, but it's available only for crafiting machines, which apparently doesn't include mining drills.

The spoilage idea is very clever, I'll see if I can make that work this weekend.
Post Reply

Return to “Modding help”