Factorio Standard Library

by Nexela

The Factorio Standard Library is a project to bring Factorio modders high-quality, commonly-required utilities and tools.

Internal
1 year, 4 months ago
0.17 - 1.1
359K

g feature flags by version?

3 years ago

It might be useful to present a set of feature flags by Factorio version, for example, something like the following:

local version = require("version")

local factorio_version = version(script.active_mods["base"].version)

local SCRIPT_RAISED_BUILT_HAS_FILTER = false

if factorio_version > version("0.18.27") then
    SCRIPT_RAISED_BUILT_HAS_FILTER = true
end

This would allow the choice of implementing the old way or the new way, rather than strictly requiring the very latest version, and picking which to use on load.

3 years ago

Why should someone invest time into developing code for an outdated Version? Why should someone use an outdated version? The update is free ...

3 years ago

I agree. Supporting old things is bad. And while i try to keep things backwards compatible and easy to use that is not always the case

New response