Page 1 of 1

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

Posted: Sat Oct 24, 2015 6:14 am
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 226 times

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

Posted: Mon Oct 26, 2015 11:14 am
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.

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

Posted: Tue Oct 27, 2015 12:04 am
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

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

Posted: Tue Oct 27, 2015 1:55 am
by Afforess
Confirmed. I am seeing fairly strange results, similar to Choumiko. The objects exist now, but are mangled.

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

Posted: Tue Oct 27, 2015 2:54 am
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.

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

Posted: Tue Oct 27, 2015 5:04 pm
by kovarex
Ugh, I should go back on a tree.

Fixed for 0.12.15 (hopefully).

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

Posted: Mon Sep 12, 2016 7:56 am
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: