Skip to main content

Mask Expression

The Logic Controller. Combines multiple boolean masks using a sequence of logical operations. This node uses a table-based interface where each row represents a step in the expression.

Ports

PortTypeDirectionDescription
Masks Bool MaskInput (Multi)Multiple input masks. Addressed in the rules table by their 1-based index (Slot 1, Slot 2, etc.).
Output Bool MaskOutputThe final result after all expression rows are evaluated.

Operations

OperationLogicDescription
ReplaceResult = InputClears the previous result and starts fresh with this mask. Often used for the first row.
ANDResult && InputIntersection. Output is 1 only if BOTH the previous result AND the input are 1.
ORResult || InputUnion. Output is 1 if EITHER the previous result OR the input are 1.
XORResult ^ InputDifference. Output is 1 only if the previous result and input are DIFFERENT.
SubtractResult && !InputExclusion. Removes the input mask from the current result.

Details

Each row in the Rules table allows you to:

  1. Select a Slot: Which input mask from the Masks port to use.
  2. Choose an Operation: How to combine this mask with the "running total" from rows above.
  3. Invert: Flip the input mask (1 becomes 0, 0 becomes 1) before applying the operation.

Example: "Caves but not in Water"

  • Row 1: Slot 1 (Caves), Operation: Replace
  • Row 2: Slot 2 (Water), Operation: Subtract