Need help to find a mistake

Place to get help with not working mods / modding interface.
iCamper
Burner Inserter
Burner Inserter
Posts: 17
Joined: Sat Apr 16, 2016 11:04 pm
Contact:

Need help to find a mistake

Post 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
MrDoomah
Fast Inserter
Fast Inserter
Posts: 196
Joined: Mon Jun 01, 2015 1:11 pm
Contact:

Re: Need help to find a mistake

Post 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")
iCamper
Burner Inserter
Burner Inserter
Posts: 17
Joined: Sat Apr 16, 2016 11:04 pm
Contact:

Re: Need help to find a mistake

Post 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
User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: Need help to find a mistake

Post by prg »

What code did you add exactly? Sounds like a typo.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
iCamper
Burner Inserter
Burner Inserter
Posts: 17
Joined: Sat Apr 16, 2016 11:04 pm
Contact:

Re: Need help to find a mistake

Post 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"
])
})
User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: Need help to find a mistake

Post 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?
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
iCamper
Burner Inserter
Burner Inserter
Posts: 17
Joined: Sat Apr 16, 2016 11:04 pm
Contact:

Re: Need help to find a mistake

Post 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)
User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: Need help to find a mistake

Post 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())
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
iCamper
Burner Inserter
Burner Inserter
Posts: 17
Joined: Sat Apr 16, 2016 11:04 pm
Contact:

Re: Need help to find a mistake

Post by iCamper »

lol i thought that was just to simple O.O
TYYY :D :D :D
User avatar
DedlySpyder
Filter Inserter
Filter Inserter
Posts: 253
Joined: Fri Jun 20, 2014 11:42 am
Contact:

Re: Need help to find a mistake

Post 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.
Last edited by DedlySpyder on Mon May 30, 2016 10:03 pm, edited 1 time in total.
MrDoomah
Fast Inserter
Fast Inserter
Posts: 196
Joined: Mon Jun 01, 2015 1:11 pm
Contact:

Re: Need help to find a mistake

Post 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 ;)
Post Reply

Return to “Modding help”