Logic: Difference between revisions
From Wubbypedia
Content deleted Content added
Created page with "== Input == Input parts are blocks that cannot be connected to in wiring, only connect to. The Input tab is clearly separated from the Special tab, as the line between them is thicker. <tabs> <tab name="Block Touch Detector"> 250px This block is triggered when another block touches it </tab> <tab name="Click Block"> 250px This block is triggered when a player clicks it </tab> <tab name="Frame Loop B..." |
Changed the words of some Logic stuff, added COLOR BUILD, COLOR OPERATION Block and BREAK Gate |
||
(18 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{WIP|Missing previews and more}}{{Warning|This page explains advanced features, some players may not understand everything in this page.}} |
|||
Wubby Logic is the second-most important thing in your Wubby worlds, They can do mostly anything such as: |
|||
* Changing block colors |
|||
* Moving blocks / platforms |
|||
* Custom NPC movement |
|||
Here are some useful links for wiring:<br> |
|||
[https://easings.net/ Easings.net] | Contains most easing types with directions. |
|||
== Input == |
== Input == |
||
{{Notice|Using a parallel wiring block helps reduce the chances of these blocks not firing correctly.}} |
|||
Input parts are blocks that cannot be connected to in wiring, only connect to. The Input tab is clearly separated from the Special tab, as the line between them is thicker. |
Input parts are blocks that cannot be connected to in wiring, only connect to. The Input tab is clearly separated from the Special tab, as the line between them is thicker. |
||
These are blocks that are used to power wiring systems. They do not receive wiring inputs, and can only output. |
|||
<tabs> |
<tabs> |
||
<tab name="Block Touch Detector"> |
<tab name="Block Touch Detector">[[File:Block_touch_detectorpreview.png|300px]]<br> |
||
Emits a signal when touched by an unanchored block or gear debris.<br> |
|||
<tab name="Click Block"> [[File:Click_blockpreview.png|250px]] This block is triggered when a player clicks it </tab> |
|||
<span style="color:#72aacc;">Output: The part that touched it.</span><br> |
|||
<tab name="Frame Loop Block"> {{Notice|This block is Admin+.}}[[File:Frame_loop_blockpreview.png|250px]] </tab> |
|||
Configurations:<br> |
|||
<tab name="Humanoid State Block"> [[File:Humanoid_state_blockpreview.png|250px]] </tab> |
|||
* Activation Time: How long it activates for. Default is 1<br> |
|||
<tab name="Key Input Block"> [[File:Key_input_blockpreview.png|250px]] </tab> |
|||
* Anchor Type: Decides what blocks get detected. Default is NonAnchored<br> |
|||
<tab name="NPC Event Block"> [[File:Npc_event_blockpreview.png|250px]] </tab> |
|||
* Color To Filter: When filter color is true, only blocks with this color will trigger it. Default is pearl.<br> |
|||
<tab name="Player Chatted Block"> [[File:Player_chatted_blockpreview.png|250px]] </tab> |
|||
* Filter Color: Whether if this block will only trigger when a block with the specified color touches it. Default is false.<br> |
|||
<tab name="Player Event Block"> [[File:player_event_blockpreview.png|250px]] </tab> |
|||
* Use Activation Time: If set to true, the block will stop outputting when (Activation Time) passed, if set to false, it will stop outputting when the block stops touching it. Default is true. |
|||
<tab name="Player Touch Detector"> [[File:Player_touch_detectorpreview.png|250px]] </tab> |
|||
* Reverse Output: When it was turned on, It outputs the Block itself instead of the Block that it detected</tab> |
|||
<tab name="Prompt Block"> [[File:Prompt_blockpreview.png|250px]] </tab> |
|||
<tab name=" |
<tab name="Click Block">[[File:Click_blockpreview.png|300px]] |
||
Emits a signal when clicked on.<br> |
|||
<tab name="Tap Input Block"> [[File:Tap_input_blockpreview.png|250px]] </tab> |
|||
<span style="color:#72aacc;">Output: The player that clicked it.</span><br> |
|||
Configurations:<br> |
|||
* Activation Time: How long it activates for. Default is 1.<br> |
|||
* Max Distance: How far you can click this block. Default is 32.<br> |
|||
* Toggleable: Whether if this block acts like a switch. Default is true.</tab> |
|||
<tab name="Frame Loop Block">{{Notice|This block is Admin+.}}[[File:Frame_loop_blockpreview.png|300px]]<br> |
|||
Emits a signal everytime the server calculates a physics frame.<br> |
|||
<span style="color:#72aacc;">Output: the deltaTime between the frames.</span><br> |
|||
{{Notice|deltaTime is the time (in milliseconds) the server took calculating a physics frame.}}</tab> |
|||
<tab name="Humanoid State Block">[[File:Humanoid_state_blockpreview.png|300px]]<br> |
|||
Emits a signal when a humanoid changes to the specified state.<br> |
|||
<span style="color:#72aacc;">Output: The player's username.</span><br> |
|||
Configurations:<br> |
|||
* Activation Time: How long it activates for. Default is 1.<br> |
|||
* State: The block fires when a humanoid enters this state. Default is Landed.<br> |
|||
* Use Activation Time: If this is off, then the block will only stop firing once the humanoid exits the state. Default is true. </tab> |
|||
<tab name="Key Input Block">[[File:Key_input_blockpreview.png|300px]]<br> |
|||
Emits a signal when a player presses the selected key or mobile button.<br> |
|||
<span style="color:#72aacc;">Output: The player's username.</span><br> |
|||
Configurations:<br> |
|||
* Activation Time: How long it activates for. Default is 1.<br> |
|||
* Input Detection Type: Determines if the block will fire if the input ended, or started.<br> |
|||
* Use Activation Time: When this is off, the block will only stop firing once the player releases the key. This can only be turned off if the "Input Detection Type" is set to "InputStarted", otherwise this setting will be forced.<br> |
|||
* Key: The key which the player has to press/release to trigger the block. Default is LeftShift.<br> |
|||
* Mobile Button Enabled: If this is on, touchscreen players will get a button on their screen that activates the block. |
|||
* Mobile Button Position: The [https://create.roblox.com/docs/reference/engine/datatypes/UDim2 UDIM2] position (possibly scale) of the mobile button on a players screen if "Mobile Button Enabled" is on.<br> |
|||
* Mobile Button Text: What the text on the block's mobile button will be if "Mobile Button Enabled" is on.</tab> |
|||
<tab name="NPC Event Block">[[File:Npc_event_blockpreview.png|300px]]<br> |
|||
Emits a signal once an NPC does the selected NPC event.<br> |
|||
<span style="color:#72aacc;">Output: The NPC's NPC Block.</span><br> |
|||
Configurations:<br> |
|||
* Activation Time: How long it activates for. Default is 1.<br> |
|||
* Event: The NPC Event to detect. |
|||
All NPC events |
|||
* NPCDied - Triggers when a NPC dies.<br> |
|||
* NPCRespawned - Triggers when a NPC respawns.<br> |
|||
* NPCWasAttacked- Triggers when a NPC was attacked by another NPC or player.<br> |
|||
* NPCAttacking - Triggers when a NPC harmed another NPC or player. |
|||
* NPCWasKilled- Triggers when a NPC was killed by another NPC or player.<br> |
|||
* NPCKilling- Triggers when a NPC killed another NPC or player.<br> |
|||
* NPCFocusChanged- Triggers when a NPC changed it's focus another NPC or player.<br> |
|||
* NPCPathReached- Triggers when a NPC reached it's path.</tab> |
|||
<tab name="Player Chatted Block">[[File:Player_chatted_blockpreview.png|300px]]<br> |
|||
Emits a signal every time a player chats.<br> |
|||
<span style="color:#72aacc;">Output: Either the player's username or what they said depending on the "Output Type" setting.</span><br> |
|||
Configurations:<br> |
|||
* Activation Time: How long it activates for. Default is 1.<br> |
|||
* Output Type: Determines if the block will output the players chat message or their username when its fired. Default is "Message".</tab> |
|||
<tab name="Player Event Block">[[File:Player_event_blockpreview.png|300px]]<br> |
|||
Emits a signal when the selected player event is triggered.<br> |
|||
<span style="color:#72aacc;">Output: The player's username.</span><br> |
|||
Configurations:<br> |
|||
* Activation Time: How long it activates for. Default is 1.<br> |
|||
* Event: The Player Event to detect. |
|||
All player events |
|||
* PlayerJoined - Triggers when a player joins the world.<br> |
|||
* PlayerLeft - Triggers when a player leaves the world.<br> |
|||
* PlayerRespawned - Triggers when a player respawns.<br> |
|||
* PlayerKills - Triggers when a player kills another player. |
|||
* PlayerRespawned - Triggers when a player has joined the world through a warp with warp infomation.<br> |
|||
* HealthChanged - Triggers when a player's health changes.<br> </tab> |
|||
<tab name="Player Touch Detector">[[File:Player_touch_detectorpreview.png|300px]]<br> |
|||
Emits a signal when a Player/NPC touches this block.<br> |
|||
<span style="color:#72aacc;">Output: The player's username. (If Detect is set to "NPC" it always outputs the NPC Block)</span><br> |
|||
Configurations:<br> |
|||
* Activation Time: How long it activates for. Default is 1.<br> |
|||
* Detect: A dropdown menu with the items: Players, NPCs, Everything.<br> |
|||
* Use Activation Time: When this is off, the block will only stop firing once the Player/NPC stops touching the block. |
|||
* Reverse Output: When it was turned on, It outputs the Block itself instead of the NPC that it detected</tab> |
|||
<tab name="Prompt Block">[[File:Prompt_blockpreview.png|300px]]<br> |
|||
Emits a signal when it's Proximity Prompt has been triggered.<br> |
|||
<span style="color:#72aacc;">Output: The player's username.</span><br> |
|||
Configurations: |
|||
* Activation Time: How long it activates for. Default is 1. |
|||
* Hold Duration: Amount of time to trigger the prompt. Default is 0.5 |
|||
* Key: Key to hold when triggering the prompt. Default is E. |
|||
* Toggleable: Whether if this block acts like a switch. Default is true.</tab> |
|||
<tab name="Shop Event Block">[[File:Shop_event_blockpreview.png|300px]]<br> |
|||
Emits a signal when the specified item name is bought.<br> |
|||
<span style="color:#72aacc;">Output: The player's username.</span><br> |
|||
Configurations: |
|||
* Activation Time: How long it activates for. Default is 1. |
|||
* Item Name: The item to detect a purchase on.</tab> |
|||
<tab name="Tap Input Block">[[File:Tap_input_blockpreview.png|300px]]<br> |
|||
Emits a signal when a player presses a mouse button.<br> |
|||
<span style="color:#72aacc;">Output: The player's username.</span><br> |
|||
Configurations: |
|||
* Activation Time: How long it activates for. Default is 1. |
|||
* Input Detection Type: Determines if the block will fire if the input ended, or started. |
|||
* Key: What mouse button is being interacted with. |
|||
* Use Activation Time: When this is off, the block will only stop firing once the Player stops giving inputs. (Will be turned On if Input Detection Type is "InputEnded")</tab> |
|||
</tabs> |
|||
== Logic == |
|||
These are blocks that allow a player with building permissions to add extra functionality to their world, these examples include: |
|||
* A simple Counter |
|||
* A Typewriter |
|||
and etc. |
|||
{{Notice|An input is where the gate recieves a signal from a wire connected to it. |
|||
An output is where the gate sends a signal to a wire connected from it.<br> |
|||
"true" <nowiki>=</nowiki> active signal<br> |
|||
"false" <nowiki>=</nowiki> inactive signal<br> |
|||
This is known as a bool |
|||
}}{{Warning|Gate descriptions are in-progress and may be incorrect, if you find any incorrect circuits please use the [https://forms.gle/6xHi97X7ANGGK28B6 wiki feedback form].}} |
|||
<tabs> |
|||
<tab name="AND Gate">Input whether if two or more signals are active. <span style="color:gray;">(they do not check if the values are the same)</span> |
|||
<span style="color:#72aacc;">Input: 2 values (any)<br> |
|||
Output: Bool</span> |
|||
</tab> |
|||
<tab name="BOOL SETTER Gate">Sets a BOOL STORAGE to the set bool value. |
|||
<span style="color:#72aacc;">Input: none<br> |
|||
Output: none</span> |
|||
* Value: The Bool Value to set a BOOL STORAGE to either True or False.</tab> |
|||
<tab name="BOOL STORAGE Gate>Stores a bool value |
|||
<span style="color:#72aacc;">Input: none<br> |
|||
Output: Stored Value</span> |
|||
* Delay Before Output: Seconds to wait before outputting. |
|||
* Save Value: ??? (presumably decides whether value is saved on world restart) |
|||
* Value: The stored value.</tab> |
|||
<tab name="BOOL SWITCH Gate">Switches the value of a BOOL STORAGE Gate (false becomes true and vice versa) |
|||
<span style="color:#72aacc;">Input: none<br> |
|||
Output: none</span> |
|||
</tab> |
|||
<tab name="BREAK VECTOR Block">Breaks a vector to a singular vector or Breaks it into Unit or magnitude |
|||
* X: The X Axis of the Vector3 |
|||
* Y: The Y Axis of the Vector3 |
|||
* Z: The Z Axis of the Vector3 |
|||
* Magnitude: Length of a Vector3 |
|||
* Unit: Length of a Vector3 but in between 1 and -1 |
|||
Roblox link about [https://create.roblox.com/docs/reference/engine/datatypes/Vector3 Vector3]<br> |
|||
<span style="color:#72aacc;">Input: Vector3<br> |
|||
Output: Number (none if Input is not a vector3)</span> |
|||
* Axis: The axis to get from the input.</tab> |
|||
<tab name="BUILD VECTOR Block">Combines the X, Y, and Z Properties to form a Vector3. |
|||
<span style="color:#72aacc;">Input: any (Number if gate uses {INPUT})<br> |
|||
Output: Vector3</tab> |
|||
<tab name="CHANGE SIGNAL Block">{{Notice|The Property can be changed in the "Types" Tab in Properties}} |
|||
Changes the signal into the selected property.<br> |
|||
<span style="color:#72aacc;">Input: any if input is the same property type with the selected property<br> |
|||
Output: any</span> |
|||
* Selected Property: The property type to change into. |
|||
Destination: The block to get the properties from</tab> |
|||
<tab name="DELAY Gate">Delays the signal by X seconds. (equivalent of <code>wait()</code>) |
|||
<span style="color:#72aacc;">Input: any<br> |
|||
Output: any (same as Input)</span> |
|||
* Delay: The amount of time to delay. |
|||
* Ignore Deactivation: Determines if the gate will stop its signal when the previous gate stopped sending its signal</tab> |
|||
<tab name="GET BLOCK PROPERTY">Gets a property of the specified block. |
|||
<span style="color:#72aacc;">Input: any (Block if Destination is not set)<br> |
|||
Output: any (The type of the retrieved property)</span> |
|||
* Property Name: The property to retrieve. |
|||
* Destination: The block to get the properties from.</tab> |
|||
<tab name="GET GAME PROPERTY Gate">[[File:GetGamePropertypreview.png|300px]] |
|||
Gets a property of the world. |
|||
<span style="color:#72aacc;">Input: any (Type Needed Differs)<br> |
|||
Output: any (The type of the retrieved property)</span> |
|||
* Property Name: The property to retrieve. |
|||
* Value: ?? |
|||
Depending on the chosen property the Input may need to be a specific type. |
|||
* NumPlayersOnTeam: Requires a team name as input. |
|||
* IsPlayerOnServer: Requires a username as input. |
|||
* TotalColoredBlocks: Requires a color as input.</tab> |
|||
<tab name="GET NPC PROPERTY Gate">[[File:GetNPCPropertypreview.png|300px]] |
|||
Gets a property of the specified NPC Block. |
|||
<span style="color:#72aacc;">Input: any (NPC Block if no Destination is set)<br> |
|||
Output: any (The type of the retrieved property)</span> |
|||
* Property Name: The property to retrieve. |
|||
* Destination: The NPC Block to get the properties from.</tab> |
|||
<tab name="GET PLAYER PROPERTY Gate">[[File:GetPlayerPropertyPreview.png|300px]] |
|||
Gets a property of the specified player.<br> |
|||
<span style="color:#72aacc;">Input: Player Username<br> |
|||
Output: any (The type of the retrieved property)</span> |
|||
* Property Name: The property to retrieve. |
|||
* Property Name: The advanced property to retrieve, it is only use for Body Color.</tab> |
|||
<tab name="GET STAT Gate">[[File:GetStatpreview.png|300px]] |
|||
Gets the stat of the specified player.<br> |
|||
<span style="color:#72aacc;">Input: Player Username<br> |
|||
Output: Number</span> |
|||
* Stat Name: The stat to retrieve.</tab> |
|||
<tab name="IF Gate">Checks if the inputted value is the same as Value |
|||
<span style="color:#72aacc;">Input: any<br> |
|||
Output: Bool</span> |
|||
* Check Type: How the value is compared. |
|||
* Keep Activation: Determines if the gate will stop its signal when the previous gate stopped sending its signal |
|||
* Value: The value to compare the Input to.</tab> |
|||
<tab name="LOOP THROUGH EVERYONE Gate">When Powered, The gate will loop through every player in the world. |
|||
<span style="color:#72aacc;">Input: any<br> |
|||
Output: Player Username</span> |
|||
* Active Time: How long each loop takes. (seconds) |
|||
* Delay: How long to wait for another loop. (seconds) |
|||
* Loop Type: Determines if it loops through NPCs or Players.</tab> |
|||
<tab name="MATH Gate">Does a math operation on the Input. |
|||
<span style="color:#72aacc;">Input: Number<br> |
|||
Output: Number</span> |
|||
* Math Order: Determines if the Input is before the Value and vice versa. |
|||
* Operation Type: The operation to do. |
|||
* Next Gate Type: Determines if the output needs to go through a NUMBER STORAGE to complete an operation. |
|||
* Disable Output: Determines if a connected NUMBER STORAGE outputs its value after this gate output. |
|||
* Value: The value to calculate the Input with.</tab> |
|||
<tab name="NOT Gate">Inverts or the signal. |
|||
<span style="color:#72aacc;">Input: any<br> |
|||
Output: Signal </span> |
|||
</tab> |
|||
<tab name="NUMBER SETTER Gate">{{Notice|Use <code><minimumNumber></code>, <code><maximumNumber></code> as the value to randomly generate a number between <code><minimumNumber></code> and <code><maximumNumber></code>. |
|||
An example would be creating a Random Number Generator (RNG).}} |
|||
Sets the value of a NUMBER STORAGE Gate<br> |
|||
<span style="color:#72aacc;">Input: any (Number if using Input)<br> |
|||
Output: none</span> |
|||
* Disable Output: Determines if a connected NUMBER STORAGE outputs its value after this gate output. |
|||
* Value: The value to store the NUMBER STORAGE.</tab> |
|||
<tab name="NUMBER STORAGE Gate">Stores a number value. |
|||
<span style="color:#72aacc;">Input: Number<br> |
|||
Output: Number</span> |
|||
* Delay Before Output: Seconds to wait before outputting. |
|||
* Save Value: ??? (presumambly decides whether value is saved on world restart) |
|||
* Value: The stored value.</tab> |
|||
<tab name="OR Gate">{{Notice|This gate will pass any input it receives to its output.}} |
|||
If 1 or more signals are connected to this gate, this gate will fire.<br> |
|||
<span style="color:#72aacc;">Input: any<br> |
|||
Output: any</span> |
|||
</tab> |
|||
<tab name="PLAYER OWNS PASS Gate">[[File:PlayerOwnsPassGatePreview.png|300px]] |
|||
Outputs a signal when a player owns a pass/gear.<br> |
|||
<span style="color:#72aacc;">Input: Pass Name/Gear ID<br> |
|||
Output: Player Username</span> |
|||
* Pass/Gear ID: The pass/gear id used for check if a player has the inputted pass or not.</tab> |
|||
<tab name="REPEATER Gate">Repeatedly sends a signal, How it's sent depends on the loop type. |
|||
* Activation time: how long the signal will last until it loops back again. |
|||
* Delay: how long to wait before the next loop starts |
|||
* Loop Type: How the repeater will behave. |
|||
* Increment: The Increment to use when in enumerating or repetition mode (eg if increment is 2 then the loop would be like 2, 4, 6,...). |
|||
* Start index: the starting number the repeater will use |
|||
* Finish index: the ending number the repeater will use</tab> |
|||
<tab name="SET STAT Gate">[[File:SetStatpreview.png|300px]] |
|||
Sets the stat of the input and outputs the stat's value<br> |
|||
<span style="color:#72aacc;">Input: Player Username<br> |
|||
Output: Number</span> |
|||
* Operation Type: Set, add or subteact the stat value. |
|||
* Stat name: The stat name to set. |
|||
* Value: The new value to set (or add / subtract) the stat.</tab> |
|||
<tab name="TEXT EDITING Gate">[[File:TextEditingGatePreview.png|300px]] |
|||
Sets the value of the connected TEXT STORAGE. |
|||
<span style="color:#72aacc;">Input: any<br> |
|||
Output: none (String if Next Gate Type is Normal)</span> |
|||
* Next Gate Type: Decides if it can go through only a TEXT STORAGE or any gate. |
|||
* Disable Output: Determines if a connected TEXT STORAGE outputs its value after this gate output. |
|||
* Operation Type: Decides what to do with the value. |
|||
* Value: The value to set a TEXT STORAGE to. (Output if Next Gate Type is Normal)</tab> |
|||
<tab name="TEXT INPUT Gate">[[File:TextInputGatePreview.png|300px]] |
|||
Brings up a dialog box on the Input's screen and outputs the response. |
|||
<span style="color:#72aacc;">Input: any<br> |
|||
Output: String</span> |
|||
* Cancel Button Disabled: Decides of if the Cancel / X Button shows up. |
|||
* Input Position: Changes the dialog's position. |
|||
* Input Size: Changes the dialog's size.</tab> |
|||
<tab name="TEXT STORAGE Gate">[[File:TextStorageGatePreview.png|300px]] |
|||
Stores a text value that can be edited using a TEXT EDITING Gate. |
|||
<span style="color:#72aacc;">Input: TEXT EDITING Signal<br> |
|||
Output: String</span> |
|||
* Delay Before Output: Seconds to wait before outputting. |
|||
* Save Value: ??? (presumambly decides whether value is saved on world restart) |
|||
* Value: The stored value.</tab> |
|||
<tab name="TRIPLE MATH Gate">Special variant of the MATH Gate that uses vectors (x, y. z). |
|||
<span style="color:#72aacc;">Input: Number<br> |
|||
Output: Number</span> |
|||
* Operation type: Decides what to do with the X, Y and Z numbers. |
|||
* X: X of the vector. |
|||
* Y: Y of the vector. |
|||
* Z: Z of the vector.</tab> |
|||
<tab name="XOR Gate">Takes multiple signals and produces an output if the number of true inputs are odd. |
|||
<span style="color:#72aacc;">Input: any (Multiple)<br> |
|||
Output: Bool</span> |
|||
</tab><tab name="COLOR BUILD Block">{{Notice|The ColorSpace can be changed in the "Modes" Tab in Properties}} Combines the RGB values into color <span style="color:#72aacc;"><br>Input: Number<br>Output: None</span> |
|||
</tab><tab name="COLOR OPERATIONS Block"> Pick up color inputs and simplify it to it's simplified form.<br> |
|||
*Red: Output Red Value |
|||
*Green: Output Green Value |
|||
*Blue: Output Blue Value |
|||
*Hue: Output Hue Value |
|||
*Saturation: Output Saturation Value |
|||
*Hex: Output Hex Value |
|||
*Brickcolor: Output the closest Brickcolor |
|||
*Value: Output Value Value (Lol) |
|||
<span style="color:#72aacc;">Input: Color (from COLOR BUILD block)<br>Output: Color</span></tab> |
|||
<tab name="BREAK Gate"> Breaks the signal from a Repeater or Frame Loop Block <br><span style="color:#72aacc;">Input: Signal<br>Output: None</span></tab> |
|||
</tabs> |
</tabs> |