Page 1 of 1

Need help to find a mistake

Posted: Mon May 30, 2016 6:37 am
by iCamper
Hey guys
after i finished my mod i saw ingame that i cant use productive modules in my recipes
can someone have a look at this pls :x :)
http://www.file-upload.net/download-116 ... 1.zip.html

Re: Need help to find a mistake

Posted: Mon May 30, 2016 11:39 am
by MrDoomah
Look at Factorio\data\base\prototypes\item\module.lua
There you see that the modules themselves are limited to certain items. You need to do something like:

Code: Select all

table.insert(data.raw.module["productivity-module"].limitation, "your recipe")

Re: Need help to find a mistake

Posted: Mon May 30, 2016 12:22 pm
by iCamper
thanks
i did it like u said but now i got an error: wrong number of arguments to insert ._.
im not that good in stuff like modding xD sry

Re: Need help to find a mistake

Posted: Mon May 30, 2016 12:26 pm
by prg
What code did you add exactly? Sounds like a typo.

Re: Need help to find a mistake

Posted: Mon May 30, 2016 12:33 pm
by iCamper
I changed somethink by my own new errorcode: mistake near "productivitymodulelimitation"

Code: Select all

data:extend({
table.insert(data.raw.module[function productivitymodulelimitation()
return
"advanced-electronic-circuit",
"advanced-advanced-circuit",
"advanced-processing-unit"
])
})

Re: Need help to find a mistake

Posted: Mon May 30, 2016 12:35 pm
by prg
iCamper wrote:I changed somethink by my own new errorcode: mistake near "productivitymodulelimitation"

Code: Select all

data:extend({
table.insert(data.raw.module[function productivitymodulelimitation()
return
"advanced-electronic-circuit",
"advanced-advanced-circuit",
"advanced-processing-unit"
])
})
WTF are you trying to do there?

Re: Need help to find a mistake

Posted: Mon May 30, 2016 12:37 pm
by iCamper
i sayed im not that good at modding sorry men .... ._.
i just tryed to add it like it is in the normal list from factorio :/
sry sry ... :/
(its my first mod)

Re: Need help to find a mistake

Posted: Mon May 30, 2016 12:39 pm
by prg
Maybe you want

Code: Select all

table.insert(data.raw.module["productivity-module"].limitation, "advanced-electronic-circuit")
table.insert(data.raw.module["productivity-module"].limitation, "advanced-advanced-circuit")
table.insert(data.raw.module["productivity-module"].limitation, "advanced-processing-unit")
(not inside data:extend())

Re: Need help to find a mistake

Posted: Mon May 30, 2016 12:40 pm
by iCamper
lol i thought that was just to simple O.O
TYYY :D :D :D

Re: Need help to find a mistake

Posted: Mon May 30, 2016 4:24 pm
by DedlySpyder
Whoops, I just realized I never did this for my mod. As a side note, you have to add it to each productivity module individually, so something like this for each item:

Code: Select all

table.insert(data.raw.module["productivity-module"].limitation, "recipe_name")
table.insert(data.raw.module["productivity-module-2"].limitation, "recipe_name")
table.insert(data.raw.module["productivity-module-3"].limitation, "recipe_name")
EDIT: Thanks MrDoomah for the correction.

Re: Need help to find a mistake

Posted: Mon May 30, 2016 4:50 pm
by MrDoomah
DedlySpyder wrote:Whoops, I just realized I never did this for my mod. As a side note, you have to add it to each productivity module individually, so something like this for each item:

Code: Select all

table.insert(data.raw.module["productivity-module"].limitation, "item_name")
table.insert(data.raw.module["productivity-module-2"].limitation, "item_name")
table.insert(data.raw.module["productivity-module-3"].limitation, "item_name")
Just remember, it is recipe_name and not the item_name ;)