Wiremod: Introduction to Logic
Wiremod is a powerful addon for Garry's Mod that introduces a visual scripting system, allowing players to create complex contraptions and interactive systems without writing traditional Lua code. At its core, Wiremod revolves around connecting various 'gates' and 'inputs' to create logical circuits that control entities and props within the game.
The fundamental concept of Wiremod logic is based on Boolean algebra and digital electronics. You connect different types of gates (like AND, OR, NOT, XOR) and input devices (buttons, levers, sensors) to output devices (thrusters, lights, doors) to create functional circuits. Understanding these basic logic gates is the first step to building sophisticated machinery.
Key Wiremod Components:
- Inputs: Devices that provide sals (e.g., Buttons, Timers, Proximity Sensors, Keypads).
- Gates: Logical operators that process input sals (e.g., AND, OR, NOT, XOR, Comparators).
- Outputs: Devices that perform actions based on received sals (e.g., Thrusters, Lights, Doors, Speakers).
- Wires: The physical connections that transmit sals between components.
- Constant: A gate that outputs a fixed value (true or false, or a number).
Building Basic Logic Circuits:
- Spawn Components: Open the Q menu and find Wiremod components under 'Wiremod'. Spawn the desired inputs, gates, and outputs.
- Connect Components: Use the Wiremod tool to draw connections between the output of one component and the input of another.
- Create an AND Gate Circuit: Spawn two buttons (Inputs) and an AND gate. Connect both buttons to the AND gate's inputs. Connect the AND gate's output to a light (Output). The light will only turn on when both buttons are pressed.
- Create an OR Gate Circuit: Similar to the AND gate, but use an OR gate. The light will turn on if either button is pressed.
- Create a NOT Gate Circuit: Connect a button to a NOT gate's input. Connect the NOT gate's output to a light. The light will turn on when the button is *not* pressed.
Mastering these basic logic gates is the foundation for creating everything from simple automated doors to complex computer systems within Garry's Mod.