Spawning Random Actors
note
See LV_UseCases in the example map for an implementation.
Overview
Suppose we want to define a list of actors to randomly spawn in a level. We can do this with a loot table template:
Data Table Coins | |
---|---|
Row Name | Actor Class |
Copper | BP_CoinCopper |
Silver | BP_CoinSilver |
Gold | BP_CoinGold |
Loot Table Template A (Unlimited) | |||||
---|---|---|---|---|---|
Row Name | Ref Table | Ref Row Name | Ref Mode | Weight | Weight Inherit Mode |
Copper | Coins | Copper | Row | 6000 | Parent |
Silver | Coins | Silver | Row | 3000 | Parent |
Gold | Coins | Gold | Row | 1000 | Parent |
Loot Table A | |||
---|---|---|---|
Ref Table | Ref Row Name | Weight | Probability |
Coins | Copper | 6000 | 60% |
Coins | Silver | 3000 | 30% |
Coins | Gold | 1000 | 10% |
We can sample from this loot table, get the actor class from the data table, and spawn the actor in the level.