Technology: OR (Redux)


Provides logical OR operation in the technology tree for other mods. An OR-node automatically unlocks as soon as one of the predecessor technologies is researched.

Internal
2 days ago
2.0 - 2.1
23
Owner:
QuingKhaos
Source:
https://github.com/QuingKhaos/technol...
Homepage:
https://discord.gg/SYmkaDjFCt
License:
GNU LGPLv3
Created:
4 days ago
Latest Version:
2.1.0 (2 days ago)
Factorio version:
2.0 - 2.1
Downloaded by:
23 users

Technology: OR (Redux)

Provides logical OR operation in the technology tree for other mods. An OR-node can be used as prerequisite for other technologies, so they become available for research, as soon as one of the prerequisite technologies is researched.

Usage

Example:

local technology_or = require("__technology-or-redux__.technology-or")

local tech = technology_or.OR({"automation", "logistics"})
data.raw["technology"]["automobilism"].prerequisites = {tech.name}

data:extend({tech})

The technology_or.OR function takes a list of technology names and returns a new TechnologyPrototype object, which can be used as prerequisite for other technologies. The new technology will be automatically unlocked, as soon as one of the given predecessor technologies is researched.

Credits

Re-implementation of the original Technology Tree: logical OR operator mod by Pithlit for Factorio 2.0+. I omitted the DEPEND_ON function, as that has nothing to do with the OR operation and may be re-implemented in a separate mod.