Export inventory Data

Discuss Daggerfall Unity and Daggerfall Tools for Unity.
Post Reply
User avatar
jayhova
Posts: 718
Joined: Wed Jul 19, 2017 7:54 pm
Contact:

Export inventory Data

Post by jayhova » Mon May 27, 2019 5:07 pm

How do I look at the store inventory of my particular save game?
Remember always 'What would Julian Do?'.
Windows 10 Pro 64 bit. DFU Ver. Alpha 0.10.7

User avatar
Hazelnut
Posts: 1979
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Export inventory Data

Post by Hazelnut » Mon May 27, 2019 5:12 pm

Assuming you mean shop shelves, they're stored in SaveData.txt in the sceneCache section.

e.g.

Code: Select all

    "sceneCache": {
        "sceneCache": [
            {
                "sceneName": "DaggerfallWorld [mapX=207, mapY=213]",
                "lootContainers": [],
                "actionDoors": [],
                "$version": "v1"
            },
            {
                "sceneName": "DaggerfallInterior [MapID=1291010263, BuildingKey=263172]",
                "lootContainers": [
                    {
                        "loadID": 282578816864656,
                        "worldContext": "Nothing",
                        "containerType": "ShopShelves",
                        "containerImage": "Shelves",
                        "currentPosition": {
                            "x": 492.4,
                            "y": 320.4428,
                            "z": 476.8
                        },
                        "localPosition": {
                            "x": 0.4,
                            "y": 0.8833008,
                            "z": 5.0
                        },
                        "worldCompensation": {
                            "x": 0.0,
                            "y": 0.0,
                            "z": 0.0
                        },
                        "textureArchive": 0,
                        "textureRecord": 0,
                        "lootTableKey": null,
                        "entityName": "",
                        "stockedDate": 405061,
                        "playerOwned": false,
                        "customDrop": false,
                        "isEnemyClass": false,
                        "items": [
                            {
                                "uid": 33554967,
                                "shortName": "Emerald",
                                "nativeMaterialValue": 0,
                                "dyeColor": "Unchanged",
                                "weightInKg": 0.25,
                                "drawOrder": 23,
                                "value1": 425,
                                "value2": 0,
                                "hits1": 1000,
                                "hits2": 1000,
                                "hits3": 0,
                                "stackCount": 1,
                                "enchantmentPoints": 2750,
                                "message": 0,
                                "legacyMagic": null,
                                "playerTextureArchive": 0,
                                "playerTextureRecord": 0,
                                "worldTextureArchive": 254,
                                "worldTextureRecord": 1,
                                "itemGroup": "Gems",
                                "groupIndex": 1,
                                "currentVariant": 0,
                                "isQuestItem": false,
                                "questUID": 0,
                                "questItemSymbol": null,
                                "trappedSoulType": "None",
                                "className": null,
                                "$version": "v1"
                            },
                            {
                                "uid": 33554968,
                                "shortName": "Diamond",
                                "nativeMaterialValue": 0,
                                "dyeColor": "Unchanged",
                                "weightInKg": 0.25,
                                "drawOrder": 22,
                                "value1": 500,
                                "value2": 0,
                                "hits1": 1000,
                                "hits2": 1000,
                                "hits3": 0,
                                "stackCount": 1,
                                "enchantmentPoints": 3000,
                                "message": 0,
                                "legacyMagic": null,
                                "playerTextureArchive": 0,
                                "playerTextureRecord": 0,
                                "worldTextureArchive": 254,
                                "worldTextureRecord": 3,
                                "itemGroup": "Gems",
                                "groupIndex": 3,
                                "currentVariant": 0,
                                "isQuestItem": false,
                                "questUID": 0,
                                "questItemSymbol": null,
                                "trappedSoulType": "None",
                                "className": null,
                                "$version": "v1"
                            },
                            {
                                "uid": 33554976,
                                "shortName": "Twigs",
                                "nativeMaterialValue": 0,
                                "dyeColor": "Unchanged",
                                "weightInKg": 0.5,
                                "drawOrder": 25,
                                "value1": 2,
                                "value2": 0,
                                "hits1": 4,
                                "hits2": 4,
                                "hits3": 0,
                                "stackCount": 1,
                                "enchantmentPoints": 0,
                                "message": 0,
                                "legacyMagic": null,
                                "playerTextureArchive": 0,
                                "playerTextureRecord": 0,
                                "worldTextureArchive": 254,
                                "worldTextureRecord": 9,
                                "itemGroup": "PlantIngredients2",
                                "groupIndex": 0,
                                "currentVariant": 0,
                                "isQuestItem": false,
                                "questUID": 0,
                                "questItemSymbol": null,
                                "trappedSoulType": "None",
                                "className": null,
                                "$version": "v1"
                            },
                            {
                                "uid": 33554989,
                                "shortName": "Small tooth",
                                "nativeMaterialValue": 0,
                                "dyeColor": "Unchanged",
                                "weightInKg": 0.25,
                                "drawOrder": 22,
                                "value1": 2,
                                "value2": 0,
                                "hits1": 5,
                                "hits2": 5,
                                "hits3": 0,
                                "stackCount": 1,
                                "enchantmentPoints": 0,
                                "message": 0,
                                "legacyMagic": null,
                                "playerTextureArchive": 0,
                                "playerTextureRecord": 0,
                                "worldTextureArchive": 254,
                                "worldTextureRecord": 59,
                                "itemGroup": "MiscellaneousIngredients1",
                                "groupIndex": 3,
                                "currentVariant": 0,
                                "isQuestItem": false,
                                "questUID": 0,
                                "questItemSymbol": null,
                                "trappedSoulType": "None",
                                "className": null,
                                "$version": "v1"
                            },
                            {
                                "uid": 33554993,
                                "shortName": "Tin",
                                "nativeMaterialValue": 0,
                                "dyeColor": "Unchanged",
                                "weightInKg": 0.5,
                                "drawOrder": 28,
                                "value1": 4,
                                "value2": 0,
                                "hits1": 35,
                                "hits2": 35,
                                "hits3": 0,
                                "stackCount": 1,
                                "enchantmentPoints": 0,
                                "message": 0,
                                "legacyMagic": null,
                                "playerTextureArchive": 0,
                                "playerTextureRecord": 0,
                                "worldTextureArchive": 254,
                                "worldTextureRecord": 64,
                                "itemGroup": "MetalIngredients",
                                "groupIndex": 1,
                                "currentVariant": 0,
                                "isQuestItem": false,
                                "questUID": 0,
                                "questItemSymbol": null,
                                "trappedSoulType": "None",
                                "className": null,
                                "$version": "v1"
                            },
                            {
                                "uid": 33554995,
                                "shortName": "Copper",
                                "nativeMaterialValue": 0,
                                "dyeColor": "Unchanged",
                                "weightInKg": 0.5,
                                "drawOrder": 39,
                                "value1": 15,
                                "value2": 0,
                                "hits1": 12,
                                "hits2": 12,
                                "hits3": 0,
                                "stackCount": 1,
                                "enchantmentPoints": 0,
                                "message": 0,
                                "legacyMagic": null,
                                "playerTextureArchive": 0,
                                "playerTextureRecord": 0,
                                "worldTextureArchive": 254,
                                "worldTextureRecord": 66,
                                "itemGroup": "MetalIngredients",
                                "groupIndex": 7,
                                "currentVariant": 0,
                                "isQuestItem": false,
                                "questUID": 0,
                                "questItemSymbol": null,
                                "trappedSoulType": "None",
                                "className": null,
                                "$version": "v1"
                            },
                            {
                                "uid": 33554996,
                                "shortName": "Silver",
                                "nativeMaterialValue": 0,
                                "dyeColor": "Unchanged",
                                "weightInKg": 0.5,
                                "drawOrder": 3,
                                "value1": 12,
                                "value2": 0,
                                "hits1": 50,
                                "hits2": 50,
                                "hits3": 0,
                                "stackCount": 1,
                                "enchantmentPoints": 0,
                                "message": 0,
                                "legacyMagic": null,
                                "playerTextureArchive": 0,
                                "playerTextureRecord": 0,
                                "worldTextureArchive": 254,
                                "worldTextureRecord": 65,
                                "itemGroup": "MetalIngredients",
                                "groupIndex": 8,
                                "currentVariant": 0,
                                "isQuestItem": false,
                                "questUID": 0,
                                "questItemSymbol": null,
                                "trappedSoulType": "None",
                                "className": null,
                                "$version": "v1"
                            },
                            {
                                "uid": 33554997,
                                "shortName": "Gold",
                                "nativeMaterialValue": 0,
                                "dyeColor": "Unchanged",
                                "weightInKg": 0.5,
                                "drawOrder": 34,
                                "value1": 20,
                                "value2": 0,
                                "hits1": 45,
                                "hits2": 45,
                                "hits3": 0,
                                "stackCount": 1,
                                "enchantmentPoints": 0,
                                "message": 0,
                                "legacyMagic": null,
                                "playerTextureArchive": 0,
                                "playerTextureRecord": 0,
                                "worldTextureArchive": 254,
                                "worldTextureRecord": 62,
                                "itemGroup": "MetalIngredients",
                                "groupIndex": 9,
                                "currentVariant": 0,
                                "isQuestItem": false,
                                "questUID": 0,
                                "questItemSymbol": null,
                                "trappedSoulType": "None",
                                "className": null,
                                "$version": "v1"
                            }
                        ],
                        "$version": "v1"
                    }
                ],
I think that the mapid & buildingKey are written to the console/log when the scene is cached and restored (i.e. exiting and entering the building) so that's the easiest way to find the right entry for a specific shop.

Hope this helps.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
jayhova
Posts: 718
Joined: Wed Jul 19, 2017 7:54 pm
Contact:

Re: Export inventory Data

Post by jayhova » Mon May 27, 2019 5:25 pm

Yeah, I don't suppose there is an easy way to export all that as CSV?
Remember always 'What would Julian Do?'.
Windows 10 Pro 64 bit. DFU Ver. Alpha 0.10.7

User avatar
Hazelnut
Posts: 1979
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Export inventory Data

Post by Hazelnut » Mon May 27, 2019 5:32 pm

It's JSON, pretty easy to work with. You would need to write a conversion script to make a csv. Wouldn't be that hard to do. WHat do you wnat it for?
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
jayhova
Posts: 718
Joined: Wed Jul 19, 2017 7:54 pm
Contact:

Re: Export inventory Data

Post by jayhova » Mon May 27, 2019 5:55 pm

I wanted to data analysis on items in the blacksmiths.
Remember always 'What would Julian Do?'.
Windows 10 Pro 64 bit. DFU Ver. Alpha 0.10.7

User avatar
jayhova
Posts: 718
Joined: Wed Jul 19, 2017 7:54 pm
Contact:

Re: Export inventory Data

Post by jayhova » Wed May 29, 2019 7:34 pm

To be more specific, my suspicion is that the distribution of armor is very uneven. For one steel breastplates cannot be bought at forth level at all. They can be found on bodies but not in shops. Silver pauldrons are only available in left. I want to gather enough data from enough shops to get a good comparison of the breakdowns.
Remember always 'What would Julian Do?'.
Windows 10 Pro 64 bit. DFU Ver. Alpha 0.10.7

communityus
Posts: 35
Joined: Fri Apr 05, 2019 1:51 am

Re: Export inventory Data

Post by communityus » Thu Feb 13, 2020 4:48 am

Did you ever get around to making that comparison? I'd be interested in your findings.

Post Reply