Logic: Difference between revisions

From Wubbypedia
Content deleted Content added
m Made blue colour more suitable for dark mode.
Changed the words of some Logic stuff, added COLOR BUILD, COLOR OPERATION Block and BREAK Gate
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{WIP}}{{Warning|This page explains advanced features, some players may not understand everything in this page.}}
{{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:
Wubby Logic is the second-most important thing in your Wubby worlds, They can do mostly anything such as:
Line 22: Line 22:
* Color To Filter: When filter color is true, only blocks with this color will trigger it. Default is pearl.<br>
* Color To Filter: When filter color is true, only blocks with this color will trigger it. Default is pearl.<br>
* Filter Color: Whether if this block will only trigger when a block with the specified color touches it. Default is false.<br>
* Filter Color: Whether if this block will only trigger when a block with the specified color touches it. Default is false.<br>
* 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>
* 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.
* Reverse Output: When it was turned on, It outputs the Block itself instead of the Block that it detected</tab>
<tab name="Click Block">[[File:Click_blockpreview.png|300px]]
<tab name="Click Block">[[File:Click_blockpreview.png|300px]]
Emits a signal when clicked on.<br>
Emits a signal when clicked on.<br>
Line 57: Line 58:
Configurations:<br>
Configurations:<br>
* Activation Time: How long it activates for. Default is 1.<br>
* Activation Time: How long it activates for. Default is 1.<br>
* Event: The NPC Event to detect.</tab>
* 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>
<tab name="Player Chatted Block">[[File:Player_chatted_blockpreview.png|300px]]<br>
Emits a signal every time a player chats.<br>
Emits a signal every time a player chats.<br>
Line 71: Line 81:
* Event: The Player Event to detect.
* Event: The Player Event to detect.
All player events
All player events
* PlayerJoined - Triggers when a player joins the world<br>
* PlayerJoined - Triggers when a player joins the world.<br>
* PlayerLeft - Triggers when a player leaves the world<br>
* PlayerLeft - Triggers when a player leaves the world.<br>
* PlayerRespawned - Triggers when a player respawns<br>
* PlayerRespawned - Triggers when a player respawns.<br>
* PlayerKills - Triggers when a player kills another player</tab>
* 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>
<tab name="Player Touch Detector">[[File:Player_touch_detectorpreview.png|300px]]<br>
Emits a signal when a Player/NPC touches this block.<br>
Emits a signal when a Player/NPC touches this block.<br>
Line 81: Line 93:
* Activation Time: How long it activates for. Default is 1.<br>
* Activation Time: How long it activates for. Default is 1.<br>
* Detect: A dropdown menu with the items: Players, NPCs, Everything.<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.</tab>
* 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>
<tab name="Prompt Block">[[File:Prompt_blockpreview.png|300px]]<br>
Emits a signal when it's Proximity Prompt has been triggered.<br>
Emits a signal when it's Proximity Prompt has been triggered.<br>
Line 106: Line 119:
</tabs>
</tabs>
== Logic ==
== Logic ==
These are blocks that allow a player with build permissions to add extra functionality to their world, these examples include:
These are blocks that allow a player with building permissions to add extra functionality to their world, these examples include:


* A simple Counter
* Ctrl to sprint
* A Typewriter
* E to activate ability


and etc.
and etc.
Line 120: Line 133:


This is known as a bool
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/8szUe2x9H9t8gfYq7 wiki feedback form].}}
}}{{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>
<tabs>
<tab name="AND Gate">Checks whether if both inputs are active. <span style="color:gray;">(they do not check if the values are the same)</span>
<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>
<span style="color:#72aacc;">Input: 2 values (any)<br>
Output: Bool</span>
Output: Bool</span>
Line 129: Line 142:
<span style="color:#72aacc;">Input: none<br>
<span style="color:#72aacc;">Input: none<br>
Output: none</span>
Output: none</span>
* Value: The Bool Value to set a BOOL STORAGE to.</tab>
* Value: The Bool Value to set a BOOL STORAGE to either True or False.</tab>
<tab name="BOOL STORAGE Gate>Stores a bool value
<tab name="BOOL STORAGE Gate>Stores a bool value
<span style="color:#72aacc;">Input: Bool<br>
<span style="color:#72aacc;">Input: none<br>
Output: Stored Value</span>
Output: Stored Value</span>
* Delay Before Output: Seconds to wait before outputting.
* Delay Before Output: Seconds to wait before outputting.
* Save Value: ??? (presumably decides whether value is saved on world restart)
* Save Value: ??? (presumably decides whether value is saved on world restart)
* Value: The stored value.</tab>
* Value: The stored value.</tab>
<tab name="BOOL SWITCH Gate">Inverts / Switches the value of a BOOL STORAGE Gate (false becomes true and vice versa)
<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>
<span style="color:#72aacc;">Input: none<br>
Output: none</span>
Output: none</span>
</tab>
</tab>
<tab name="BREAK VECTOR Block">Gets a specified axis of a [https://create.roblox.com/docs/reference/engine/datatypes/Vector3 Vector3]
<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>
<span style="color:#72aacc;">Input: Vector3<br>
Output: Number (none if Input is not a vector3)</span>
Output: Number (none if Input is not a vector3)</span>
Line 146: Line 165:
<tab name="BUILD VECTOR Block">Combines the X, Y, and Z Properties to form a Vector3.
<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>
<span style="color:#72aacc;">Input: any (Number if gate uses {INPUT})<br>
Output: Vector3</span>
Output: Vector3</tab>
* X: The X Axis of the Vector3
* Y: The Y Axis of the Vector3
* Z: The Z Axis of the Vector3</tab>
<tab name="CHANGE SIGNAL Block">{{Notice|The Property can be changed in the "Types" Tab in Properties}}
<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>
Changes the signal into the selected property.<br>
<span style="color:#72aacc;">Input: any (Ignored)<br>
<span style="color:#72aacc;">Input: any if input is the same property type with the selected property<br>
Output: any</span>
Output: any</span>
* Selected Property: The property type to change into.</tab>
* 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>)
<tab name="DELAY Gate">Delays the signal by X seconds. (equivalent of <code>wait()</code>)
<span style="color:#72aacc;">Input: any<br>
<span style="color:#72aacc;">Input: any<br>
Line 165: Line 182:
* Property Name: The property to retrieve.
* Property Name: The property to retrieve.
* Destination: The block to get the properties from.</tab>
* Destination: The block to get the properties from.</tab>
<tab name="GET GAME PROPERTY Gate">Gets a property of the world.
<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>
<span style="color:#72aacc;">Input: any (Type Needed Differs)<br>
Output: any (The type of the retrieved property)</span>
Output: any (The type of the retrieved property)</span>
Line 174: Line 192:
* IsPlayerOnServer: Requires a username as input.
* IsPlayerOnServer: Requires a username as input.
* TotalColoredBlocks: Requires a color as input.</tab>
* TotalColoredBlocks: Requires a color as input.</tab>
<tab name="GET NPC PROPERTY Gate">Gets a property of the specified NPC Block.
<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>
<span style="color:#72aacc;">Input: any (NPC Block if no Destination is set)<br>
Output: any (The type of the retrieved property)</span>
Output: any (The type of the retrieved property)</span>
* Property Name: The property to retrieve.
* Property Name: The property to retrieve.
* Destination: The NPC Block to get the properties from.</tab>
* Destination: The NPC Block to get the properties from.</tab>
<tab name="GET PLAYER PROPERTY Gate">Gets a property of the specified player.
<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>
<span style="color:#72aacc;">Input: Player Username<br>
Output: any (The type of the retrieved property)</span>
Output: any (The type of the retrieved property)</span>
* Property Name: The property to retrieve.</tab>
* 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">Gets the stat of the specified player.
<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>
<span style="color:#72aacc;">Input: Player Username<br>
Output: Number</span>
Output: Number</span>
Line 207: Line 229:
* Disable Output: Determines if a connected NUMBER STORAGE outputs its value after this gate output.
* Disable Output: Determines if a connected NUMBER STORAGE outputs its value after this gate output.
* Value: The value to calculate the Input with.</tab>
* Value: The value to calculate the Input with.</tab>
<tab name="NOT Gate">Inverts or "Flips" the signal.
<tab name="NOT Gate">Inverts or the signal.
<span style="color:#72aacc;">Input: any<br>
<span style="color:#72aacc;">Input: any<br>
Output: Bool (true/false)</span>
Output: Signal </span>
</tab>
</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>.
<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).}}
An example would be creating a Random Number Generator (RNG).}}
Sets the value of a NUMBER STORAGE Gate<br>
Sets the value of a NUMBER STORAGE Gate<br>
Line 230: Line 251:
Output: any</span>
Output: any</span>
</tab>
</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.
<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.
* Activation time: how long the signal will last until it loops back again.
Line 237: Line 264:
* Start index: the starting number the repeater will use
* Start index: the starting number the repeater will use
* Finish index: the ending number the repeater will use</tab>
* Finish index: the ending number the repeater will use</tab>
<tab name="SET STAT Gate">Sets the stat of the input and outputs the stat's value
<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>
<span style="color:#72aacc;">Input: Player Username<br>
Output: Number</span>
Output: Number</span>
Line 243: Line 271:
* Stat name: The stat name to set.
* Stat name: The stat name to set.
* Value: The new value to set (or add / subtract) the stat.</tab>
* Value: The new value to set (or add / subtract) the stat.</tab>
<tab name="TEXT EDITING Gate">Sets the value of the connected TEXT STORAGE.
<tab name="TEXT EDITING Gate">[[File:TextEditingGatePreview.png|300px]]
Sets the value of the connected TEXT STORAGE.
<span style="color:#72aacc;">Input: any<br>
<span style="color:#72aacc;">Input: any<br>
Output: none (String if Next Gate Type is Normal)</span>
Output: none (String if Next Gate Type is Normal)</span>
Line 250: Line 279:
* Operation Type: Decides what to do with the value.
* 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>
* Value: The value to set a TEXT STORAGE to. (Output if Next Gate Type is Normal)</tab>
<tab name="TEXT INPUT Gate">Brings up a dialog box on the Input's screen and outputs the response.
<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>
<span style="color:#72aacc;">Input: any<br>
Output: String</span>
Output: String</span>
Line 256: Line 286:
* Input Position: Changes the dialog's position.
* Input Position: Changes the dialog's position.
* Input Size: Changes the dialog's size.</tab>
* Input Size: Changes the dialog's size.</tab>
<tab name="TEXT STORAGE Gate">Stores a text value that can be edited using a TEXT EDITING Gate.
<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>
<span style="color:#72aacc;">Input: TEXT EDITING Signal<br>
Output: String</span>
Output: String</span>
Line 272: Line 303:
<span style="color:#72aacc;">Input: any (Multiple)<br>
<span style="color:#72aacc;">Input: any (Multiple)<br>
Output: Bool</span>
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><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>