Skip to main content

Composition

info

This doc refers to the new method of composition introduced in version 1.4.0. To convert from the previous method, see the upgrade guide.

Use Composition to combine multiple loot table templates and their float masks into a single loot table at runtime.

Mechanics

Composition appends the data of each table in the order received. E.g., if you pass {A, B, C}, it will compose into A, then B, then C.

The tables must share the same Source Data Type and Distribution Type to be composed. Otherwise, composition will use the first table's Source Data Type and Distribution Type and it will ignore incompatible tables.

Float Masks

You can opt to compose float masks with the table(s). This will append each float mask in order similarly to the tables' data. You can opt to compose based on rules (Union or Intersect) or manually define which masks should be composed.

For the examples below, suppose we have these tables:

Table A
IndexWeightRef AssetMask X
0100G1.0
1100H1.0
2100I1.0
Table B
IndexWeightRef AssetMask XMask Y
0200G2.02.0
1200H2.02.0
2200I2.02.0

Union

Composes unique masks from ANY table. Tables which don't have a mask will receive ValueForMissingRows for each of their rows. If composing tables {A, B} above with Union{0.0}, we will create:

IndexWeightRef AssetMask XMask Y
0100G1.00.0
1100H1.00.0
2100I1.00.0
3200G2.02.0
4200H2.02.0
5200I2.02.0

Intersect

Composes masks shared between ALL tables. If composing tables {A, B} above with Intersect, we will create:

IndexWeightRef AssetMask X
0100G1.0
1100H1.0
2100I1.0
3200G2.0
4200H2.0
5200I2.0

Manual

Manually define which masks will be composed. If compose tables {A, B} above with Manual{(Mask X, 0.0), (Mask Y, 3.0), (Mask Z, 4.0)}, we will create:

IndexWeightRef AssetMask XMask YMask Z
0100G1.03.04.0
1100H1.03.04.0
2100I1.03.04.0
3200G2.02.04.0
4200H2.02.04.0
5200I2.02.04.0

Usage

Use the blueprint function Compose Loot Table:

Performance

Composition performance has been greatly improved with version 1.4.0; Performance cost should be negligible in most cases.

See the LV_Performance level from the example map for demonstrations.