DropTable Named Lists - ASharpPen/Valheim.DropThat GitHub Wiki

Drop Table

Named list of drops are intended as a way to set up defaults, without having to copy-paste the same configs again and again.

They work in exactly the same way as the usual drops otherwise.

Prepare file

Start by creating a new file anywhere in the bepinex config folder like this:

image

The example part of the name can be anything you want, and the position of the file can be in any subfolder (as long as its in the BepInEx/config path).

All files named according to either drop_that.drop_table_list.cfg or drop_that.drop_table_list.*.cfg are loaded and scanned when a world is entered.

Creating list

Open the drop table list cfg you want to write your named list in (the one you just created, if you came from "Prepare file").

Then create drops like you usually would for a Drop Table config, but instead of using a prefab name as the first part of the section head (the [SomeText]), we write what we want the list to be named as.

Lets create a few generic coin drops, that can be used for entities.

ID 100 is picked starting point, to ensure we don't override the vanilla drops, but any ID of 0 or greater can be used as usual.

Note that while DropTable configs usually require an initial section filled out (as in, the [DefaultCoinDrops] we didn't write), this should not be added to named lists. That part needs to be specified in each usage.

[DefaultCoinDrops.100]
PrefabName = Coins
AmountMin = 1
AmountMax = 1
ConditionDistanceToCenterMin=0
ConditionDistanceToCenterMax=1000

[DefaultCoinDrops.101]
PrefabName = Coins
AmountMin = 10
AmountMax = 10
ConditionDistanceToCenterMin=1000
ConditionDistanceToCenterMax=3000

[DefaultCoinDrops.102]
PrefabName = Coins
AmountMin = 100
AmountMax = 100
ConditionDistanceToCenterMin=3000

Multiple lists can be created in the same file. Just use a different name for the next list.

Lets add some drops intended to override the vanilla drops when used, by using ID's from 0 and up.

[DefaultCoinDrops.100]
PrefabName = Coins
AmountMin = 1
AmountMax = 1
ConditionDistanceToCenterMin=0
ConditionDistanceToCenterMax=1000

[DefaultCoinDrops.101]
PrefabName = Coins
AmountMin = 10
AmountMax = 10
ConditionDistanceToCenterMin=1000
ConditionDistanceToCenterMax=3000

[DefaultCoinDrops.102]
PrefabName = Coins
AmountMin = 100
AmountMax = 100
ConditionDistanceToCenterMax=3000

[TreeLogDefaultList.0]
PrefabName = ArmorLeatherLegs
AmountMin = 1
AmountMax = 1
QualityLevel = 10
AmountLimit = 1

[TreeLogDefaultList.0.EpicLoot]
RarityWeightUnique = 1
UniqueIDs = HeimdallLegs

[TreeLogDefaultList.1]
PrefabName = Coins

[TreeLogDefaultList.2]
PrefabName = Wood
AmountMin = 10
AmountMax = 10

[TreeLogDefaultList.3]
PrefabName = IronScrap

Note how integrations can be added in the usual way.

Using list:

Creating a list does nothing if nothing is using it. Using the list is done by adding a section and setting to the usual drops.

Open up a DropTable file to use. Eg., drop_that.drop_table.cfg.

Lets start by using our default coin drop list, and add it to a few different entities:

[Seagal]
DropChance=100
DropOnlyOnce=False
DropMin=1
DropMax=1
UseDropList=DefaultCoinDrops

[TreasureChest_blackforest]
DropChance=100
DropOnlyOnce=True
DropMin=2
DropMax=3
UseDropList=DefaultCoinDrops

There we go! This is equivalent to having written:

[Seagal]
DropChance=100
DropOnlyOnce=False
DropMin=1
DropMax=1

[Seagal.100]
PrefabName = Coins
AmountMin = 1
AmountMax = 1
ConditionDistanceToCenterMin=0
ConditionDistanceToCenterMax=1000

[Seagal.101]
PrefabName = Coins
AmountMin = 10
AmountMax = 10
ConditionDistanceToCenterMin=1000
ConditionDistanceToCenterMax=3000

[Seagal.102]
PrefabName = Coins
AmountMin = 100
AmountMax = 100
ConditionDistanceToCenterMin=3000

[TreasureChest_blackforest]
PrefabName = Coins
DropChance=100
DropOnlyOnce=True
DropMin=2
DropMax=3

[TreasureChest_blackforest.100]
PrefabName = Coins
AmountMin = 1
AmountMax = 1
ConditionDistanceToCenterMin=0
ConditionDistanceToCenterMax=1000

[TreasureChest_blackforest.101]
PrefabName = Coins
AmountMin = 10
AmountMax = 10
ConditionDistanceToCenterMin=1000
ConditionDistanceToCenterMax=3000

[TreasureChest_blackforest.102]
PrefabName = Coins
AmountMin = 100
AmountMax = 100
ConditionDistanceToCenterMin=3000

Note that only named list can be used pr entity. It is not possible to do UseDropList=DefaultCoinDrops, TreeLogDefaultList.

Overriding list entries:

Named lists are just defaults, when used, each entry can be overriden by the entity using it.

Lets take a look at the named list we created for tree logs, by adding this to drop_that.drop_table.cfg:

[Seagal]
DropChance=100
DropOnlyOnce=False
DropMin=1
DropMax=1
UseDropList=DefaultCoinDrops

[TreasureChest_blackforest]
DropChance=100
DropOnlyOnce=True
DropMin=2
DropMax=3
UseDropList=DefaultCoinDrops

[beech_log_half]
DropChance=100
DropOnlyOnce=False
DropMin=10
DropMax=10
UseDropList=TreeLogDefaultList

Dropping legendary items and iron may be a bit overpowered for the typical vanilla tree log, so lets turn that down a notch.

Add entries using the same ID to that of beech half logs, disabling the Epic Loot drop, and changing the iron drop to some potential resin instead.

[Seagal]
DropChance=100
DropOnlyOnce=False
DropMin=1
DropMax=1
UseDropList=DefaultCoinDrops

[TreasureChest_blackforest]
DropChance=100
DropOnlyOnce=True
DropMin=2
DropMax=3
UseDropList=DefaultCoinDrops

[beech_log_half]
DropChance=100
DropOnlyOnce=False
DropMin=10
DropMax=10
UseDropList=TreeLogDefaultList

[beech_log_half.0]
# Lets use vanilla settings.
PrefabName=Wood
Weight=1
AmountMin=1
AmountMax=1

[beech_log_half.3]
PrefabName = Resin

Note that all settings get overridden if we use the same ID. If we just changed the drop rate of drop 0, the entire [TreeLogDefaultList.0] and [TreeLogDefaultList.0.EpicLoot] gets replaced with whatever is in [beech_log_half.0].