Garry's Mod
Garry's Mod

Logic Gates (AND, OR, NOT, XOR)

Master Garry's Mod Wiremod logic gates: AND, OR, NOT, XOR. Learn their functions and how to use them to build decision-making circuits for contraptions.

Logic Gates (AND, OR, NOT, XOR)

Wiremod in Garry's Mod allows for the creation of complex contraptions by simulating electronic circuits. At the heart of digital logic are logic gates: fundamental building blocks that perform basic Boolean operations. Understanding AND, OR, NOT, and XOR gates is essential for creating anything from simple automated systems to intricate machines.

These gates take one or more binary inputs (typically represented as 0 for false/off and 1 for true/on) and produce a single binary output based on a specific logical rule. By combining these gates, you can construct circuits that perform calculations, make decisions, and control other entities within Garry's Mod.

Understanding the Gates:

  • AND Gate: Outputs TRUE (1) only if ALL of its inputs are TRUE (1). Otherwise, it outputs FALSE (0). Think of it as requiring multiple conditions to be met simultaneously.
  • OR Gate: Outputs TRUE (1) if AT LEAST ONE of its inputs is TRUE (1). It only outputs FALSE (0) if all inputs are FALSE (0). This gate represents an "either/or" scenario.
  • NOT Gate (Inverter): Has only one input. It outputs the opposite of its input: if the input is TRUE (1), the output is FALSE (0), and vice versa.
  • XOR Gate (Exclusive OR): Outputs TRUE (1) if its inputs are DIFFERENT (one is TRUE, the other is FALSE). If both inputs are the same (both TRUE or both FALSE), it outputs FALSE (0).

Practical Applications in GMod:

Imagine you want to build a security system that only activates a turret when a specific button is pressed AND a proximity sensor detects an enemy. This would require an AND gate. If you want a door to open if either a keycard is detected OR a manual override switch is flipped, you'd use an OR gate. A NOT gate could be used to invert a sal, for example, to turn off a light when a sensor is activated.

The "Azur Lane Crosswave - Prinz Eugen" or "Azur Lane Crosswave - Laffey" NPCs, while not directly related to logic gates, could be part of a larger contraption where their activation status (e.g., being alive or defeated) acts as an input to a logic circuit controlling other game elements.

Creating Logic Gates in Wiremod:

In Garry's Mod, you can find these logic gates within the Wiremod tool menu. They are typically found under the "Logic" tab. You'll need to spawn the desired gate entity and then connect its inputs and outputs to other components (like buttons, sensors, or other gates) using the "Chip Wire" tool.

Gate Inputs Output Condition
AND 2+ All inputs TRUE
OR 2+ At least one input TRUE
NOT 1 Opposite of input
XOR 2+ Inputs are different