Page 1 of 1

adding new resources, need help

Posted: Mon Jul 04, 2016 1:46 pm
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

Re: adding new resources, need help

Posted: Mon Jul 04, 2016 1:58 pm
by xattus
small spelling mistake on line 98 corrected, still no dice.

Re: adding new resources, need help

Posted: Mon Jul 04, 2016 2:16 pm
by prg
Remove the curly braces around the resource() call.

Re: adding new resources, need help

Posted: Mon Jul 04, 2016 3:58 pm
by xattus
I thought it's going to be some BS like that :D

Thanks. But why? xD I want to understand.

Re: adding new resources, need help

Posted: Mon Jul 04, 2016 4:05 pm
by prg
The resource() function already returns a table containing the right things. Putting that into yet another table doesn't make sense.

Re: adding new resources, need help

Posted: Mon Jul 04, 2016 4:29 pm
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!