Page 1 of 1

[Done] Productivity Module / Intermediate Product

Posted: Mon Jul 30, 2018 8:17 pm
by TheSAguy
Hi,

I have a couple recipe's that can't use Productivity Modules in them, because it's saying it's not an Intermediate Product.
Was just wondering how this get's defined, since the one is just a variation of a vanilla recipe that does allow productivity modules.

Is there a flag or something I need to set on the recipe level?

Thanks.

Re: Productivity Module / Intermediate Product

Posted: Mon Jul 30, 2018 9:19 pm
by Bilka

Re: [Done] Productivity Module / Intermediate Product

Posted: Tue Jul 31, 2018 3:59 pm
by TheSAguy
I thought I had it figured out, but not quite.
So recipe's that use vanilla entities work now, I can now use Productivity Modules on them, but my custom entities don't accept Productivity Modules.

I've added the code below to the entities:

Code: Select all

	module_specification =
    {
      module_slots = 3
    },
	allowed_effects = {"consumption", "speed", "productivity"},
Speed and Consumption work, but not Productivity.


I added the productivity with below code, giving it the recipes.

Code: Select all

function BI_Functions.lib.allow_productivity(recipe_name)
	if data.raw.recipe[recipe_name] then
		for i, module in pairs(data.raw.module) do
			if module.limitation and module.effect.productivity then
				table.insert(module.limitation, recipe_name)
			end
		end
	end
end
Image

What am I missing.

Re: [Done] Productivity Module / Intermediate Product

Posted: Wed Aug 01, 2018 3:54 pm
by TheSAguy
For some reason, you need to include "Pollution" module support for the Productivity module to be inserted.
Added pollution below to make it work:

Code: Select all

   module_specification =
    {
      module_slots = 3
    },
   allowed_effects = {"consumption", "speed", "productivity", "pollution"},

Re: [Done] Productivity Module / Intermediate Product

Posted: Wed Aug 01, 2018 3:57 pm
by Bilka
TheSAguy wrote:For some reason, you need to include "Pollution" module support for the Productivity module to be inserted.
The module also has the pollution effect, so the entity needs to allow that.

Re: [Done] Productivity Module / Intermediate Product

Posted: Wed Aug 01, 2018 5:22 pm
by TheSAguy
Got it,
Thanks.