Allow reset_freshness_on_craft to be per-product

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Thremtopod
Burner Inserter
Burner Inserter
Posts: 15
Joined: Wed Nov 06, 2024 8:52 pm
Contact:

Allow reset_freshness_on_craft to be per-product

Post by Thremtopod »

RecipePrototype has the properties result_is_always_fresh and reset_freshness_on_craft, and ItemProductPrototype has the property percent_spoiled. If a recipe has spoilable ingredients, and a spoilable product with percent_spoiled = 0.5, that product will be 50 percentage points more spoiled than the ingredients. If you want the product to be exactly 50% spoiled, you can do this by also setting the recipe to have result_is_always_fresh or reset_freshness_on_craft be true.

But if this recipe has two spoilable products, and you want one of them to follow the normal spoilage rules and the other to be a specific amount spoiled, there's no way to achieve that. If reset_freshness_on_craft (and possibly result_is_always_fresh too) could be set per-product, this would become doable.

The reason I want to be able to do this is that I'm working on a mod that has a waste-processing recipe chain. The waste spoils into a more annoying type of waste to incentivise dealing with it quickly; I want the waste to always be produced fresh, because its version of spoiling is a separate concern from the regular spoiling of the inputs and other product(s).
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 4387
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: Allow reset_freshness_on_craft to be per-product

Post by boskid »

Implemented for 2.1.
Thremtopod
Burner Inserter
Burner Inserter
Posts: 15
Joined: Wed Nov 06, 2024 8:52 pm
Contact:

Re: Allow reset_freshness_on_craft to be per-product

Post by Thremtopod »

Wow, you guys work fast :D !
Post Reply

Return to “Modding interface requests”