Jump to content

Forums Announcement

Read-Only Mode for Announcements & Changelogs

Dear Survivors, we'd like to inform you that this forum will transition to read-only mode. From now on, it will serve exclusively as a platform for official announcements and changelogs.

For all community discussions, debates, and engagement, we encourage you to join us on our social media platforms: Discord, Twitter/X, Facebook.

Thank you for being a valued part of our community. We look forward to connecting with you on our other channels!

Stay safe out there,
Your DayZ Team

Sign in to follow this  
Jamie Zwarts

ObjectSpawner.json to load in items with inventory or attachments

Recommended Posts

Dear survivors,

I have been working for a few months now on my modded server and it's going pretty good.
Learned a LOT during this time and try to read as much as possible. Yet there is one issue i can't overcome and nobody has the answer (that i want) to it, other than "impossible".
Now there's a nasty word children shouldn't be uttering. 

Anyway, the meat of my question: Is it possible, to spawn in item on my map, with any corresponding inventory attachments inside of them?

What i have tried so far:

Let's use a furnace (any item will do) and i want some meat inside of it (silly example). 

1. First tried the editor of course > Control a survivor > put the meat in > save it > of course that doesn't work

2. Then about edit inventory when clicking the object in the editor. This seem the IDEAL solution. But i export to a .dzeinv file? I can not find ANY information about that or have no clue what to do with it. Where do i store that file? I tried the mission editor folder. 

3. Then i thought i could maybe add them by exporting the .map file (as you would add clothes to traders that way at the end of each line). Or turn on a fire by adding "|true" at the end... Doesn't work

4. Tried VPP admin object builder. uuuh nevermind... doesn't work.

5. THEN of course my friend json. But here is my problem. How do you add inventory to something in a json file as an attachment?? I mean, i can spawn in a vehicle with all the attachments...when you buy one... why not other items???



In this example, the "SpawnAttachments" is used. How does that actually work? And does it with other items?

{
            "ClassName": "hatchback_02",
            "MaxPriceThreshold": 24000,
            "MinPriceThreshold": 14400,
            "SellPricePercent": -1.0,
            "MaxStockThreshold": 5,
            "MinStockThreshold": 1,
            "QuantityPercent": -1,
            "SpawnAttachments": [
                "hatchback_02_door_1_2",
                "hatchback_02_door_2_2",
                "hatchback_02_hood",
                "hatchback_02_trunk",
                "carbattery",
                "carradiator",
                "sparkplug",
                "headlighth7",
                "headlighth7"
            ],
            "Variants": []
        },

 



Here is another example, taken from the LoadOut files used for the Ai:
 

{
            "SlotName": "Body",
            "Items": [
                {
                    "ClassName": "USMCJacket_Desert",
                    "Include": "",
                    "Chance": 1.0,
                    "Quantity": {
                        "Min": 0.0,
                        "Max": 0.0
                    },
                    "Health": [
                        {
                            "Min": 0.699999988079071,
                            "Max": 1.0,
                            "Zone": ""
                        }
                    ],
                    "InventoryAttachments": [],
                    "InventoryCargo": [],
                    "ConstructionPartsBuilt": [],
                    "Sets": []
                },



Here the InventoryAttachments is used. But still i can't get it to work...


Could someone please tell me if i'm looking past some attribute i don't know of?
Or maybe a completely different way of doing it?? 


Cheers! And thank you in advance!

Jamie

Edited by Jamie Zwarts

Share this post


Link to post
Share on other sites
Sign in to follow this  

×