Search found 3 matches

by OilyMac
Fri Jul 04, 2025 2:48 pm
Forum: Resolved Problems and Bugs
Topic: [2.0.58] surface.create_entity() crashes with "quality is zero"
Replies: 1
Views: 264

[2.0.58] surface.create_entity() crashes with "quality is zero"

Trying to create an item-on-ground via surface.create_entity() crashes if the stack item has quality. E.g.,

game.surfaces[event.surface_index].create_entity({name="item-on-ground", position=event.source_position, stack={name="iron-ore", count=1, quality="uncommon"}})

results in a crash:

Error ...
by OilyMac
Fri Jun 27, 2025 8:09 pm
Forum: Modding help
Topic: Quality Ore Patch?
Replies: 2
Views: 185

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 ...
by OilyMac
Fri Jun 27, 2025 12:03 am
Forum: Modding help
Topic: Quality Ore Patch?
Replies: 2
Views: 185

Quality Ore Patch?

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 ...

Go to advanced search