Page 1 of 1

[Rseding91] [0.17.5]Deserialization error after creating scenario

Posted: Tue Mar 05, 2019 10:32 am
by Choumiko
To reproduce:
1. Open map editor from main menu
2. run

Code: Select all

/c global.player = game.player
in the console
3. Click "Save and play"
4. Results (current.log) in:
2946.087 Failed to deserialize mod data for "level". Error: Deserialization error, LuaObject targets to wrong object. Save file is probably corrupted.
2946.098 Error AppManagerStates.cpp:1426: Failed to load saved data for following mods:
level

Save file is probably corrupted.
Selecting a tree (or something else i guess) in step 2 and using

Code: Select all

/c global.player = game.player.selected
doesn't result in an error.

Original bug report (from my mod): https://github.com/Choumiko/FARL/issues/99
I save the player in the global table during script.on_init()

Re: [0.17.5]Deserialization error after creating scenario

Posted: Tue Mar 05, 2019 11:09 am
by Rseding91
Thanks for the report however I can't reproduce the error you're getting. When I test it, no matter what I do it works without error.

Is there some other step I'm missing?

I installed the latest version of FARL off the mod portal and ran your steps without issue every time.

Re: [0.17.5]Deserialization error after creating scenario

Posted: Tue Mar 05, 2019 11:58 am
by Choumiko
Just to make extra sure, every click to reproduce:
1. Map editor
2. New scenario
3. Play
4. Escape
5. Save and play
6. Give the scenario a name
7. Save
-> Error

Attached current.log and zipped scenario

There is one "magic" thingy in the script.dat, that iirc refernces a FactorioLuaObject

Edit: Same thing on Linux (steam and non steam version), also same error when replacing step 5 with only saving as a scenario, then loading via Play -> Scenarios

Re: [0.17.5]Deserialization error after creating scenario

Posted: Tue Mar 05, 2019 2:40 pm
by Rseding91
Ok, I found the problem.

It's going to take some time to fix. Basically the make-scenario-from-game logic is completely broken and has never worked with script.dat.

Re: [Rseding91] [0.17.5]Deserialization error after creating scenario

Posted: Sun Mar 17, 2019 7:34 pm
by Rseding91
Ok, it's now fixed for the next version of 0.17.