Place loot spawn points and loot tables¶
Loot is not placed by hand. You place BP_LootSpawnPoint actors, give each one a loot table, and every run the point rolls a chance and picks an item from its table. By the end of this page you have points in your level and a table of your own.
- The spawn point:
Content/MPFriendslop/Blueprints/Environments/Spawners/BP_LootSpawnPoint - The tables:
Blueprints/DataAssets/LootTable/Childs/ - The loot actors they pick from:
Blueprints/Environments/Loot/Childs/
Place a spawn point¶
- Drag
BP_LootSpawnPointinto your level. - Put it where the item should rest: on the floor, or just above a shelf plank. The arrow is hidden in game.
- In the Details panel, under
Settings|Spawn, setLoot Table. - Adjust the other fields if needed.
When the run starts, the point rolls Spawn Chance, picks an item from the table, and moves it straight down onto the first surface under it. The item is set down. It never falls, so it never starts the run damaged.
| Field | What it does | Default |
|---|---|---|
Loot Table |
The table this point rolls. Empty means the point spawns nothing | empty |
Spawn Chance |
Chance from 0 to 1 that this point spawns anything this run | 0.9 |
Random Yaw |
Turns the item to a random direction. Untick it to use the point's own rotation | ticked |
Settle Trace Height |
How far above the item's centre, in cm, the search for a surface starts | 25 |
Ground Trace Distance |
How far down, in cm, it looks for a surface | 200 |
Every field is set per placed point. Changing a default on the class does not change a point where you already edited that field.
In the rooms of Maps/Modules/, the points on furniture use DA_LootTable_Shelf. Every room also has at least one point on the floor with DA_LootTable_Salvage, the table with the heavy pieces and the weapons: the bat, the hammer and the sawed-off shotgun.
Make a loot table¶
- In
Blueprints/DataAssets/LootTable/Childs/, right click, then Miscellaneous, then Data Asset. - Pick
BP_LootTableDataAsset. Name itDA_LootTable_<Name>. - Open it and add rows to
Entries. - For each row, set
Loot ClassandWeight. - Set it as the
Loot Tableof the points that should use it.
| Field | What it does |
|---|---|
Loot Class |
The actor to spawn. Usually one of the BP_Loot_* classes |
Weight |
How often this row is picked. 3 is three times as likely as 1. 0 never spawns |
The easiest start is to duplicate DA_LootTable_Salvage and edit the weights. DA_LootTable_Shelf leaves out the heavy items (BP_Loot_EngineBlock, BP_Loot_Generator, BP_Loot_VaultPlate) and the weapons, which stay on the floor.
Loot Class accepts any actor. To be worth money when sold, it needs a BP_LootValueComponent: see Add a loot item. An inventory item goes in a table through a child of BP_ItemPickup: see Put it in the loot.
The pick is the function PickLootClass on the table. For another rule (no duplicates, a guaranteed item), make a child of BP_LootTableDataAsset and override it.
Next: Place an extraction point.