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.
Quality Ore Patch?
Re: Quality Ore Patch?
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.
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.
Re: Quality Ore Patch?
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.
The spoilage idea is very clever, I'll see if I can make that work this weekend.