How to combine multiple constraints
Containers can have multiple constraints evaluated with AND logic.
Grid + hard weight — best-effort mode, weight bypassed
When a container has multiple constraints, best-effort mode can bypass hard limits that would normally block an operation. If you set up a 4×4 grid container “rig” with a hard weight limit of 14.0 and place ammo boxes at positions (0, 0) and (2, 0), then attempt to place a third ammo box at (0, 1) using best-effort mode, the item is successfully added even though it would exceed the weight constraint. The operation reports 1 added out of 1 requested, and the container holds all 3 items. Best-effort mode treats hard constraints as soft, allowing placement to proceed where it otherwise wouldn’t.
Grid + hard weight — exact mode, weight blocks
As in Escape from Tarkov where rigs enforce both grid space and weight limits simultaneously, a container can combine multiple constraints using AND logic. If you configure a “rig” container with a 4×4 grid and a hard weight limit of 14.0, you can place ammo boxes into open grid cells as long as the total weight stays under the cap. After placing one ammo box at position (0, 0) and another at (2, 0), attempting to place a third at (0, 1) will fail with a capacity exceeded error — even though the grid has open slots, the combined weight of three ammo boxes would breach the weight constraint, and both constraints must be satisfied for a placement to succeed.
Grid + hard weight — grid blocks (position occupied)
When a container combines multiple constraints, each one is evaluated independently. If you configure a “rig” container with both a 4×4 grid and a hard weight limit of 100.0, and you’ve already placed an ammo box at position (0, 0), attempting to place another ammo box at that same position will fail with a position occupied error. The grid constraint rejects the operation before the weight constraint is even considered — whichever constraint fails first blocks the action.
Grid + soft weight — grid allows, weight reports threshold
When you combine a grid constraint with a soft weight constraint, both are evaluated together. If you set up a container called “rig” with a 4×4 grid and a soft weight limit of 12.0 that flags an “overloaded” threshold at 100% capacity, placing items will succeed as long as the grid has space — but the weight constraint still tracks totals independently. After placing three ammo boxes into valid grid positions, the operation succeeds because the grid allows it, but the result reports that the “overloaded” threshold has been exceeded. This is the key difference between hard and soft constraints: a soft weight limit warns you without blocking the action.
Grid + soft weight — grid blocks even when weight is soft
When a container has multiple constraints, all of them are evaluated independently using AND logic. If you set up a container “rig” with a 2×1 grid constraint and a soft weight limit of 100.0, placing an “ammo_box” at position (0, 0) occupies that grid cell. Attempting to place a “grenade” at the same position (0, 0) fails with a position occupied error — even though the weight constraint is soft and permissive, the grid constraint still enforces spatial rules. A soft constraint on one axis doesn’t relax a hard constraint on another.
Slots + weight — slots block new type addition
When a container has multiple constraints, all of them must be satisfied for an operation to succeed. If you configure a “belt” container with both a hard SlotCount(1) and a hard Weight(100.0) constraint, adding a “grenade” fills the single available slot. Attempting to then add an “ammo_box” in exact mode fails with a capacity exceeded error — even if the belt still has weight allowance remaining, the slot limit alone is enough to block the addition.
Slots + weight — weight blocks when adding to existing stack
When a container enforces multiple constraints together, each one must pass independently. If you configure a “belt” container with both a hard SlotCount(5) and a hard Weight(8.0) constraint, adding 2 grenades succeeds as long as both limits are satisfied. However, attempting to add another grenade in exact mode fails with a capacity exceeded error when the weight limit would be breached — even though slot capacity remains available. The belt still holds its original single item stack, since the rejected operation leaves the container unchanged.
Split with weight + slots — slot constraint blocks
When a container enforces multiple constraints together, every constraint must be satisfied for an operation to succeed. If you configure a “belt” container with both a hard SlotCount(2) and a hard Weight(100.0) constraint, then add 5 “grenade” items and 1 “ammo_box” (filling both slots), attempting to split 3 from the “grenade” stack will fail with a capacity exceeded error — even if the weight limit would allow it. Splitting would create a third stack, violating the slot constraint. The belt still contains its original 2 items, unchanged.
Generated from core/tests/features/composable.feature