Simple light

From GMod Wiki

Jump to: navigation, search



Simple Light

Simple light: Simple Light
Page white text.png Description:A simple switchable light through wire.
link=User:User:Chronic Original Author:User:Chronic
Calendar.png Created:12 July 2007
Page white text.png Notes:-


Materials

  1. A flat surface or prop.
  2. A wire Light with the radiant flag checked.
  3. A Gate - Arithmetic, Multiply chip.
  4. A Constant Value for 255.
  5. A wire Button set to toggle with on value 1 and off value 0.

Set-up

  1. Place the wire Light on the prop or surface.
  2. Place your Gate - Arithmetic, Multiply under the light.
  3. Place your Constant Value next to the chip with the value 255.
  4. Place a Button next to all of this.

Wiring

  1. Select the Wire STOOL.
  2. Left-click the light and then left-click on the chip. Right-click the light, left-click the light, and then left-click the chip. Right-click the light twice, left-click the light, and then left-click the chip.
  3. Left-click the chip and then left-click the Constant Value. Right-click the chip, left-click the chip, and then left-click again on the Button.

You'rer finished! Press the button and watch as your new wire contraption lights up.

Explanation

The gate multiplies two things: the Constant Value and a variable (the button). When the variable is zero (the button is off) the gate multiplies 255 from the Constant Value and the off value of the button, 0. 255 * 0 = 0 and therefore the light stays unlit. When the variable is one however, (button is on) the gate multiplies 255 and one. 255 * 1 = 255 which tells the light to glow a bright white.

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox