DropTable Configuration - ASharpPen/Valheim.DropThat GitHub Wiki
DropTable templates are managed through the drop_that.drop_table.cfg
file.
Generally, most non-creatures use the DropTable system for their loot tables. These includes trees, chests and various creature outliers such as birds.
DropTable's are fundamentally different than CharacterDrop
.
Instead of each drop rolling chance and amount, the drops have weight, and the table will pick from its drops a random number of times. Meaning a drop can be selected multiple times.
If the drop has a stack-size as well, then that will be applied after the drop has been selected.
Process:
- Chance is rolled for any drops from table at all
- A random number
x
is selected, between min and max drops for the table. - For
x
times:- A drop from the table is randomly selected. The randomness is affected by the weight of the drop.
- If table was set to "DropOnlyOnce=true", the selected drop is removed from the table for the remaining rolls.
Templates are configured by creating sections as follows:
[<EntityName>]
# General drop table template settings here
# ...
[<EntityName>.<ID>]
# Individual drop settings here
# ...
EntityName
is the name of the entity to modify, and the ID
is a value from 0 and up, which indicates where to place the drop in the loot table. If an index matches an existing one, it will override that entry. This is how existing drops can be replaced on an individual level.
Eg. If you only want to modify the resin drop when modifying a beech, you don't need to specify all of the drops, but just add a section [Beech1.1]
Note, that due to how the configs and the DropTable works, you will always need to specify the main settings in [<EntityName>]
.
[FirTree_log]
DropChance=100
DropOnlyOnce=true
DropMin=1
DropMax=3
[FirTree_log.3]
PrefabName=RawMeat
Weight=1
AmountMin=10
AmountMax=20
[TreasureChest_forestcrypt]
DropChance=100
DropOnlyOnce=True
DropMin=3
DropMax=8
[TreasureChest_forestcrypt.0]
PrefabName=ArmorLeatherLegs
Weight=0.1
ConditionBiomes=BlackForest
ConditionDistanceToCenterMin = 3000
[TreasureChest_forestcrypt.0.EpicLoot]
RarityWeightUnique = 1
UniqueIDs = HeimdallLegs
Setting | Type | Default | Example | Description |
---|---|---|---|---|
DropMin | int | 1 | 3 | Minimum of randomly selected entries from drop list. Entries can be picked more than once |
DropMax | int | 1 | 5 | Maximum of randomly selected entries from drop list. Entries can be picked more than once |
DropChance | float | 100 | 55.5 | Chance to drop anything at all |
DropOnlyOnce | bool | false | true | If true, will ensure that when selecting entries from drop list, same entry will only be picked once |
UseDropList | string | MyAmazingList | Name of drop list to load for this entity. List items will be overridden by other drops listed here, if index is the same |
Setting | Type | Default | Example | Description |
---|---|---|---|---|
PrefabName | string | RawMeat | Name of prefab to drop | |
Enable | bool | true | false | Toggle this specific drop. This can be used to disable existing drops |
EnableConfig | bool | true | false | Toggle this specific config entry on/off |
AmountMin | int | 1 | 5 | Sets minimum amount pr drop. Behaviour depends on entity and item |
AmountMax | int | 1 | 5 | Sets maximum amount pr drop. Behaviour depends on entity and item |
Weight | float | 1 | 35 | Set weight for this drop. Used to control how likely it is that this item will be selected when rolling for drops. Note, same drop can be selected multiple times during table rolling |
ConditionAltitudeMin | float | -10000 | 100 | Minimum distance above or below sea-level for drop to be enabled |
ConditionAltitudeMax | float | 10000 | -0.5 | Maximum distance above or below sea-level for drop to be enabled |
ConditionBiomes | string | Meadows, BlackForest | Biomes in which drop is enabled. If empty, condition will be ignored | |
ConditionNotDay | bool | false | true | If true, will not drop during daytime |
ConditionNotAfternoon | bool | false | true | If true, will not drop during afternoon |
ConditionNotNight | bool | false | true | If true, will not drop during night |
ConditionEnvironments | string | Misty, Thunderstorm | Environments that allow the item to drop while they are active. Leave empty to always allow | |
ConditionGlobalKeys | string | defeated_eikthyr, defeated_gdking | List of global keys names of which at least one must be present for item to drop. Leave empty to always allow | |
ConditionGlobalKeysAll | string | defeated_eikthyr, defeated_gdking | List of global keys names that must all be present for item to drop. Leave empty to always allow | |
ConditionGlobalKeysNotAny | string | defeated_eikthyr, defeated_gdking | List of global keys names of which none must be present for item to drop. Leave empty to always allow | |
ConditionGlobalKeysNotAll | string | defeated_eikthyr, defeated_gdking | List of global keys names of which all of the keys must be missing for item to drop. Leave empty to always allow | |
ConditionLocation | string | Runestone_Boars, FireHole | When entity spawned in one of the listed locations, this drop is enabled | |
ConditionDistanceToCenterMin | float | 0 | 1000 | Minimum distance to center of map, for drop to be enabled |
ConditionDistanceToCenterMax | float | 0 | 3000 | Maximum distance to center of map, within which drop is enabled. 0 means limitless |
ConditionWithinCircle.CenterX | float | 0 | -25 | Center X coordinate of circle within which drop is enabled |
ConditionWithinCircle.CenterZ | float | 0 | 123 | Center Z coordinate of circle within which drop is enabled |
ConditionWithinCircle.Radius | float | -1 | 420 | Radius of circle within which drop is enabled |
QualityLevel | float | -1 | 10 | Sets the quality level of the item. If 0 or less, uses default quality level of drop |
Durability | float | -1 | 550 | Sets the durability of the item. Does not change max durability. If less than 0, uses default |
DisableResourceModifierScaling | bool | false | true | Disables resource scaling from world-modifiers if true |
ConditionNotBiomes | string | Meadows, BlackForest | Biomes in which drop is disabled. If empty, condition will be ignored | |
ConditionNotEnvironments | string | Misty, Thunderstorm | List of environment names that disable the drop while they are active. Leave empty to always allow | |
ConditionNotLocation | string | Runestone_Boars, FireHole | List of location names. When spawned in one of the listed locations, this drop is disabled | |
ConditionNotWithinCircle.CenterX | float | 0 | -25 | Center X coordinate of circle within which drop is disabled |
ConditionNotWithinCircle.CenterZ | float | 0 | 123 | Center Z coordinate of circle within which drop is disabled |
ConditionNotWithinCircle.Radius | float | -1 | 420 | Radius of circle within which drop is disabled |
By default, Drop That will load additional configurations from configs with names following the pattern drop_that.drop_table.*.cfg
.
This allows for adding your own custom templates to Drop That. Eg. drop_that.drop_table.my_custom_configuration.cfg
The supplemental configuration expects the same structure as drop_that.drop_table.cfg
.
When the same set of configurations are needed again and again, named lists can be assigned to entities for use as defaults, instead of having to copy-paste. As with the supplemental files, these can be placed in any sub-folder of bepinex/config.
You can have as many of these files as you want.
Named lists are loaded based on file name pattern drop_that.drop_table_list.*.cfg
Eg. drop_that.drop_table_list.my_amazing_lists.cfg
The format used in the lists is [<YourListName>.<ID>]
, with the same drop settings as for drop_that.drop_table.cfg
.
Eg.
[MyMeatsplosionList.0]
PrefabName = RawMeat
SetAmountMin = 100
SetAmountMax = 500
[MyMeatsplosionList.1]
PrefabName = RawMeat