-
Notifications
You must be signed in to change notification settings - Fork 4
DropTable Tutorial Add
This will show an example adding raw meat as a drop when felling a tree.
- Go to your
BepInEx/Configfolder. - Open the
drop_that.drop_table.cfg. - Add the following to the end of it.
[FirTree.123]
PrefabName = RawMeat- Save the file.
Done!
What have we done though?
Well, the first part is the header [FirTree.123].
Drop That reads that as "For the FirTree loot table, the following settings will modify the entry with ID 123".
Since ID 123 does not exist for FirTree, it is added. If we had used 0, we would instead have been changing the FirCone drop to RawMeat.
The second part we added is the actual item to drop. PrefabName = RawMeat.
Drop That reads that as "For FirTree's drop with ID 123, the Prefab with the internal name RawMeat" should be used when drop is spawned.
We could have added more details, but Drop That will be adding defaults for whatever is missing. We could also have written it as below, and had the same result:
[FirTree.123]
PrefabName = RawMeat
EnableConfig = true
Enable = true
AmountMin = 1
AmountMax = 1
Weight = 1Drop That reads DropTable files by figuring out what the settings belong to using the headers above. Such as:
[<PrefabName>]
# General table settings here
# ...
[<PrefabName>.<ID>]
# Individual drop settings here
# ...PrefabName is the name of the object having a DropTable 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 ID matches an existing one, it will override, if it doesn't exist, it will be created. Drop That automatically gives ID's when loading up as its not part of Valheim itself, so be aware these can change by other mods or if the devs change the vanilla tables. They can also get missed entirely, if a mod adds them after Drop That has loaded the table. The ID's are assigned sequentially from 0, so if vanilla had 3 drops, they will be ID 0, 1, and 2. And if some mod then adds 2 more drops, those will be ID 3 and 4.
Multiple drops can be modified or added by repeating the [.], using the same name and a different ID.
Eg.
[FirTree.0]
...
[FirTree.1]
...If we want to make the trees drop their meat more often, we have two options.
The first way is to simply up the amounts on the drop entry we added previously. By increasing the amount settings for the entry, we now get 10-20 meat pr time the entry is rolled by the table. By setting the weight, we make it more likely that the drop will picked for a roll.
[FirTree.123]
PrefabName = RawMeat
AmountMin = 10
AmountMax = 20
Weight = 10However, fir trees normally only drops anything 50% of the time, and they only roll 1-2 times to pick a drop from their table. So, the second way we can increase drops, is to modify the fir trees overall drop table settings.
If we add the following to the file, we now have fir trees that always drop loot, and they will drop it a lot.
[FirTree]
DropChance=100
DropMin=10
DropMax=20Lets say we dont want to just add the RawMeat drop to all fir trees when felled, but as a special reward for players who truly deserve that meat.
We can restrict the drop by giving it conditions.
So lets change what we previously added to:
[FirTree.123]
PrefabName = RawMeat
AmountMin = 10
AmountMax = 30
ConditionLocation = Runestone_BlackForest
ConditionEnvironments = Misty
ConditionDistanceToCenterMin = 2000So what have we done?
- We have scaled up the reward
- We have limited the drop entry, so fir trees can only roll it when:
- It is in one of the blackforest runestone chunks
- The weather is misty
- It is 2000 meters away from the center of the world.
Drop That adds extra options for certain mods. Lets say you want to also only want the meat to drop, if the world level used in the mod Creature Level and Loot Control (CLLC) has increased to 3.
[FirTree.123.CreatureLevelAndLootControl]
ConditionWorldLevelMin = 3This condition will then be added to the other ones for [FirTree.123]. It will only be active if CLLC is active though.
This is the general way of modded settings. Their additional settings are under [<Prefab>.<ID>.<ModName>], and they are only active if the corresponding mod is loaded.
Just to round up, this is what the combined part of our additions would look like in the file.
[FirTree]
DropChance=100
DropMin=10
DropMax=20
[FirTree.123]
PrefabName = RawMeat
AmountMin = 10
AmountMax = 30
ConditionLocation = Runestone_BlackForest
ConditionEnvironments = Misty
ConditionDistanceToCenterMin = 2000
[FirTree.123.CreatureLevelAndLootControl]
ConditionWorldLevelMin = 3- CharacterDrop - Adding drops
- CharacterDrop - Modifying drops
- CharacterDrop - Disabling drops
- DropTable - Adding drops
- DropTable - Modifying drops
- DropTable - Disabling drops
- CharacterDrop - Named Lists
- DropTable - Named Lists