[0.12.13] [kovarex] Lua data de-serialization doesn't work

This subforum contains all the issues which we already resolved.
Post Reply
Rseding91
Factorio Staff
Factorio Staff
Posts: 13175
Joined: Wed Jun 11, 2014 5:23 am
Contact:

[0.12.13] [kovarex] Lua data de-serialization doesn't work

Post by Rseding91 »

Deserilization doesn't work for LuaObject references saved in the global table in 0.12.13 if they use un-named indexes (table.insert(global.table, {game.player.selected})

See the attached screenshot command history: http://i.imgur.com/0X3wubX.jpg

I'm 100% sure it's related to this fix: https://forums.factorio.com/forum/vie ... 11&t=17204

The commands where run from top down then before the 2nd "game.player.print(serpent.dump(global.table))" I saved, exited, and loaded. As you can see the 2nd time I ran the command after I loaded the game it didn't run deserialization on the data.

Attached save that should load and have 2 references (1 for each of the two pipes on the screen):
Lua-table-save-load.zip
(657.8 KiB) Downloaded 225 times
If you want to get ahold of me I'm almost always on Discord.

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.12.13] [kovarex] Lua data de-serialization doesn't work

Post by kovarex »

Ok, the problem is fixed for 0.12.14.

The one was pretty interesting, lua actually merges same tables into one itnernal objects and uses reference counting. Once the object is to be changed, it splits the tables internally. Our logic of "go once through every table" did ignore the split table.

Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [0.12.13] [kovarex] Lua data de-serialization doesn't work

Post by Choumiko »

kovarex wrote:The one was pretty interesting,
I think it still is interesting:
Same procedure as Rseding described.
http://i.imgur.com/5LAZjkm.png

Edit: Also doesn't work when using global.table.a = game.player.selected

Tested on Win7 64, fresh downloaded zip version of Factorio
Attachments
table-save-load.zip
(922.96 KiB) Downloaded 232 times

User avatar
Afforess
Filter Inserter
Filter Inserter
Posts: 422
Joined: Tue May 05, 2015 6:07 pm
Contact:

Re: [0.12.13] [kovarex] Lua data de-serialization doesn't work

Post by Afforess »

Confirmed. I am seeing fairly strange results, similar to Choumiko. The objects exist now, but are mangled.

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

Re: [0.12.13] [kovarex] Lua data de-serialization doesn't work

Post by Rseding91 »

Confirmed in 0.12.14 - this is enough to cause the same issue:
  • Mouse over an entity
  • /c global.table = {}
  • /c global.table.a = game.player.selected
Save, load and the data isn't loaded.
If you want to get ahold of me I'm almost always on Discord.

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.12.13] [kovarex] Lua data de-serialization doesn't work

Post by kovarex »

Ugh, I should go back on a tree.

Fixed for 0.12.15 (hopefully).

User avatar
Brypha
Manual Inserter
Manual Inserter
Posts: 1
Joined: Mon Sep 12, 2016 7:50 am
Contact:

Re: [0.12.13] [kovarex] Lua data de-serialization doesn't work

Post by Brypha »

Huh... maybe this problem because of poor internet conection ?? :roll: Well... you can try another proxy, for example advanced.name/ It helps me always :geek:

Post Reply

Return to “Resolved Problems and Bugs”