[Done] Productivity Module / Intermediate Product

Place to get help with not working mods / modding interface.
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

[Done] Productivity Module / Intermediate Product

Post 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.
Last edited by TheSAguy on Wed Aug 01, 2018 3:52 pm, edited 3 times in total.
Bilka
Factorio Staff
Factorio Staff
Posts: 3310
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Productivity Module / Intermediate Product

Post by Bilka »

I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: [Done] Productivity Module / Intermediate Product

Post 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.
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: [Done] Productivity Module / Intermediate Product

Post 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"},
Bilka
Factorio Staff
Factorio Staff
Posts: 3310
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: [Done] Productivity Module / Intermediate Product

Post 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.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: [Done] Productivity Module / Intermediate Product

Post by TheSAguy »

Got it,
Thanks.
Post Reply

Return to “Modding help”