Logic Gates 逻辑门
v0.6.1Control Gate and Sensor Gate, gate structures spanning across conveyor belts. The sensor gate is a universal signal controller manager: sensing devices (warehouses, nuclear waste d
- Source code
- No source provided
Adds two gate-shaped buildings that span across conveyor belts, like the train waypoint station gate, without any logistics ports. The control gate can pause the belt that runs underneath it, and the sensor gate monitors whether a target warehouse is full.
新增两种门形建筑,横跨在传送带上方(类似游戏内火车途经点站的门,门洞下可铺设传送带,建筑本身无物流进出端口)。控制门可暂停门洞下方的传送带输送,感应门用于监测目标仓库是否已满。

v0.0.1 | 2026-09-17
- 添加两个建筑 控制门和感应门
- 可以建设在传送带上。
- 控制门只能绑定传送带。感应门输入路线绑定控制门,输出路线绑定仓库。
- 控制门未绑定时为红色,绑定传送带后为绿色。受控逻辑执行时,改变为黄色。
- 感应门未绑定时为红色,绑定传送带后为绿色。执行受控逻辑时,改变为蓝色。
- 感应门可以一对多也可以多对多。
- 本mod创意由中国玩家 康哥(QQ283692446)提出,本人进行实现。
- 设计目的,增加一个逻辑门控制建筑,使得成品后端存储建筑可以对前端半成品传送带进行暂停供货的控制。
- 本设计突破和弥补了,游戏中原生缺乏的逻辑门控制。
- 本mod预制体为游戏自身所有,修了材质,使得可以变色。
- 加入滑动条,用户可以自定义仓库多少百分比为满。
- 本设计在0.8.7C版本测试通过。
- 更多逻辑设定需求,请大家社区反馈给我。我将会尽力增补扩充。
- Add two buildings: Control Gate and Sensor Gate
- They can be built on conveyor belts.
- The Control Gate can only be bound to conveyor belts. For the Sensor Gate, its input route is bound to the Control Gate, and its output route is bound to the warehouse.
- The Control Gate appears red when unbound, and turns green after binding to a conveyor belt. It switches to yellow when the controlled logic is running.
- The Sensor Gate appears red when unbound, and turns green after binding to a conveyor belt. It switches to blue when the controlled logic is running.
- Sensor Gates support one-to-many and many-to-many connections.
- The idea for this mod was proposed by Chinese player Kang Ge (QQ: 283692446), and I implemented it.
- Design purpose: Add a logic gate control building, so that the back-end finished product storage buildings can pause supply to the front-end semi-finished product conveyor belts.
- This design breaks through and makes up for the lack of native logic gate controls in the game.
- The prefabs of this mod belong to the game itself; only materials are modified to enable color shifting.
- A slider is added for users to customize the percentage threshold for a full warehouse.
- This design has been tested and works on version 0.8.7C.
- Feel free to send me more requests for logic settings via the community. I will try my best to add and expand features.
Instructions for Use
输入路线,是感应建筑,就是被监控对象。用来获取状态,比如监控仓库是否满?监控传送带是否运行?
输出路线,就是信号输出路线,代表受控建筑,可选平板传送带,u型传送带,水管,熔融类。
Input routes refer to sensing facilities, namely the monitored objects. They are used to obtain status information, such as checking whether the warehouse is full or whether the conveyor belt is running.
Output routes are signal output routes, representing controlled facilities. Optional types include flat conveyor belts, U-shaped conveyor belts, water pipes, and melt-type equipment.
自从0.1.0版本后,控制门建筑实际并不是必须得,但是依然保留。
主要使用感应门建筑自身即可进行感应和控制。
配置完成后,需要点击启用感应门,默认不开启,需要用户手工决定何时启用和关闭感应门。
设定感应门需要钢建设,因为钢的科技靠后,而初期无需感应门参与初期生产。
输入路线选择了仓库,输出路线选择传送带。根据用户自己的场景来决定在什么位置建设和绑定哪一个建筑。
添加规则,规则1 选择感应区建筑,选择满还是不满,选择受控建筑,选择开关。
因为受控单位是传送带类建筑,因此只有开关。
为什么受控建筑不能是仓库,有用户反馈,其只希望仓库某个端口的传送带停止工作而不是仓库不工作。因此原本设计的仓库暂停的策略是会造成仓库无法使用,这是不对的,不合理的。随后废弃该方案。
* 关于暂停后无法开启的问题。
Since version 0.1.0, control gate buildings are not actually required but are still retained.
Induction and control can be performed mainly using the induction door building itself.
After configuration is complete, you need to click to enable the induction door. It is disabled by default, and users must manually decide when to enable and disable the induction door.
Setting up an induction door requires steel construction. Steel is unlocked at a later tech stage, and induction doors are not needed for early-stage production.
The input route is set to the warehouse, and the output route is set to the conveyor belt. Users decide where to build and which building to bind based on their own scenarios.
Add rules: For Rule 1, select the induction zone building, choose full or not full, select the controlled building, and select the switch.
Since the controlled units are conveyor belt-type buildings, only switches are available.
Why warehouses cannot be set as controlled buildings: Some users reported that they only want the conveyor belt at a certain port of the warehouse to stop working instead of the warehouse itself shutting down. Therefore, the original design strategy of pausing the warehouse would render the warehouse unusable, which is incorrect and unreasonable. This solution was subsequently scrapped.
- Regarding the issue of being unable to activate after pausing.
因为你只是设定了一条规则,请注意,开和关,是两个动作逻辑,你设定了关闭传送带,那么请你一定要设定规则2,让他有一个条件可以打开传送带,否则传送带会长期关闭,因为没有其他指令或者条件能让他开启。
Because you have only set one rule. Please note that turning on and turning off are two separate action logics. If you set the rule to turn off the conveyor belt, you must set Rule 2 to provide a condition for turning it on. Otherwise, the conveyor belt will remain closed permanently, as there are no other instructions or conditions to activate it.
V0.6.1后加入了互斥逻辑的判定。
禁止了用户突发奇想的操作,做了防呆处理!🤣
Mutex logic judgment was added after V0.6.1.
Prevented users from performing impromptu operations with foolproof handling! 🤣
🥶有用户突发奇想,居然设定百分之50满为条件开启传送带和百分之50不满情况下关闭传送带。这种左右互搏的逻辑不要出现。
🥶Some users came up with a whimsical idea: setting the conveyor belt to start when it reaches 50% full and stop when it is less than 50% full. This kind of self-contradictory logic should be avoided.
🤣更有用户突发奇想,居然设定了百分之20的不满关闭传送带,百分之90时候开启传送带。但是他忘记了仓库本身就是空的,此时他肯定不满足开启条件。所以悖论逻辑被禁止。
🤣Some users got creative and set the conveyor belt to shut down at a 20% dissatisfaction rate and turn on at 90%. However, they forgot that the warehouse was empty to begin with, meaning the activation condition could never be met. For this reason, paradoxical logic is prohibited.
本mod的逻辑经过测试,是通过的。只有你设定出现问题,才会有问题。最多你可以添加8条规则在同一个感应门内。
但是,如果你需要更加复杂逻辑,使用规则关系按钮。
The logic of this mod has been tested and passed. Problems will only occur if your settings are incorrect. You can add up to 8 rules to a single sensor door. However, use the rule relationship button if you need more complex logic.
专项说明:「与」和「或」的逻辑规则
与(AND):代表 “和”。当条件为 1 和 2 和 3 时,需要同时满足全部条件才会触发执行。 适用场景:需要同时满足两条及以上规则时,选用「与」逻辑。
或(OR):代表 “或者”。当条件为 1 或 2 或 3 时,任意一条条件满足即可触发执行。
最简单的控制示例:单条传送带搭配单个仓库,是最直观的基础控制方案。 感应门可以监控一个仓库,用来控制一条传送带,也可扩展控制多条传送带。
⚠️ 重要注意事项: 只要你设置了开启逻辑,就必须配套设置对应的关闭逻辑。 不建议仅依靠单条规则实现完整控制。推荐搭配使用:规则 1 负责开启,规则 2 负责关闭。
仓库原生自带类似功能,但仓库内置逻辑十分死板,一旦触发会直接关闭仓库全部进出口。 而在生产流程里,玩家往往需要实现:关闭某一条传送带,同时启用另一条传送带。这类需求平衡器、分流器无法实现。
本模组正是为了满足这类特殊场景开发。你可以自由自定义开启 / 关闭的前置触发条件。
如有疑问或新想法,欢迎在社区发帖交流。
English
Special Explanation: Logical Rules of AND and OR
AND: means "and". For conditions 1 AND 2 AND 3, all conditions must be satisfied at the same time to trigger execution. Use AND logic when you need to meet two or more rules simultaneously.
OR: means "or". For conditions 1 OR 2 OR 3, any single satisfied condition will trigger execution.
The simplest control setup: a single conveyor belt paired with one warehouse, this is the most straightforward basic control method. A sensor gate can monitor one warehouse to control one conveyor belt, and it can also be extended to control multiple conveyor belts.
⚠️ Important Notes: If you define a logic for turning on, you must add a corresponding logic for turning off. Do not try to solve the whole problem with only one rule. Recommended pairing: Rule 1 for turning on, Rule 2 for turning off.
Warehouses have a native built-in function for this, but the warehouse’s native logic is rigid. It will shut down all input and output ports once activated.
In production workflows, players often need to disable one conveyor belt and enable another. Balancers and splitters cannot handle this requirement.
This mod is designed specifically for such special demands. You can freely customize the preconditions for turning on and off.
If you have any questions or ideas, feel free to post on the community.
v0.6.1
Latest- Game version
- 0.8.7 - 0.8.7c
- Released
- Sep 17, 2026
- File size
- 3.2 MB
- License
- CoI-Keep
* 修复关系界面打不开的问题。 * 修复关系界面中刷新问题。 * Fixed the issue where the relationship interface could not be opened. * Fixed the refresh issue in the relationship interface.
v0.5.0
- Game version
- 0.8.7 - 0.8.7c
- Released
- Sep 17, 2026
- File size
- 3.2 MB
- License
- CoI-Keep
* 感谢中国玩家 QQ3113726472 提供修改建议更新v0.1.0-v0.50 * 玩家手动暂停的传送带不会被感应门规则自动恢复(暂停来源归属跟踪,写入存档) * 规则"关"仅在传送带运行时暂停并标记归属;已暂停(无论来源)不接管,尊重玩家操作 * 兼容:v0.4.0 及更早存档自动迁移(规则数组魔数区分新旧格式,无感升级) * Thanks to Chinese player QQ3113726472 for providing modification suggestions for updates v0.2.0-v0.50 * Conveyors manually paused by the player are never auto-resumed by sensor gate rules (pause ownership tracking, persisted in save) * A rule "close" only pauses a running conveyor and marks ownership; already-paused conveyors are left untouched, respecting the player * Compatible: v0.4.0 and older saves auto-migrate (magic number distinguishes new/old rule formats, seamless upgrade)
v0.0.1
- Game version
- 0.8.7 - 0.8.7c
- Released
- Sep 17, 2026
- File size
- 3.2 MB
- License
- CoI-Keep
* 添加两个建筑 控制门和感应门 * 可以建设在传送带上。 * 控制门只能绑定传送带。感应门输入路线绑定控制门,输出路线绑定仓库。 * 控制门未绑定时为红色,绑定传送带后为绿色。受控逻辑执行时,改变为黄色。 * 感应门未绑定时为红色,绑定传送带后为绿色。执行受控逻辑时,改变为蓝色。 * 感应门可以一对多也可以多对多。 * 本mod创意由中国玩家 康哥(QQ283692446)提出,本人进行实现。 * 设计目的,增加一个逻辑门控制建筑,使得成品后端存储建筑可以对前端半成品传送带进行暂停供货的控制。 * 本设计突破和弥补了,游戏中原生缺乏的逻辑门控制。 * 本mod预制体为游戏自身所有,修了材质,使得可以变色。 * 加入滑动条,用户可以自定义仓库多少百分比为满。 * 本设计在0.8.7C版本测试通过。 * 更多逻辑设定需求,请大家社区反馈给我。我将会尽力增补扩充。 * Add two buildings: Control Gate and Induction Gate * They can be built on conveyor belts. * The Control Gate can only be bound to conveyor belts. For the Induction Gate, bind its input route to the Control Gate and its output route to the warehouse. * The Control Gate is red when unbound, turns green after binding to a conveyor belt, and changes to yellow when the control logic is running. * The Induction Gate is red when unbound, turns green after binding to a conveyor belt, and changes to blue when the control logic is executed. * Induction Gates support one-to-many and many-to-many connections. * The concept of this mod was proposed by Chinese player Kang Ge (QQ: 283692446), and I implemented it. * Design purpose: Add a logic gate control building, so that end-product back-end storage buildings can pause supply to front-end semi-finished product conveyor belts. * This design breaks through and compensates for the lack of native logic gate control in the game. * The prefabs of this mod belong to the game itself; only materials are modified to enable color shifting. * Add a slider, allowing users to customize the percentage threshold for a full warehouse. * This design has been tested and verified for version 0.8.7C. * If you have demands for more logic settings, please send feedback to me via the community. I will try my best to add and expand features.
v0.6.1 | 2026-09-17
* 修复关系界面打不开的问题。 * 修复关系界面中刷新问题。 * Fixed the issue where the relationship interface could not be opened. * Fixed the refresh issue in the relationship interface.
v0.6.0 | 2026-09-17
* 规则关系升级为"管理器":新增单独"规则关系"窗口,可创建多条关系(每组 = 或/与 + 勾选规则 1..N),未加入关系的规则按独立逻辑执行 * 只有 2 条以上规则时才能打开规则关系;勾选规则自动从其他关系移出(每条规则至多属一组) * 新增互斥逻辑检测:同一传送带感应同一设备、一满一不满、动作相反且阈值重叠(如 满50开 + 不满50关)判为互斥;运行时若感应仓库当前满度已 ≤ 不满阈值(如 仓库本身空 + 满50开 + 不满20关),"开"永远不会发生,同样判为互斥 * 状态机新增"存在互斥逻辑"(红色 Danger)档位提示 * 兼容:旧存档的 独立/或/与 全局模式自动迁移为关系组(或/与 → 全部规则一组;独立 → 无关系) * Rule relations upgraded to a manager: a separate "Rule relations" window manages multiple relations (each = OR/AND + checked rules 1..N); rules not in any relation run independently * The relation window is only clickable with 2+ rules; toggling a rule into a relation auto-removes it from others (each rule belongs to at most one relation) * Added conflicting-logic detection: two rules on the same conveyor sensing the same device, one Full one NotFull, opposite actions, with overlapping thresholds (e.g. full-50 open + not-full-50 close) are flagged as conflicting; at runtime, if the sensed warehouse's current fill is already <= the not-full threshold (e.g. empty warehouse + full-50 open + not-full-20 close), "open" can never fire and it is also flagged * Status machine adds a "Conflicting logic" (red Danger) state * Compatible: old saves' global Independent/OR/AND mode auto-migrates to relation groups (OR/AND -> one group with all rules; Independent -> no relations)
v0.5.1 | 2026-09-17
* 修复:独立模式下"一条规则关、另一条规则开"双规则控制同一传送带时,开规则无法恢复的问题 * 暂停归属改为传送带级:任一规则暂停的传送带,任何规则的开动作都能恢复;玩家手动暂停仍受保护 * Fixed: with two independent rules controlling the same conveyor (one closes, one opens), the open rule could not resume it * Pause ownership is now conveyor-level: any rule's open action can resume a conveyor paused by any rule; player manual pause protection remains
v0.5.0 | 2026-09-17
* 感谢中国玩家 QQ3113726472 提供修改建议更新v0.1.0-v0.50 * 玩家手动暂停的传送带不会被感应门规则自动恢复(暂停来源归属跟踪,写入存档) * 规则"关"仅在传送带运行时暂停并标记归属;已暂停(无论来源)不接管,尊重玩家操作 * 兼容:v0.4.0 及更早存档自动迁移(规则数组魔数区分新旧格式,无感升级) * Thanks to Chinese player QQ3113726472 for providing modification suggestions for updates v0.2.0-v0.50 * Conveyors manually paused by the player are never auto-resumed by sensor gate rules (pause ownership tracking, persisted in save) * A rule "close" only pauses a running conveyor and marks ownership; already-paused conveyors are left untouched, respecting the player * Compatible: v0.4.0 and older saves auto-migrate (magic number distinguishes new/old rule formats, seamless upgrade)
v0.4.0 | 2026-09-17
* 信号设置升级为"通用信号控制管理器"(规则引擎) * 感应设备:可关联存储建筑(仓库、核废料库等,按满度感应)或传送带(按已暂停/运行状态感应) * 受控设备:仅限传送带(平板、U型、水管、融熔);暂停进料传送带而非仓库,仓库始终可流出,杜绝"满后只进不出"的悖论 * 规则:每条 = 感应设备 + 感应条件(满≥X% / 不满≤X%,或传送带已暂停/运行中)+ 受控设备 + 动作(开/关);"添加规则"按钮随时新增 * 规则关系:独立(默认,各规则只控制自己的受控设备,条件不满足时保持现状)、或(任一满足则全部执行)、与(全部满足才执行) * 例:规则1"仓库满50%→关传送带" + 规则2"仓库不满30%→开传送带",两规则天然形成30~50%回差 * 修复:阈值滑块再次加粗(高度 2pt → 4pt) * 兼容:v0.0.1/v0.1.0/v0.2.0/v0.3.0 旧存档自动迁移为规则(迁移后建议重新配置规则) * Signal settings upgraded to a universal signal controller manager (rule engine) * Sensing devices: link storage buildings (warehouses, nuclear waste depots, etc., sensed by fill level) or conveyors (sensed by paused/running state) * Controlled devices: conveyors only (flat, U-type, pipe, molten); pauses the feeding conveyor instead of the warehouse, so the warehouse can always output - no deadlock * Rules: each = sensing device + sensing condition (full >= X% / not-full <= X%, or conveyor paused/running) + controlled device + action (open/close); "Add rule" button adds more * Rule combine: Independent (default; each rule controls only its own device, holds state when condition is false), OR (any true -> all act), AND (all true -> all act) * Example: rule 1 "warehouse 50% full -> close conveyor" + rule 2 "warehouse not-full <= 30% -> open conveyor" naturally form a 30-50% hysteresis * Fixed: threshold sliders thickened again (height 2pt -> 4pt) * Compatible: v0.0.1/v0.1.0/v0.2.0/v0.3.0 saves auto-migrate to rules (reconfiguring after migration is recommended)
v0.3.0 | 2026-09-17
* 信号设置拆分为"输入信号设置"和"输出信号设置"两路,各自独立监测与控制 * 输入信号:监测输入路线仓库,控制输入路线传送带/水管;输出信号:监测输出路线仓库,控制输出路线传送带/水管/仓库 * 信号设置顶部新增"启用感应门"总开关,默认关闭;配置完成后手工启用才开始执行逻辑 * 修复:实体查询改用基类类型判断,杜绝按仓库 id 查询传送带类型导致的每帧断言刷日志 * 加粗阈值滑动条 * Signal settings are split into "Input signal" and "Output signal", each monitoring and controlling its own route independently * Input signal monitors input-route warehouses and controls input-route conveyors/pipes; output signal monitors output-route warehouses and controls output-route conveyors/pipes/warehouses * Added an "Enable sensor gate" master switch at the top of signal settings; off by default, logic starts only after manual enabling * Fixed: entity lookups now use base-type checks, eliminating per-frame assertion log spam caused by querying warehouse ids as transport type * Made threshold sliders thicker
v0.2.0 | 2026-09-17
* 满/不满各增加"启用"选择器,可分别启用或停用满/不满功能 * 滑块仍为 0-100,满/不满阈值完全由用户自定(如满20开、不满10关) * 停用后对应逻辑不生效,两功能均停用时感应门不动作 * Added an enable toggle before each "Full" and "Not full" row, so each feature can be enabled or disabled independently * Sliders remain 0-100; full/not-full thresholds are fully user-defined (e.g. full 20 open, not-full 10 close) * Disabled features do not trigger; when both are disabled the sensor gate does nothing
v0.1.0 | 2026-09-17
* 感应门升级:输入/输出路线均可关联传送带(平板、U型、水管、融熔)与仓库 * 新增"满/不满"四档控制:满→开、满→关、不满→开、不满→关(回差区间保持现状) * 感应门输入路线关联仓库后,界面追加满度显示与"满/不满"阈值设置面板 * 受控对象(传送带、水管、仓库)统一通过暂停/恢复控制;仓库关联于输出路线时同样被暂停/恢复 * 兼容旧存档:旧版"输出=仓库"自动并入监测源 * Sensor gate upgrade: input/output routes can now link conveyors (flat, U-shaped, pipes, molten metal channels) and warehouses * Added four full/not-full controls: full-open, full-close, not-full-open, not-full-close (hysteresis keeps current state) * When a warehouse is linked on the input route, the panel shows fill level plus full/not-full threshold sliders * Controlled targets (conveyors, pipes, warehouses) are paused/resumed uniformly; warehouses on the output route are paused/resumed too * Old saves are migrated: previous output warehouses are merged into the sensed sources
v0.0.1 | 2026-09-15
* 添加两个建筑 控制门和感应门 * 可以建设在传送带上。 * 控制门只能绑定传送带。感应门输入路线绑定控制门,输出路线绑定仓库。 * 控制门未绑定时为红色,绑定传送带后为绿色。受控逻辑执行时,改变为黄色。 * 感应门未绑定时为红色,绑定传送带后为绿色。执行受控逻辑时,改变为蓝色。 * 感应门可以一对多也可以多对多。 * 本mod创意由中国玩家 康哥(QQ283692446)提出,本人进行实现。 * 设计目的,增加一个逻辑门控制建筑,使得成品后端存储建筑可以对前端半成品传送带进行暂停供货的控制。 * 本设计突破和弥补了,游戏中原生缺乏的逻辑门控制。 * 本mod预制体为游戏自身所有,修了材质,使得可以变色。 * 加入滑动条,用户可以自定义仓库多少百分比为满。 * 本设计在0.8.7C版本测试通过。 * 更多逻辑设定需求,请大家社区反馈给我。我将会尽力增补扩充。 * Add two buildings: Control Gate and Induction Gate * They can be built on conveyor belts. * The Control Gate can only be bound to conveyor belts. For the Induction Gate, bind its input route to the Control Gate and its output route to the warehouse. * The Control Gate is red when unbound, turns green after binding to a conveyor belt, and changes to yellow when the control logic is running. * The Induction Gate is red when unbound, turns green after binding to a conveyor belt, and changes to blue when the control logic is executed. * Induction Gates support one-to-many and many-to-many connections. * The concept of this mod was proposed by Chinese player Kang Ge (QQ: 283692446), and I implemented it. * Design purpose: Add a logic gate control building, so that end-product back-end storage buildings can pause supply to front-end semi-finished product conveyor belts. * This design breaks through and compensates for the lack of native logic gate control in the game. * The prefabs of this mod belong to the game itself; only materials are modified to enable color shifting. * Add a slider, allowing users to customize the percentage threshold for a full warehouse. * This design has been tested and verified for version 0.8.7C. * If you have demands for more logic settings, please send feedback to me via the community. I will try my best to add and expand features.
This mod has no dependencies.
No other mods depend on this mod yet.