Tokata_RuNeLess
Chieftain
I tried to use TableSaverLoader016 and TSLSerializerCoreV3 to save a table about improvements into database. Besides, am trying to use correct English right here, but I'm not sure. Anyway, thank you for any probable help!
The table used to be like this:
And I managed to rewrite it like this:
and at the bottom of my code:
The VFS is correct, and the mod works well, but it comes out that once I have any data in the table 'MapTable', it becomes unable for me to click 'Save Game', nor 'Quicksave'. The only way to save the game is through IGE (with the table failed to save), or I can only save when the table is empty.
Is there something wrong? Sadly I'm not an experienced lua coder and am unable to point out the mistake.
The table used to be like this:
Code:
MapTable = {}
-- The table would finally contain these columns:
-- MapTable[plot].type
-- MapTable[plot].counterUp -- upgrade
-- MapTable[plot].counterDe -- degrade
And I managed to rewrite it like this:
Code:
MapModData.TiData = MapModData.TiData or {}
TiData = MapModData.TiData
TiData.MapTable = TiData.MapTable or {}
MapTable = TiData.MapTable
include("TableSaverLoader016.lua")
tableRoot = TiData
tableName = "TiData"
include("Tokata_Improvement_TSLSerializerV3.lua") -- Already defined yet
TableLoad(tableRoot, tableName)
and at the bottom of my code:
Code:
function OnModLoaded()
local bNewGame = not TableLoad(tableRoot, tableName)
TableSave(tableRoot, tableName)
end
OnModLoaded()
The VFS is correct, and the mod works well, but it comes out that once I have any data in the table 'MapTable', it becomes unable for me to click 'Save Game', nor 'Quicksave'. The only way to save the game is through IGE (with the table failed to save), or I can only save when the table is empty.
Is there something wrong? Sadly I'm not an experienced lua coder and am unable to point out the mistake.