You are using an unsupported browser. Please update your browser to the latest version on or before July 31, 2020.
close
For forgotten passwords, email changes, and account settings, go to rec.net!
announcement close button
Variables and Value Types print icon

See the Variable chips article in the Chips reference guide for information about each of the variable chips.

 

Value Types

  • Types are the kinds of values used by a Circuits V2 graph.

  • Integer numbers (0, 1, 2, 3, etc.) are called ints and are represented by the color green.

  • Decimal numbers (0.0, 1.1, 1.5, .50) are called floats and are represented by the color blue.

  • “True” or “false” values are called bools and are represented by the color red.

  • Text values are called strings and are represented by the color purple.

  • Most other Types, like players, are represented by the color yellow. We will provide ways to differentiate these in the future.

  • Only inputs and outputs of compatible Types can be connected to each other.

  • Some empty ports can have their default values configured by clicking the port with the Wire tool.

  • Execution is a special Type which guides execution through a Circuits V2 graph.

  • Execution pins are orange arrows.

  • Execution flows from left to right.

  • Some chips have multiple Execution outputs which allows them to modify execution flow.

  • Lists are a special Type which represents a sequence of values.

  • Lists are represented with a “[]” icon on their port.

  • Individual items in a List can be accessed with the “Get Element” chip.

  • The number of elements in a List can be accessed through the “List Get” chip.

  • White ports are a special kind of Type called a “union”, which means they accept many different Types of values. An “Add” chip, for example, may add floats or ints depending on what you connect to it.

  • When you connect to a union port the chip will resolve the actual Type of the ports and recolor them automatically.


Variables

  • Variables are chips which can store and return values.

  • Variables can be accessed by connecting the output directly to another chip.

  • Variables can be set by connecting the output to a “Set Value” chip.

  • Instance variables only store values on the machine a variable is set on.

  • If a graph sets a variable on your machine but not on other player’s machines, you may each have different values in the variable. To synchronize variables between players look at the Synchronization section below.

  • Unlike in normal programming, variables do not reset their value when execution exits a node. They maintain their value until set again or the room is reloaded.

Feedback
1 out of 2 found this helpful

scroll to top icon