What's the cause of this error?

Place to get help with not working mods / modding interface.
Post Reply
User avatar
Sirenfal
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Tue Jan 10, 2017 1:42 am
Contact:

What's the cause of this error?

Post by Sirenfal »

Code: Select all

Error while running deserialisation: [string "do local _={allocator={size_index={[0x2.70000..."]:1: too many local variables (limit is 200) in main function near '='
script.dat is 122kb and there's nothing obviously obscene or broken inside it. I have several nested tables (composited classes with metatables restored at runtime).

EDIT: There's a lot of this stuff... 241 > 200 of them. Is this just restoring entity references?

Code: Select all

local table1={magic="802384732948701238470123",type=0x0p+0,entitytarget=0x1.dp+4}
_.factories["1"].restore[table1]={[0x1p+0]=true,[0x2p+0]=true,[0x3p+0]=true,[0x4p+0]=false}

Rseding91
Factorio Staff
Factorio Staff
Posts: 13248
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: What's the cause of this error?

Post by Rseding91 »

You're using tables as keys in other tables. Don't do that.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Sirenfal
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Tue Jan 10, 2017 1:42 am
Contact:

Re: What's the cause of this error?

Post by Sirenfal »

I suggest you add that to the Lua global API page

Post Reply

Return to “Modding help”