Explanation of Discrete Unsorted Types

Discrete Unsorted Item Sets (DiscreteUnsortedItemSets) are used for configuring the spawning of cargo on a character that has some attachments set up through the AttachmentSlots configuration. These item sets define additional items that can be spawned in the character's cargo, enhancing the loadout customization process.

Here's a detailed breakdown of the fields and their purposes within a DiscreteUnsortedItemSet:

  1. name (string):

    • This is a user-defined name for the item set. It can be any string and serves as an identifier for the item set.

  2. spawnWeight (integer):

    • This field determines the likelihood of this item set being selected for spawning. The minimum value is 1, and a higher number increases the chance of this item set being chosen over others with lower spawn weights.

  3. attributes:

    • This section defines default values for item attributes. These attributes are used if the nested types (children items) do not have simpleChildrenUseDefaultAttributes set to true. The attributes include:

      • Health minimum and maximum values.

      • Quantity minimum and maximum values.

  4. complexChildrenTypes:

    • This is an array of items that will be spawned in the character's cargo. Each item can itself have further nested items, making it a "complex" child. These items can have their own attributes and nested children.

  5. simpleChildrenTypes (array):

    • This is an array of simple item types (identified by their type names) that will be spawned in the character's cargo. These items do not have nested children and are straightforward in their configuration.

  6. simpleChildrenUseDefaultAttributes (bool):

    • This boolean field indicates whether the simple children items should use the default attributes defined in the attributes section of the DiscreteUnsortedItemSet. If set to true, the simple children will use the default values specified in the attributes section. If set to false, they may use specific attributes defined elsewhere in the configuration.

Example Use Case

When setting up a DiscreteUnsortedItemSet, you might want to configure a character's cargo to include a random assortment of items like food, ammunition, or tools. You can create a named set, assign it a spawn weight to control how often it appears, and list the items that should be included. Additionally, you can specify whether these items should use default health and quantity attributes or their specific values.

For instance, a DiscreteUnsortedItemSet could look like this:

ExampleLoadout.json
{
    "discreteUnsortedItemSets": [
        {
            "name": "Medic Cargo 1",
            "spawnWeight": 1,
            "attributes": {
                "healthMin": 0.5,
                "healthMax": 1.0,
                "quantityMin": 0.6,
                "quantityMax": 0.8
            },
            "complexChildrenTypes": [
                {
                    "itemType": "FirstAidKit",
                    "attributes": {
                        "healthMin": 0.7,
                        "healthMax": 0.8,
                        "quantityMin": 0.05,
                        "quantityMax": 0.1
                    },
                    "quickBarSlot": 3,
                    "simpleChildrenUseDefaultAttributes": false,
                    "simpleChildrenTypes": [
                        "BloodBagIV",
                        "BandageDressing"
                    ]
                }
            ],
            "simpleChildrenUseDefaultAttributes": false,
            "simpleChildrenTypes": [
                "Rag",
                "SheepSteakMeat"
            ]
        },
        {
            "name": "Medic Cargo 2",
            "spawnWeight": 1,
            "attributes": {
                "healthMin": 0.5,
                "healthMax": 1.0,
                "quantityMin": 0.6,
                "quantityMax": 0.8
            },
            "complexChildrenTypes": [
                {
                    "itemType": "FirstAidKit",
                    "attributes": {
                        "healthMin": 0.7,
                        "healthMax": 0.8,
                        "quantityMin": 0.05,
                        "quantityMax": 0.1
                    },
                    "quickBarSlot": 3,
                    "simpleChildrenUseDefaultAttributes": false,
                    "simpleChildrenTypes": [
                        "TetracyclineAntibiotics",
                        "BandageDressing"
                    ]
                }
            ],
            "simpleChildrenUseDefaultAttributes": false,
            "simpleChildrenTypes": [
                "Canteen",
                "Rag",
                "Apple"
            ]
        }
    ]
}

In this example:

  • Medic Cargo 1 and Medic Cargo 2 are two separate item sets designed to be used in the character's cargo.

  • Each set has a spawnWeight of 1, meaning they have an equal chance of being selected for spawning.

  • The attributes section defines the default health and quantity ranges for the items in these sets.

  • complexChildrenTypes includes items like FirstAidKit with their own specific attributes and nested simple children (e.g., BloodBagIV, BandageDressing, TetracyclineAntibiotics).

  • simpleChildrenTypes lists additional items that will be directly added to the character's cargo (e.g., Rag, SheepSteakMeat, Canteen, Apple).

  • simpleChildrenUseDefaultAttributes is set to false, meaning these simple children items will not use the default attributes specified in the parent attributes section but may have their own specified attributes.

By configuring DiscreteUnsortedItemSets in this way, you can create diverse and realistic cargo configurations for characters in your loadout. Note: As of this document being written, complex items have not been implemented. The functionality is there and will come in the future.

Last updated