adding new resources, need help

Place to get help with not working mods / modding interface.
xattus
Inserter
Inserter
Posts: 24
Joined: Tue Apr 19, 2016 1:34 pm
Contact:

adding new resources, need help

Post by xattus »

Heyho, I'm trying to add a new resource using the functions that were added in 0.13, getting this problem:

http://puu.sh/pPTmH/3b53804def.png

aaand this the code:

http://pastebin.com/601UESa4

I'm not on advanced level in LUA, so might be a silly syntax error somewhere, but from what I've understand, for some reason the resource function doesn't return properly. Btw whoever wrote the functions to make it more streamlined - thank you, it's much more clear now than it was when I added this on 0.12. It just needs to work. :D
xattus
Inserter
Inserter
Posts: 24
Joined: Tue Apr 19, 2016 1:34 pm
Contact:

Re: adding new resources, need help

Post by xattus »

small spelling mistake on line 98 corrected, still no dice.
User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: adding new resources, need help

Post by prg »

Remove the curly braces around the resource() call.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
xattus
Inserter
Inserter
Posts: 24
Joined: Tue Apr 19, 2016 1:34 pm
Contact:

Re: adding new resources, need help

Post by xattus »

I thought it's going to be some BS like that :D

Thanks. But why? xD I want to understand.
User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: adding new resources, need help

Post by prg »

The resource() function already returns a table containing the right things. Putting that into yet another table doesn't make sense.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
xattus
Inserter
Inserter
Posts: 24
Joined: Tue Apr 19, 2016 1:34 pm
Contact:

Re: adding new resources, need help

Post by xattus »

ah, yeah.. LUA 101 that I'm missing. Anyway, I'm so glad that they've coded it this way, much more understandable and one knows what to change instead of looking at it and going "jeez what do all dem numbarz do?"

Thank you so much!
Post Reply

Return to “Modding help”