Suggestion: Make ItemPrototype->SpoilResult Behave Like RecipePrototype->Results for Greater Flexibility

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
kocur4d
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri Sep 02, 2016 1:15 pm
Contact:

Suggestion: Make ItemPrototype->SpoilResult Behave Like RecipePrototype->Results for Greater Flexibility

Post by kocur4d »

I made a post yesterday asking if it is possible for an item to spoil into multiple items based on probability. This feature aligns closely with the idea I’m working on for my mod, which revolves around a new type of ore called Probabilitium. This ore can be processed into basic resources like iron, copper, stone, or coal based on probabilistic outcomes.

While there were some helpful suggestions and hacks on how to achieve this, I believe the ItemPrototype->SpoilResult property would benefit greatly from more flexibility. In my mind, it seems conceptually similar to how RecipePrototype->Results behaves, allowing for more complex outcomes such as multiple possible results with assigned probabilities.

Expanding the functionality of SpoilResult would not only help my mod but could open up new possibilities for other mods as well.

Please let me know your thoughts on this suggestion.

Link to my post: viewtopic.php?f=25&t=123628
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3516
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: Suggestion: Make ItemPrototype->SpoilResult Behave Like RecipePrototype->Results for Greater Flexibility

Post by boskid »

This is quite unlikely to happen because this creates a lot of new corner cases we would have to handle. For example if you have a lab and a science pack would spoil into 5 items, where would those new items go? We cannot simply reject spoiling and so if more items would be created, some of them would have to be inserted into the inventory but if the inventory has no space for other items then what, should those items get dropped on ground? What if such item is inside of a script inventory which is not associated with any point on surface so we cannot drop the items around.
kocur4d
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri Sep 02, 2016 1:15 pm
Contact:

Re: Suggestion: Make ItemPrototype->SpoilResult Behave Like RecipePrototype->Results for Greater Flexibility

Post by kocur4d »

Oh, bummer! That makes sense regarding the corner cases :sad-face:

I do find it kind of amusing to imagine a delayed Probabilitium train traveling from the ore site to the processing site, "spilling the beans" along the way! Though, I can see how that might not be everyone’s idea of fun.
Last edited by kocur4d on Wed Dec 04, 2024 3:24 pm, edited 1 time in total.
kocur4d
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri Sep 02, 2016 1:15 pm
Contact:

Re: Suggestion: Make ItemPrototype->SpoilResult Behave Like RecipePrototype->Results for Greater Flexibility

Post by kocur4d »

How about if it would spoil to one out of many? Aka always single item but from choice of items.

Is something like that possible in the codebase?
curiosity
Filter Inserter
Filter Inserter
Posts: 587
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: Suggestion: Make ItemPrototype->SpoilResult Behave Like RecipePrototype->Results for Greater Flexibility

Post by curiosity »

Can't you just put a trigger on it and do it yourself?
protocol_1903
Fast Inserter
Fast Inserter
Posts: 189
Joined: Fri Sep 09, 2022 4:33 pm
Contact:

Re: Suggestion: Make ItemPrototype->SpoilResult Behave Like RecipePrototype->Results for Greater Flexibility

Post by protocol_1903 »

Related post asking for spoil_result to be a weighted table. I feel like this would be a better alternative, but still in the same vein as having a results table
If you need to reach me, message me on discord.

I make qol mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903
If you have a mod idea, I can look into it.
Post Reply

Return to “Modding interface requests”