[2.0.6] Replace `change-recipe-productivity` with `add-recipe-effect` or similar

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
micromario
Fast Inserter
Fast Inserter
Posts: 116
Joined: Thu Apr 05, 2018 11:53 am
Contact:

[2.0.6] Replace `change-recipe-productivity` with `add-recipe-effect` or similar

Post by micromario »

Currently on the technology modifier struct we have `ChangeRecipeProductivityModifier`which aids in adding infinite productivity researches.

Could this instead be replaced with a more generic struct?

Code: Select all

technology.effects = {
	{
		type = 'add-recipe-effect',
		recipe = 'iron-gear-wheel',
		changes = {
			quality = 0.1,
			productivity = -0.05,
			speed = 0.1,
			pollution = 0.2,
		}
	}
}
curiosity
Filter Inserter
Filter Inserter
Posts: 587
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: [2.0.6] Replace `change-recipe-productivity` with `add-recipe-effect` or similar

Post by curiosity »

I am surprised it doesn't already allow applying an arbitrary effect.
Rseding91
Factorio Staff
Factorio Staff
Posts: 15010
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.0.6] Replace `change-recipe-productivity` with `add-recipe-effect` or similar

Post by Rseding91 »

curiosity wrote: Sat Oct 19, 2024 9:56 am I am surprised it doesn't already allow applying an arbitrary effect.
Some additional information: every bit of logic we add to the game we have to program in support for everywhere it's used. Recipes did not previously have any support for runtime productivity or modification of that value. That all had to be added to recipes, saved/loaded, the technology effects hooked up, tooltips handled everywhere they get shown, the bonus GUI, the productivity calculation in crafting machines and so on.

So to make it support an arbitrary effect isn't possible. We would have had to programmed in every possible effect we wanted to be runtime adjustable on the recipes and done everything listed above. And of course tests for it all.

Given base game had no plans to use any of that - it wasn't done as part of the expansion work.
If you want to get ahold of me I'm almost always on Discord.
curiosity
Filter Inserter
Filter Inserter
Posts: 587
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: [2.0.6] Replace `change-recipe-productivity` with `add-recipe-effect` or similar

Post by curiosity »

Maybe it is that bad, I don't actually know how effects are handled in code. Though I still don't see why adding one effect to a recipe would be fundamentally different from adding another.
Post Reply

Return to “Modding interface requests”