Page 1 of 1

(Solved) Invalid Prototype Array Error

Posted: Sat Dec 03, 2016 4:30 am
by BrokenScience
I just started modding recently and cant load any data into the game because of an Invalid Prototype Array error. I copied the format I used from the base mod for all of the things I wish to add. Here is an example of one of the files:

Code: Select all

data:extend( 
{
	type = "item-subgroup",
	name = "economy",
	group = "logistics",
	order = "i",
},
{
    type = "item-subgroup",
	name = "portal",
	group = "intermediate-products",
	order = "g",
}
)
I don't know why all of these I have cause it to crash and every help guide and tutorial has theirs set up in the same way, or at least, looks the same. I've tried commenting any that give me an error out to see if any work, but none have so far. Any help would be much appreciated.

Note: I have searched the error and discovered what it meant, but still could not figure out what was causing it and how to fix it.

Re: Invalid Prototype Array Error

Posted: Sat Dec 03, 2016 4:56 am
by Nexela
Data:Extend needs a table of tables, You are missing the outermost table {}

Code: Select all

    data:extend(
    { --missing
    {
       type = "item-subgroup",
       name = "economy",
       group = "logistics",
       order = "i",
    },
    {
        type = "item-subgroup",
       name = "portal",
       group = "intermediate-products",
       order = "g",
    }
    } -- missing
    )

Re: Invalid Prototype Array Error

Posted: Mon Dec 05, 2016 2:39 am
by BrokenScience
Yea, that fixes this error