Skip to content

Instantly share code, notes, and snippets.

@snqwq
Last active May 13, 2024 17:36
Show Gist options
  • Save snqwq/5c9938d2c629511e66b69951e9aafe27 to your computer and use it in GitHub Desktop.
Save snqwq/5c9938d2c629511e66b69951e9aafe27 to your computer and use it in GitHub Desktop.
town wiring

(Unofficial) Town Wiring Guide

version 1.2

by: Snqwq

based off of the official wiring guide

Definitions and Terms

  • Wire = any part that is used to connect to other parts using the wiring system
  • Circuit = a group of wires that are connected to each other directly via groups
  • System = a group of circuits that are connected to each other via signals
  • R1 = repeat 1
  • R2 = repeat 2
  • Img = image id
  • Color = part color

Important Notes

  • Texture transparency must be -500 or 500 for the game to recognize it as a wire

  • Img must be set to any number not between 0 and 10 because of some backwards compatibility stuff (i suggest setting it to 999 if u don't want sound)

  • circuit must be grouped to be recognized as a circuit

Important commands and keybinds

commands

!wc to update wires on a plot to (non editable) functioning wires

!uwc to revert wires on a plot to (editable) non functioning wires

keybinds

shift + g to group selection

shift + u to un-group selection

Usage

R1: wire type

R2: wire setting (like tween speed or logic type)

Img: used for sound when activated

V: value of a setting (like R2 = 2 would be R2 V2)

Color: used to separate wires into channels

Wire Types (R1)

  1. start position

    Description: the start position of a tween

    R2: tween to end position speed

    Img: sound id to play when activated

  2. end position

    Description: the end position of a tween

    R2: tween to start position speed

    Img: sound id to play when activated

  3. send signal

    Description: sends a signal to all receivers of the same color

    Color: channel of the signal

  4. receive signal

    Description: receives a signal from a sender of the same color

    Color: channel of the signal

  5. force signal type

    Description: outputs a single type of signal

    R2: signal type:

     1 = negative when activated
    
     2 = positive when activated
    
     3 = negative when deactivated
    
     4 = positive when deactivated
    
     5 = negative always
    
     6 = positive always
    
  6. shoot gate

    Description: activates when shot

    Img: sound id to play when shot

  7. touch gate

    Description: activates when touched

    R2: touch type:

     1 = activate when entered
    
     2 = activate when exited
    
     3 = activate when entered or exited
    
  8. monitor

    Description: interact to view cameras of the same color

  9. camera

    Description: camera to view from a monitor of the same color

  10. logic gate (a bit more complicated)

    Description: outputs a signal based on the input signals

    R2: logic type:

    1 = or gate (a || b), a or b must be true to output true
    
    2 = and gate (a && b), a and b must be true to output true
    
    3 = not gate !(a), a must be false to output true
    
    4 = nand gate !(a && b), a and b must be false to output true
    
    5 = nor gate !(a || b), a or b must be false to output true
    
    6 = xor gate (a !== b), a or b must be different than each other to output true
    
    7 = xnor gate (a === b), a and b must be the same as each other to output true
    

Truth Tables

(truth tables are basically just how logic gates work represented as a table)

  • OR gate

    A B Output
    0 0 0
    0 1 1
    1 0 1
    1 1 1
  • AND gate

    A B Output
    0 0 0
    0 1 0
    1 0 0
    1 1 1
  • NOT gate

    A Output
    0 1
    1 0
  • NAND gate

    A B Output
    0 0 1
    0 1 1
    1 0 1
    1 1 0
  • NOR gate

    A B Output
    0 0 1
    0 1 0
    1 0 0
    1 1 0
  • XOR gate

    A B Output
    0 0 0
    0 1 1
    1 0 1
    1 1 0
  • XNOR gate

    A B Output
    0 0 1
    0 1 0
    1 0 0
    1 1 1

Tutorials

  • add here

Examples

  • add here

Notes

  • add here

Credits

  • Snqwq - cool unofficial guide creator
  • DecodeUnicode - town creator and official wiring guide creator
  • You - for taking the time to read this :)

Changelog

(date format: MM/DD/YYYY)

  • 1/4/2024

    • created unofficial guide and added all the sections and content from original guide (snqwq)
    • edited some of the content to be more understandable (snqwq)
    • set to version 1.0
  • 1/5/2024

    • added more important notes
  • 2/21/2024

    • fixed the changelog dating and added some clarifications
  • 5/13/2024

    • added the truth tables section
    • fixed a few errors in the guide
    • made capitalization more consistent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment