Page 1 of 1

Invalid Prototype Array Error

Posted: Tue Apr 09, 2019 2:24 am
by theradman221
I'm trying to update my mod to .17 and keep getting an invalid prototype array error. Any help would be appreciated thanks!
Error
Error
error prototype.PNG (15.14 KiB) Viewed 2166 times
Mod Github
https://github.com/theradman221/Compressed-Materials

Re: Invalid Prototype Array Error

Posted: Tue Apr 09, 2019 5:48 am
by darkfrei
Not sure, but it looks like the error comes from data:extend
Try to make it deeper:
data:extend({compress_recipes})
or

Code: Select all

for i, recipe in pairs (compress_recipes) do
  data:extend({recipe})
end
Note that you get error if you extend with nil or {}

Re: Invalid Prototype Array Error

Posted: Tue Apr 09, 2019 3:55 pm
by theradman221
Thanks that seems to have fixed it! Now it's just not picking up any items or recipes.

Re: Invalid Prototype Array Error

Posted: Tue Apr 09, 2019 6:45 pm
by darkfrei
theradman221 wrote: Tue Apr 09, 2019 3:55 pm Thanks that seems to have fixed it! Now it's just not picking up any items or recipes.

Code: Select all

for i, recipe in pairs (compress_items) do
  data:extend({item})
end
:arrow: in the first line is "recipe", but the second is "item"

Re: Invalid Prototype Array Error

Posted: Tue Apr 09, 2019 7:33 pm
by theradman221
thanks for seeing that, I guess i've been staring at it too long to notice....
Dang, after editing it it's still not working

Re: Invalid Prototype Array Error

Posted: Tue Apr 09, 2019 9:45 pm
by darkfrei
theradman221 wrote: Tue Apr 09, 2019 7:33 pm thanks for seeing that, I guess i've been staring at it too long to notice....
Dang, after editing it it's still not working
Just add more debug information, check if some prototypes are not correctly generated. Without debug info it's really difficult.

I'm using this mod to check what exactly changing has made the code.

Re: Invalid Prototype Array Error

Posted: Tue Apr 09, 2019 9:53 pm
by theradman221
I'll download that mod and look at it, unfortunately college is keeping me quite busy and I've just been working on this whenever I have a few minutes.