FANDOM


How To Rec Room - Circuits

How To Rec Room - Circuits

YouTube tutorial about an earlier version of Circuits by Against Gravity

About

Chips are elements of Circuits that process or provide signals. They can be used in Custom Rooms in Sandbox mode to perform computations and other operations, for example, to start and stop the game, keep track of the scores, respawn players, announce a winner, send messages to players, play sound effects, lock Room Doors, control Circuit Stage Lights, Holotars, Samplers, and Gizmos, etc.

If your Permissions in a room allow you to use the Maker Pen and view gadgets, you can create chips with the “Gadgets” tab of Palette. These chips appear as small black boxes. Most of the chips can be configured with the Settings mode of the Maker Pen. The pins of the chips can be connected and disconnected with the Wire mode of the Maker Pen. In general, input pins to a chip are on the left, and output pins from the chip are on the right. An input can have 0 or 1 connection, an output can have multiple connections. Connections are removed by grabbing the connection from the input pin with the Wire mode and then dropping it.

You can get information about most pins (function of input pins and current values of output pins) by pointing with the ray of the Wire mode at a pin for about 2 seconds. Input pins that are not wired to anything usually receive a 0 signal. A true input to the reset pin (white with "R" printed on it) will reset a chip, that usually means all outputs are forced to be 0.

Examples of circuits with most of these chips are on the page Circuit Diagrams.

For common problems with chips, see the description of pitfalls on the circuits page.

Math Chips

Palette math chips

The Math Chips.

This section describes all chips that are available in the "Gadgets" tab of the Palette with the filter "Math Chips". You have to have Permissions to view gadgets and to use the Maker Pen to get access to this tab.

Boolean

Circuits 003

Boolean chips act as logic gates, supporting "And", "Or", "Nand", "Nor", and "Not" operations. You can set the operation with the Settings tool of the Maker Pen.

AND

Inputs:

Pin Range Description
Red to Black Boolean Boolean inputs.
Reset Boolean Causes both outputs to be false.

Outputs:

Pin Range Description
Red Boolean True if reset is not set, and all connected inputs are true. False otherwise.
Green Boolean False if reset is set, or no input is connected, or any connected inputs are false. True otherwise.

OR

Inputs:

Pin Range Description
Red to Black Boolean Boolean inputs.
Reset Boolean Causes both outputs to be false.

Outputs:

Pin Range Description
Red Boolean True if reset is not set, and any connected input is true. False otherwise.
Green Boolean False if reset is set, or no input is connected, or all connected inputs are true. True otherwise.

NOT

Inputs:

Pin Range Description
Red Boolean Boolean input.
Reset Boolean Causes the output to be false.

Outputs:

Pin Range Description
Red Boolean True if reset is not set, and the input is connected, and the input is false. False otherwise.


Combinator

Circuits 001
Combinator chips do mathematical operations on inputs. Currently, addition, subtraction, multiplication, division and modulo (remainder after division) operations are supported. You can set the operation with the Settings tool of the Maker Pen.

A common application of the addition operation is to increment a score. Note that to increment a score, you need to connect the output of the chip to one input in order to add the new score to it.

A common application of the modulo operation is to toggle between 0 and 1: by computing an input value modulo 2, the result will toggle between 0 and 1 if the input is incremented in steps of 1.

Comparer

Circuits 002
Comparer chips do mathematical comparisons between the red input signal and the green input signal, including equals, not equals, greater than and less than operations. If "Advanced Mode" is not checked in the chip's settings, the red output true if the comparison is true and false otherwise, the green output has the negated value.

In "Advanced Mode" the red output has the value of the cyan input if the comparison is true and 0 otherwise, the green output has the value of the pink input if the comparison is false and 0 otherwise. Often both outputs are directly connected to an addition Combinator in advanced mode.

You can set the comparison and the mode with the Settings tool of the Maker Pen.

Random

Circuit 02

Every tick the red node gets a True signal, the random chip generates an output value with a random number in the range from the green input (inclusive) to the blue input (exclusive). In other words, the value from the green input can appear, the value from the blue input cannot appear. To roll numbers from 1 to 6, input 1 to green and 7 to blue. If the upper and lower bound are equal, that value will be generated, if the upper bound is larger than the lower bound, 0 will be generated.

Inputs:

Pin Label Range Description
Red Generate Signal 0 or ≠0 The chips generates a new value every tick this input is set.
Green Min Any Lower bound of the output (inclusive).
Blue Max Any Upper bound of the output (exclusive).

Outputs:

Pin Label Range Description
Red RAND [Green, Blue) ≥ green and < blue Generated random value.

Settings:

Name Label Values Description
Mode RAND [Green, Blue) Continuous, Pulse Continuous: The output will stay at the last generated value until a new one is generated.

Pulse: The output will only be the generated value in the tick that it is generated, otherwise 0.


Variable

Circuit013
Variable chips hold three integer numbers that are available as output on the pins on the right side. You can set the values with the Settings tool of the Maker Pen.

Wave

Chips wave

The wave chip outputs a sine, cosine, square, triangle, or sawtooth function of a specified cycle duration and amplitude.

Inputs:

Pin Label Range Description
Red ON/OFF Boolean True (signal unequal 0) turns the wave function on, false (0) outputs 0 on the red pin.
Green Cycle duration (sec/0.1sec) Seconds or 0.1 seconds Determines how long one period of the wave function is. Units depend on settings.
Blue Amplitude Boolean The maximum output value. The minimum output value is the negative amplitude for all wave functions.
R Reset Boolean True (signal unequal 0) outputs 0 on the red pin.

Outputs:

Pin Label Range Description
Red Signal value -Blue to +Blue Outputs a sine, cosine, square, triangle, or sawtooth function of the specified cycle duration and amplitude.
R Reset Any Outputs the R input.

Settings:

Name Label Values Description
Mode Mode Sine, Cosine, Square, Triangle, Sawtooth Specifies the wave functions.
Cycle duration units Period input units Seconds, 0.1 Seconds Specifies the units in which the green input is specified.


Game Chips

Palette game chips1

First page of "Game Chips."

Palette game chips2

Second page of "Game Chips."

This section describes all chips that are available in the "Gadgets" tab of the Palette with the filter "Game Chips". You have to have Permissions to view gadgets and to use the Maker Pen to get access to this tab.

Game State

Circuit 06
Sends a momentary output of 1 on the appropriate pin when the game state changes:
  • Red = Game Start
  • Green = Game End
  • Blue = Pre-Game Start (5 to 6 seconds before Game Start)


Get Player Stat

Circuit 10

Chip used to retrieve player stats given a player ID. The Red Input Pin takes in a player ID and the Red Output Pin outputs the value stored in whatever stat slot is selected through the chip settings menu.

Get Score

Circuit 08
If the red input pin receives a team ID, then the red output pin returns the team's score from the scoreboard. This can be used to make announcements about the score.

Player Event

Circuit 12

A signal is sent from this chip when any of 4 player events occurs. When a player joins, their ID is sent from the Red Pin. When a player leaves, their ID is sent from the Green Pin. The count of players in the map is constantly sent from the Blue Pin. When a player changes teams, their ID is sent from the Cyan Pin.

Player Hit

Circuit 04

The player hit node can be used to detect who hits someone, and who is hit, and by how much damage. Red outputs the player ID of the attacker, green the player ID of the defender, blue the team ID of the attacker, cyan the team ID of the defender, and red the damage of the attack.

Other than in other game modes, the damage of weapons is currently constant in sandbox rooms. It does not take into account factors like distance for grenade launchers or how far a bow has been pulled.

Chips are only evaluated about every 10th of a second, but the player hit chip is buffered and therefore does not miss any hits. For example when hitting two players at the same time (with grenades or shotguns). The hit chip outputs both hits in sequence. If multiple hits occur during the tick period, the damage output is combined into a single tick. For example when hitting someone with a shotgun, all particles will be registered during the same tick and therefore output a damage of up to 136 in a single tick instead of 17 ticks of 8 damage. The Laser Burst Gun appears to fire about 15 shots per second and therefore outputs damages of 5 or 10 for body shots. Different than in previous updates, this also means that a weapon cannot be identified by its damage anymore.

Weapon damages:

In this table -- denotes that the attack will not cause the player hit chip to output anything, while 0 is a regular hit with no damage. The reduced damage column applies when a weapon or shield (paintball, quest or soccer shield) is hit.

Weapon Base

Damage

Reduced Damage

(shield or weapon hit)

Critical Damage

(headshot)

Rate of fire (round/min) Clip size
Paint pistol 18 18 30 --
Paint shotgun 10 10 10 --
Paint scope rifle 40 40 80 --
Paint burst gun 12 12 20 5
Launcher 100 100 100 --
Paintball shield -- -- -- -- --
Beam weapon 15 15 600 60
Laser pistol 20 20 30 5
Laser railgun 40 40 80 3
Laser shotgun 5 5 8 3
Laser burst gun 5 5 6 30
Laser launcher 100 100 100 --
Quest crossbow 50 -- 100 -- --
Quest bow 40 -- 60 -- --
Quest sword 100 100 100 -- --
Quest shield 0 0 0 -- --
Magic wand 4 4 8 --
Hunter's crossbow 25 -- 35 -- --
Confetti gun -- -- -- -- --
Snowball pile 1 0 1 -- --
Grenade 0-100 0-100 0-100 -- --


Weapon by damage:

b stands for Base damage, r for Reduced damage, and c for Critical damage.

100 Paint Launcher (b/r/c) Laser Launcher (b/r/c)
Quest Crossbow (c) Quest Sword (b/r/c)
80 Paint Scope Rifle (c) Laser Railgun (c)


60


Quest Bow (c)
50


Quest Crossbow (b)
40 Paint Scope Rifle (b/r) Laser Railgun (b/r)
Quest Bow (b)
35


Hunter‘s Crossbow (c)
30 Paint Pistol (c) Laser Pistol (c)


25


Hunter‘s Crossbow (b)
20 Paint Burst Gun (c) Laser Pistol (b/r)


18 Paint Pistol (b/r)



15 Beam Weapon (b/c)
12 Paint Burst Gun (b/r)



10 Paint Shotgun (b/r/c)



8
Laser Shotgun (c)
Magic Wand (c)
6
Laser Burst Gun (c)


5
Laser Shotgun (b/r) Laser Burst Gun (b/r)

4


Magic Wand (b/r)
1



Snowball (b/c)
0


Quest Shield (b/r/c) Snowball (r)

Respawn

Circuit 05
The red input (respawn player on team node) respawns the player with the ID of the input signal on a valid respawn point. The green input respawns the entire team, where a signal of 1 is the blue team, 2 the red team, etc. -1 (or any negative value) respawns players of all teams.

Set Game State

Circuit 07
A signal unequal to 0 (True) on the red pin starts the game (or more precisely: it starts the pre-game sequence and after 5 to 6 seconds, it starts the game). A signal unequal to 0 (True) on the green pin stops the game.The game length is set in the Watch Menu: This Room, Details tab, Setup button, Host tab.

Set Player Stat

Circuit 11

This chip is used to set the value of a player stat. If the green pin is set to a value greater than 0 (True), then the value supplied in the blue pin is assigned to the stat selected in the settings of the player with the player ID that is specified by the signal in the red pin. Sending a -1 to the red pin sets the stat of all players.

Stats can only be set when a game is in progress. "Stat1" shows up on the score board.

Setting the Health stat to 0 (or less) puts the player in a dead state similar to paintball where they immediately drop their weapons, see everything in black and white, and lose the ability to interact with objects and to teleport.

All player stats are set to their defaults when a player changes teams. The defaults are 0 for all stats except for Health which has a default of 1.

Set Score

Circuit 09
If a game is in progress and the green pin receives True (a signal unequal to 0), then the number on the blue pin is set as score of the team with the team ID on the red pin.

Team Mapping

Circuits 004

Depending on its settings (use the Settings tool of the Maker Pen), this chip can map a player ID to the number of the team and the index of the player on the team (first player on the team has index 1), and vice versa, as well as change a player to another team.

Other Chips

Palette other chips1

First page of "Other Chips."

Palette other chips2

Second page of "Other Chips."

This section describes all chips that are available in the "Gadgets" tab of the Palette with the filter "Other Chips". You have to have Permissions to view gadgets and to use the Maker Pen to get access to this tab.

Delay

Circuit 16

Delay chips take a signal passed on the red pin, wait the amount of time provided by the green pin (in circuit ticks, i.e. 10th of seconds), and then output the signal from the red input pin momentarily on the red output pin before outputting 0 again, even if the input stays on a different value. It will emit a pulse again, if the input value changes to a different non-zero value. The minimum delay time (green input) is 1, even if you don't connect anything to the delay input.

If new signals come in before the last one is put out, the delay chip buffers the latest 20 signals (value + delay) and outputs them in the correct order.


Message

Circuit 15

Message chips display a message to all players in a room when the red input pin is set to true. The message is sent to only one player when the green pin is set to a player ID. The message is sent to all players on one team, if the blue pin is set to a team ID. The message can be edited with the Settings tool of the Maker Pen.

Object Mapper

Chips object player

This chip allows to map an object ID to the player ID of the player who last held the object.

Pin Label Range Description
Red input Object ID valid object ID Object ID (e.g., from Trigger Zone)
Red output Last Held Player 0 or a player ID Player ID of the player who last held the object
Green output ... ... ...

Output

Circuit 14

Output chips display the numeric value input on the red pin on the left.


Role Mapper

The role mapper chip can assign a non-standard (game) Role to a player or team; remove the role; query whether a player has a role, and query whose player's roles have changed. Usually, you should define non-standard Role before you configure this chip.   

Chips rolemapper

Inputs:

Pin Label Range Description
Red Player A valid player ID The player ID of the player who should have a role added, removed, or queried.
Green Team A valid team ID The team ID of the team that should have a role added or removed.

Outputs:

Pin Label Range Description
Red Player A valid player ID The player ID of the relevant player.
Green Has Role Boolean True (1) if the player has a role; false (0) otherwise.

Settings:

Name Label Values Description
Mode Mode Add Player Role, Remove Player Role, Player has Role, Player Role Changed Add Player Role: adds a non-standard role to a player or team; Remove Player Role: removes a non-standard role from a player or team; Player Has Role: queries whether a player has a non-standard role; Player Role Changed: outputs the player ID of a player whose roles have changed (including standard roles).
Player Role Mode Any non-standard Game Role Any of the non-standard Roles.


Selector Chip

Selector chip

The selector chip has two modes that can be set with the Settings tool of the Maker Pen: "First" and "All". The selector chip compares the red input signal with the numbers of output pins that are specified in the settings of the chip. If the mode is set to "First", the chip sends the green input signal to the first output pin that has the same number as the red input signal. All other output pins are set to 0. If the mode is set to "All", the chip sends the green input signal to all output pins that have the same number as the red input signal. Again, all other output pins are set to 0.

Set Tags

The set tags chip can add or remove tags to or from an object.   

Chips set tag

Inputs:

Pin Label Range Description
Red Object ID A valid object ID The object ID of the object which should have a tag added, removed, or set to defaults.

Outputs:

Pin Label Range Description
Red Object ID A valid object ID If successful, the object ID of the relevant object. Otherwise 0.

Settings:

Name Label Values Description
Mode Mode - Change Tags on Object Add, Remove, Defaults Add: adds the specified tag to the object. Remove: removes the specified tag from the object. Defaults: restores the default tags.
Tag Tag Any valid tag text Specifies the tag that should be added or removed.


SFX

Circuit 01

When the input receives a True signal, the sound effect set is played. You can change the sound effect played by using edit mode of the maker pen. The sounds effects available are:

Blue Scores Red Scores Blue Wins Red Wins
Tie Game Goal Hit Buzzer
Game Over Bell Revive Ding Score
Whistle Whistle down Whistle up Ding ding!
Sparkle Subsonic boom Golf clap Snare drum
Horn Beep Explosion Boot up
Thud Splash Rez in


Timer

08- Timer node

Timer chips can be used in countdown or looping countdown mode. The red input pin is an on/off switch; the timer must be held in an “on” state to operate. Thus, a button press, which only sends a momentary signal, cannot run a timer on its own. Inputs:

Pin Label Range Description
Red On/Off Boolean Turns the timer on or off. The timer is running while the input is true, and paused otherwise.
Green Duration In 0.1 seconds Determines how long the timer will run, e.g. 50 for 5 seconds. Changing the input will result in a reset.
Reset Reset Boolean Resets the timer. It will take the full duration specified by the green input to run.

Outputs:

Pin Label Range Description
Red Signal Boolean Outputs true for a single tick when the timer expires.
Green Remaining Seconds Outputs the remaining seconds until the timer expires.

Settings:

Name Label Values Description
Mode Looping Timer Node Looping, Countdown Looping: The timer will reset automatically when the timer expires. This is the same as connecting the red output to the reset input.

Countdown: The timer has to be reset manually (reset input).