Well, it is working, outside two interesting bugs.
First is I can't restore my saved dictionary that contains an array of the items equipped. Any ideas on using saving a dictionary that contains arrays for the key values? I imagine this has to do with using an array item in a dictionary and trying to get the serialize to store and retrieve it without getting confused; the item objects seem to confuse the serialize because of how they reference themselves after being equipped. You can see it in the below mod saved data text file. It saves proper item template data on first outfit array, but afterwards each new outfit array starts shorthand referencing the items, which I think screws everything up on reload since the item uid item references are reset.
Code: Select all
{
"OutfitDict": [
{
"Key": 0,
"Value": [
{
"shortName": "Shortsword",
"nativeMaterialValue": 0,
"dyeColor": "Iron",
"weightInKg": 2.5,
"drawOrder": 100,
"value": 15,
"unknown": 0,
"flags": 0,
"currentCondition": 300,
"maxCondition": 300,
"unknown2": 0,
"typeDependentData": 0,
"enchantmentPoints": 0,
"message": 0,
"legacyMagic": null,
"customMagic": null,
"stackCount": 1,
"poisonType": "None",
"timeHealthLeechLastUsed": 0,
"$id": "3"
},
{
"shortName": "Battle Axe",
"nativeMaterialValue": 1,
"dyeColor": "Steel",
"weightInKg": 7.5,
"drawOrder": 100,
"value": 120,
"unknown": 0,
"flags": 0,
"currentCondition": 1200,
"maxCondition": 1200,
"unknown2": 0,
"typeDependentData": 0,
"enchantmentPoints": 525,
"message": 0,
"legacyMagic": null,
"customMagic": null,
"stackCount": 1,
"poisonType": "None",
"timeHealthLeechLastUsed": 0,
"$id": "4"
},
null,
null,
null,
{
"shortName": "Cuirass",
"nativeMaterialValue": 512,
"dyeColor": "Iron",
"weightInKg": 12.5,
"drawOrder": 50,
"value": 300,
"unknown": 0,
"flags": 0,
"currentCondition": 4096,
"maxCondition": 4096,
"unknown2": 0,
"typeDependentData": 0,
"enchantmentPoints": 0,
"message": 0,
"legacyMagic": null,
"customMagic": null,
"stackCount": 1,
"poisonType": "None",
"timeHealthLeechLastUsed": 0,
"$id": "5"
},
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
{
"shortName": "Casual Pants",
"nativeMaterialValue": 0,
"dyeColor": "Blue",
"weightInKg": 0.5,
"drawOrder": 10,
"value": 5,
"unknown": 0,
"flags": 0,
"currentCondition": 150,
"maxCondition": 150,
"unknown2": 0,
"typeDependentData": 0,
"enchantmentPoints": 40,
"message": 0,
"legacyMagic": null,
"customMagic": null,
"stackCount": 1,
"poisonType": "None",
"timeHealthLeechLastUsed": 0,
"$id": "6"
},
null,
null,
null,
null,
{
"shortName": "Short Shirt",
"nativeMaterialValue": 0,
"dyeColor": "Purple",
"weightInKg": 0.5,
"drawOrder": 40,
"value": 5,
"unknown": 0,
"flags": 0,
"currentCondition": 100,
"maxCondition": 100,
"unknown2": 0,
"typeDependentData": 0,
"enchantmentPoints": 60,
"message": 0,
"legacyMagic": null,
"customMagic": null,
"stackCount": 1,
"poisonType": "None",
"timeHealthLeechLastUsed": 0,
"$id": "7"
}
]
}
],
"Index": 0,
"CurrentEquippedList": null,
"Outfit0": [
{
"$ref": "3"
},
{
"$ref": "4"
},
null,
null,
null,
{
"$ref": "5"
},
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
{
"$ref": "6"
},
null,
null,
null,
null,
{
"$ref": "7"
}
],
"$version": "v1"
}
So, how do you save a dictionary that contains array values so the interface can restore it without an issue?
Second, is an interesting bug. The saved data won't load until you do a second saved game load after launching daggerfall program. It's seems the first save is maybe initiating the values, and the second save is loading the saved data now that the values have been initiated for the game instance.