(Solved) Invalid Prototype Array Error

Place to get help with not working mods / modding interface.
Post Reply
BrokenScience
Inserter
Inserter
Posts: 26
Joined: Thu Jul 21, 2016 5:31 pm
Contact:

(Solved) Invalid Prototype Array Error

Post 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.
Last edited by BrokenScience on Mon Dec 05, 2016 2:40 am, edited 2 times in total.

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: Invalid Prototype Array Error

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

BrokenScience
Inserter
Inserter
Posts: 26
Joined: Thu Jul 21, 2016 5:31 pm
Contact:

Re: Invalid Prototype Array Error

Post by BrokenScience »

Yea, that fixes this error
Smashing a brick wall with my face would be a lot more rewarding if I didn't just reveal 3 more.

Post Reply

Return to “Modding help”