User:Moxian/Sandbox2

From Official Barotrauma Wiki
Revision as of 00:52, 24 April 2023 by Moxian (talk | contribs) (→‎Math)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Data is potentially outdated
Last updated for version 0.18.11.0
The current game version is 1.4.5.0
Wiring Components
Crafting
Fabricator
Requirements
Skill: Electrical: 20
Deconstructor Yield
Store
Minimum Difficulty 15%
Base Price 100 mk
Outposts
OutpostOutpost Buy Sell
Habitation OutpostHabitation 100 mk 30 mk
ColonyColony N/A 30 mk
Research OutpostResearch 125 mk 37 mk
Military OutpostMilitary 100 mk 30 mk
Mining OutpostMining 100 mk 30 mk
Medical MerchantMedical Merchant N/A 30 mk
Engineer MerchantEngineer Merchant 90 mk 27 mk
Armory MerchantArmory Merchant N/A 30 mk
Children of The HonkmotherClown Merchant N/A 30 mk
The Church of HuskHusk Merchant N/A 30 mk
Technical
Identifier andcomponent, equalscomponent, greatercomponent, notcomponent, orcomponent, regexcomponent, signalcheckcomponent, xorcomponent, abscomponent, addercomponent, ceilcomponent, dividecomponent, exponentationcomponent, factorialcomponent, floorcomponent, modulocomponent, multiplycomponent, roundcomponent, squarerootcomponent, subtractcomponent, acoscomponent, asincomponent, atancomponent, coscomponent, sincomponent, tancomponent, colorcomponent, concatcomponent, delaycomponent, memorycomponent, oscillator, relaycomponent, wificomponten
Categories Electrical
Tags smallitem, logic

Moxian/Sandbox2 are craftable, placeable items used to automate certain tasks or provide information about various submarine systems.

Controls

  • In-game, Wiring Components can be placed on background walls by "equipping" them in one hand, holding Right Mouseright click, then Left Mouseleft clicking on any empty space on the background wall's grid (see also placing).
    • Placed Wiring Components can be detached from the wall by making sure a Screwdriver is not equipped, equipping a Wrench, and pressing E.
    • Accessing the component's connection panel is done by equipping a Screwdriver and pressing E.
    • For more details on wiring mechanics, see Wiring Interface.
  • In the Submarine Editor, Wiring Mode is enabled by clicking the corresponding button to the top-right or pressing Ctrl+2.
    • From there, the same commands as in-game apply, although the Editor allows access to all components and wires, as well as many other customization features.
    • For more details, see Submarine Editor#wiring.

Logic

And, Or, Xor Components

And Component "Sends a signal when both inputs receive a signal within a set period of each other."

Or Component "Sends a signal if either of the inputs receives a signal."

Xor Component "Sends a signal if either of the inputs, but not both, receives a signal."

These three basic logical components have identical wiring and interaction interface:

Connection Panel for Moxian/Sandbox2
Hover over pins to see their descriptions.
Signal_In_1
Signal_In_2
Set_Output
The input of the first signal.
The input of the second signal.
Sets the "true" output.
Signal_Out
The output of the component.
Requires: Screwdriver

In addition to the wires, interacting with the component (by clicking on them) allows one to configure "Timeframe", "Output" and "False output" values.

The signal sent through the SIGNAL_OUT wire depends on the signals received on the SIGNAL_IN_1 and SIGNAL_IN_2 wires in the following way:

Truth Table
Input Output
SIGNAL_IN_1 SIGNAL_IN_2 AND Output OR Output XOR Output
0 0 F F F
0 1 F T T
1 0 F T T
1 1 T T F


Here "1" denotes any input, "0" denotes a blank or zero input; "T" denotes the value configured as "Output" in the interface, and "F" denotes the value configured as "False output". Note that by default "T" is set to "1", and "F" is set to blank (and NOT "0")!

Receiving any non-blank value on the SET_OTPUT wire would set the "Output" setting in the interface to that.

There is no way to programmatically change "False output" setting.

The "Timeframe" setting has the following in-game description for all three components:

The item sends the output if both inputs have received a non-zero signal within the timeframe. If set to 0, the inputs must receive a signal at the same time.

However, as of 1.0.9.0 it does not work as advertized.

Instead:

  • No matter the "Timeframe" value, whenever the wiring component receives input signals that would induce a True output - such True output is sent out immediately
  • Whenever the wiring component stops receiving input signals that induce a True output (i.e. the output is to change from True to False) - the True output is retained for "Timeframe" seconds before changing to False
    • Xor component behaves exceptionally - the switch from (1 0) or (0 1) input to (0 0) retains the True output for Timeframe seconds, but the switch from (1 0) or (0 1) to (1 1) sets the output to False immediately


Equals Component

"Sends a signal when both inputs receive the same signal."

The Equals Component is an electrical component used to check if both inputs are the same.


Connection Panel for Moxian/Sandbox2
Hover over pins to see their descriptions.
Signal_In_1
Signal_In_2
set_output
The input of the first signal.
The input of the second signal.
The input for setting the signal that will be output if the conditions are met.
Signal_Out
The output of the component.
Requires: Screwdriver
  • If one (but not the other) input becomes empty, then the output will maintain its last value indefinitely (until either the second input becomes empty, or the first becomes non-empty)
  • If both inputs become empty, then the output becomes empty as well after "Timeframe" seconds.

Greater Component

"Sends a signal if the value the signal_in1 input is larger than the signal_in2 input."

The Greater Component is an electrical component used to check if one input is higher than the other.


Connection Panel for Moxian/Sandbox2
Hover over pins to see their descriptions.
Signal_In_1
Signal_In_2
set_output
The input of the first signal.
The input of the second signal.
The input for setting the signal that will be output if the conditions are met.
Signal_Out
The output of the component.
Requires: Screwdriver

Not Component

"Sends a signal when the input is NOT receiving a signal."

The Not Component is an electrical component used to invert a signal.


Connection Panel for Moxian/Sandbox2
Hover over pins to see their descriptions.
Signal_In
The input signal.
Signal_Out
The output of the component.
Requires: Screwdriver

"1" denotes any input, "0" denotes a blank or zero input

Truth Table
Input Output
0 1
1 0


RegEx Find Component

"Sends a signal if the received signal matches a specific regular expression pattern."

The RegEx Find Component is an electrical component used to match an exact string.

It is most commonly used with a Terminal.

Click <color="red">FIXME</color> for a tutorial on regular expressions. Click <color="red">FIXME</color> to create/test regular expressions.


Connection Panel for Moxian/Sandbox2
Hover over pins to see their descriptions.
Signal_In
set_output
The input signal.
The input for setting the signal that will be output if the conditions are met.
Signal_Out
The output of the component.
Requires: Screwdriver

Signal Check Component

"Sends a signal when a signal matching a specific value is received."

The Signal Check Component is an electrical component used to check if the received signal matches a target signal.

Operates like an IF-THEN-ELSE statement, if the signal input matches the target the output is sent. Otherwise the false output is sent.

  • It is important to note that only the true output can be changed externally using SET_OUTPUT.

This is typically used to switch between an normal state and an override state.


Connection Panel for Moxian/Sandbox2
Hover over pins to see their descriptions.
Signal_In
Set_Output
Set_Targetsignal
The input signal.
Sets the "true" output.
Sets the signal that must be matched to. (Optional, can be set in editor)
Signal_Out
The output of the component.
Requires: Screwdriver

Math

Abs Component "Outputs the absolute value of the input."

Adder Component "Outputs the sum of the received signals."

Ceil Component "Transforms a given float input into the closest integer, rounding up."

Divide Component "Outputs the divided value of the received signals."

Exponentiation Component "Outputs the input raised to a given power."

Factorial Component "Outputs the factorial of the input."

Floor Component "Transforms a given float input into the closest integer, rounding down."

Modulo Component "Outputs the remainder when the input is divided by a specific number."

Multiply Component "Outputs the product of the received signals."

Round Component "Rounds a numerical input to the nearest integer value."

Square Root Component "Outputs the square root of the input."

Subtract Component "Outputs the subtracted value of the received signals."

Trigonometry

Acos Component

"Outputs the angle whose cosine is equal to the input."

The Acos Component is an electrical component that performs the inverse cosine function; cos-1(x).


Connection Panel for Moxian/Sandbox2
Hover over pins to see their descriptions.
Signal_In
The input signal.
Signal_Out
The output of the component.
Requires: Screwdriver

Asin Component

"Outputs the angle whose sine is equal to the input."

The Asin Component is an electrical component that performs the inverse sine function; sin-1(x).


Connection Panel for Moxian/Sandbox2
Hover over pins to see their descriptions.
Signal_In
The input signal.
Signal_Out
The output of the component.
Requires: Screwdriver

Atan Component

"Outputs the angle whose tangent is equal to the input. If the "signal_in_x" and "signal_in_y" connections are used, the input is interpreted as a vector and the angle calculated using Atan2."

The Atan Component is an electrical component that performs the inverse tan function; tan-1(x).


Connection Panel for Moxian/Sandbox2
Hover over pins to see their descriptions.
Signal_In
Signal_In_X
Signal_In_Y
The input signal.
The input of the X signal.
The input of the Y signal.
Signal_Out
The output of the component.
Requires: Screwdriver

Cos Component

"Outputs the cosine of the input."

The Cos Component is an electrical component that performs the cosine function; cos(x).


Connection Panel for Moxian/Sandbox2
Hover over pins to see their descriptions.
Signal_In
The input signal.
Signal_Out
The output of the component.
Requires: Screwdriver

Sin Component

"Outputs the sine of the input."

The Sin Component is an electrical component that performs the sine function; sin(x).


Connection Panel for Moxian/Sandbox2
Hover over pins to see their descriptions.
Signal_In
The input signal.
Signal_Out
The output of the component.
Requires: Screwdriver

Tan Component

"Outputs the tangent of the input."

The Tan Component is an electrical component that performs the tangent function; tan(x).


Connection Panel for Moxian/Sandbox2
Hover over pins to see their descriptions.
Signal_In
The input signal.
Signal_Out
The output of the component.
Requires: Screwdriver

Misc

Color Component

"Outputs a combined color signal for light control."

The Color Component is an electrical component used to provide a color signal for lamps/lights.

It is most commonly used in tandem with Light Components for easily changeable lighting.


Connection Panel for Moxian/Sandbox2
Hover over pins to see their descriptions.
Signal_R
Signal_G
Signal_B
Signal_A
The brightness of the red channel.
The brightness of the green channel.
The brightness of the blue channel.
The transparency of the alpha channel.
Signal_Out
The combined color signal.
Requires: Screwdriver

Concatenation Component

"Joins the inputs together and outputs the joined value (for example, the inputs "mud" and "raptor" would output "mudraptor")."

Connection Panel for Moxian/Sandbox2
Hover over pins to see their descriptions.
Signal_In_1
Signal_In_2
Input of the first signal.
Input of the second signal.
Signal_Out
The joined value.
Requires: Screwdriver

Delay Component

"Delays all received signals for a specific amount of time."

The Delay Component is an electrical component used to delay a signal for a short amount of time.

It is most commonly used in tandem with Terminals for custom commands.


Connection Panel for Moxian/Sandbox2
Hover over pins to see their descriptions.
Signal_In
set_delay
The signal to be delayed.
The delay duration, in seconds.
Signal_Out
The delayed signal.
Requires: Screwdriver

Memory Component

"Outputs a stored value that can be updated from other sources. Use the signal_in connection to set the stored value, and the lock_state input to toggle whether the received signals should be stored."

The Memory Component is an electrical component used to store signals for later use.


Connection Panel for Moxian/Sandbox2
Hover over pins to see their descriptions.
Signal_In
LOCK_STATE
The signal to be stored
Sets whether signals will be stored (1=yes, 0=no)
Signal_Out
The currently stored signal
Requires: Screwdriver

Oscillator Component

"Sends out a periodic, oscillating signal."

The Oscillator is an electrical component used to provide a signal that changes over time.

  • Frequency is in Hertz (Hz), 1 Hz is once per second, 0.5 Hz is once every 2 seconds and so on.
  • The wave type may be set on the component by sending a number into set_outputtype.
Input Wave Description
0 Pulse periodically sends out a signal of 1.
1 Sawtooth sends out a periodic wave that increases linearly from 0 to 1.
2 Sine sends out a sine wave oscillating between -1 and 1.
3 Square sends out a signal that alternates between 0 and 1
4 Triangle sends out a wave that alternates between increasing linearly from -1 to 1 and decreasing from 1 to -1.
Connection Panel for Moxian/Sandbox2
Hover over pins to see their descriptions.
Set_Frequency
Set_Outputtype
Sets the frequency of the oscillator, in Hz (Hertz).
Sets the output type of the oscillator (0=pulse, 1=sine, 2=square).
Signal_Out
The output of the component.
Requires: Screwdriver

Relay Component

"When switched on, forwards all received signals from the input connections to the outputs."

The Relay Component is an electrical component used to disconnect power or signals from a circuit.

In-game, a relay may only pass a maximum of 1000 kW however in the Submarine Editor this can be adjusted.

It is most commonly used for providing toggleable power to lights or duplicating signals.

When switched off (State = 0) the Relay Component does not transfer power via the power_out pin.


Connection Panel for Moxian/Sandbox2
Hover over pins to see their descriptions.
Power_In
Signal_In_1
Signal_In_2
Toggle_State
Set_State
Power input from a power network.
The input of the first signal.
The input of the second signal.
Toggles the state on any signal.
Sets the state of the Relay. (0 = Off, all other signals = On)
Power_Out
Signal_Out_1
Signal_Out_2
State_Out
Load_Value_Out
Power_Value_Out
Power output to a power network.
The output of the first signal.
The output of the second signal.
The current state of the relay.
Outputs the current load level as a number (required power).
Outputs the current power level as a number (supplied power).
Requires: Screwdriver

Wifi Component

"Allows remote communication between other wifi components that are using the same channel."

The Wifi Component is an electrical component used to transfer signals over long distances.

It can also be linked to radio chat, forwarding text messages from players to the signal_out pin and printing values sent to the signal_in pin into radio chat.

When printing messages to radio chat, the name of the connected component (eg "Memory Component") is displayed as the author of the message.


Connection Panel for Moxian/Sandbox2
Hover over pins to see their descriptions.
Signal_In
Set_Channel
The signal to be transmitted.
Sets the current wifi channel.
Signal_Out
The recieved signal.
Requires: Screwdriver
v·d·e·h
Electrical Components
Alarms
Detectors
Interactable
Wiring Components
Misc