#Quality Lib updated API

1 messages · Page 1 of 1 (latest)

quaint quartz
#

@little birch moving your showcase post into a thread because holy balls it's way too big

#

https://mods.factorio.com/mod/quality-lib

Quality Lib has updated its API to support easier manipulation of through a number of methods.

First are delta fields which will automatically increment a stat based on their level with a specified method. Currently supports additive constants, additive multipliers, and multiplicative multipliers.

Example using a Cargo Wagon's inventory size (Base value = 40):

quality_lib.add(
    {
        ["cargo-wagon"]={
            ["cargo-wagon"]={
                ["inventory_size"]={delta_constant = 8}
            }
        }
    }
)

This will increase the stat by 8 for each level.

Uncommon:  48
Rare:      56
Epic:      64
Quality 4: 72
Legendary: 80
Quality 6: 88
Quality 7: 96
etc...
quality_lib.add(
    {
        ["cargo-wagon"]={
            ["cargo-wagon"]={
                ["inventory_size"]={delta_additive = 0.2}
            }
        }
    }
)

This will increase the multiplier by 0.2x each level, starting at 1.0x

Uncommon:  48 (1.2x)
Rare:      56 (1.4x)
Epic:      64 (1.6x)
Quality 4: 72 (1.8x)
Legendary: 80 (2.0x)
Quality 6: 88 (2.2x)
Quality 7: 96 (2.4x)
etc...
quality_lib.add(
    {
        ["cargo-wagon"]={
            ["cargo-wagon"]={
                ["inventory_size"]={delta_multiplicative = 1.2}
            }
        }
    }
)

This will multiply every level by the given multiplier, thus resulting in an exponential increase.

Uncommon:  48
Rare:      57.6
Epic:      69.12
Quality 4: 82.944
Legendary: 99.5328
Quality 6: 119.43936
Quality 7: 143.327232
etc...

(1/2)

Factorio Mod Portal

Provides a library for modders to easily interface with Quality and add quality stats to any item/entity.