Logic: Difference between revisions
RickGotTaken (talk | contribs) m Added stuff from [https://wiki.wubbygame.com/en/Logic](<https://web.archive.org/web/20240205171403mp_/https://wiki.wubbygame.com/en/Logic>). |
|||
Line 1: | Line 1: | ||
{{WIP}}{{Warning|This page explains advanced features, some players may not understand everything in this page.}} |
|||
{{WIP}} |
|||
Wubby Logic is the second-most important thing in your |
Wubby Logic is the second-most important thing in your Wubby worlds, They can do mostly anything such as: |
||
* Changing block colors |
* Changing block colors |
||
Line 14: | Line 14: | ||
These are blocks that are used to power wiring systems. They do not receive wiring inputs, and can only output. |
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">[[File:Block_touch_detectorpreview.png|300px]]<br> |
|||
Emits a signal when touched by an unanchored block or gear debris.<br> |
|||
<tab name="Block Touch Detector"> [[File:Block_touch_detectorpreview.png|250px]] |
|||
<span style="color:teal;">Output: The part that touched it.</span><br> |
|||
This block is triggered when another block touches it.<br> |
|||
Output: The part that touched it.<br> |
|||
Configurations:<br> |
Configurations:<br> |
||
* Activation Time: How long it activates for. Default is 1 |
* Activation Time: How long it activates for. Default is 1<br> |
||
* Anchor Type: Decides what blocks get detected. Default is NonAnchored |
* Anchor Type: Decides what blocks get detected. Default is NonAnchored<br> |
||
* Color To Filter: When filter color is true, only blocks with this color will trigger it. Default is pearl. |
* 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. |
* 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. |
* 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> |
||
<tab name="Click Block">[[File:Click_blockpreview.png|300px]] |
|||
Emits a signal when clicked on.<br> |
|||
<tab name="Click Block"> [[File:Click_blockpreview.png|250px]] |
|||
<span style="color:teal;">Output: The player that clicked it.</span><br> |
|||
This block is triggered when a player clicks it.<br> |
|||
Output: The player that clicked it.<br> |
|||
Configurations:<br> |
Configurations:<br> |
||
* Activation Time: How long it activates for. Default is 1 |
* Activation Time: How long it activates for. Default is 1.<br> |
||
* Max Distance: How far you can click this block. Default is 32. |
* 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. |
* 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> |
|||
<tab name="Frame Loop Block"> {{Notice|This block is Admin+.}}[[File:Frame_loop_blockpreview.png|250px]]<br> |
|||
<span style="color:teal;">Output: the deltaTime between the frames.</span><br> |
|||
This block is triggered every time the server calculates the physics for 1 frame and outputs.<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> |
|||
<tab name="Humanoid State Block"> [[File:Humanoid_state_blockpreview.png|250px]]<br> |
|||
<span style="color:teal;">Output: The player's username.</span><br> |
|||
This block is triggered when a player's character state changes.<br> |
|||
Output: The player whom character state changed.<br> |
|||
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> |
||
* State: |
* State: The block fires when a humanoid enters this state. Default is Landed.<br> |
||
* Use Activation Time: If |
* 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> |
|||
<tab name="Key Input Block"> [[File:Key_input_blockpreview.png|250px]]<br> |
|||
<span style="color:teal;">Output: The player's username.</span><br> |
|||
This block is triggered when a player presses/releases the selected Key.<br> |
|||
Outputs: The player that pressed the selected Key.<br> |
|||
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> |
||
* Input Detection Type: |
* 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> |
* Key: The key which the player has to press/release to trigger the block. Default is LeftShift.<br> |
||
* Mobile Button Enabled: |
* Mobile Button Enabled: If this is on, touchscreen players will get a button on their screen that activates the block. |
||
* Mobile Button Position: The position of the mobile button |
* 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: |
* 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> |
|||
* 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> |
|||
Emits a signal once an NPC does the selected NPC event.<br> |
|||
<span style="color:teal;">Output: The NPC's NPC Block.</span><br> |
|||
<tab name="NPC Event Block"> [[File:Npc_event_blockpreview.png|250px]] </tab> |
|||
Configurations:<br> |
|||
* Activation Time: How long it activates for. Default is 1.<br> |
|||
<tab name="Player Chatted Block"> [[File:Player_chatted_blockpreview.png|250px]] </tab> |
|||
* Event: The NPC Event to detect.</tab> |
|||
<tab name="Player |
<tab name="Player Chatted Block">[[File:Player_chatted_blockpreview.png|300px]]<br> |
||
Emits a signal every time a player chats.<br> |
|||
<span style="color:teal;">Output: Either the player's username or what they said depending on the "Output Type" setting.</span><br> |
|||
<tab name="Player Touch Detector"> [[File:Player_touch_detectorpreview.png|250px]] </tab> |
|||
Configurations:<br> |
|||
* Activation Time: How long it activates for. Default is 1.<br> |
|||
<tab name="Prompt Block"> [[File:Prompt_blockpreview.png|250px]] </tab> |
|||
* Output Type: Determines if the block will output the players chat message or their username when its fired. Default is "Message".</tab> |
|||
<tab name=" |
<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:teal;">Output: The player's username.</span><br> |
|||
<tab name="Tap Input Block"> [[File:Tap_input_blockpreview.png|250px]] </tab> |
|||
Configurations:<br> |
|||
* Activation Time: How long it activates for. Default is 1.<br> |
|||
* Event: The Player Event to detect. |
|||
<div class="mw-collapsible mw-collapsed" style="width:100%">All player events |
|||
<div class="mw-collapsible-content">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</div></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:teal;">Output: The player's username. (If Detect is set to "NPC" it always outputs the NPC Block)</span><br> |
|||
Configurations: |
|||
* Activation Time: How long it activates for. Default is 1. |
|||
* Detect: A dropdown menu with the items: Players, NPCs, Everything. |
|||
* Use Activation Time: When this is off, the block will only stop firing once the Player/NPC stops touching the block.</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:teal;">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:teal;">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:teal;">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> |
</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 build permissions to add extra functionality to their world, these examples include: |
||
* |
* Ctrl to sprint |
||
* E to activate ability |
* E to activate ability |
||
Revision as of 14:15, 9 April 2024
Logic (WIP, HIRING) This page is a work-in-progress and may contain user notes. |
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:
Easings.net | Contains most easing types with directions.
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.
These are blocks that are used to power wiring systems. They do not receive wiring inputs, and can only output.
![](http://static.miraheze.org/wubbypediawiki/thumb/b/bc/Block_touch_detectorpreview.png/300px-Block_touch_detectorpreview.png)
Emits a signal when touched by an unanchored block or gear debris.
Output: The part that touched it.
Configurations:
- Activation Time: How long it activates for. Default is 1
- Anchor Type: Decides what blocks get detected. Default is NonAnchored
- Color To Filter: When filter color is true, only blocks with this color will trigger it. Default is pearl.
- Filter Color: Whether if this block will only trigger when a block with the specified color touches it. Default is false.
- 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.
![](http://static.miraheze.org/wubbypediawiki/thumb/0/04/Click_blockpreview.png/300px-Click_blockpreview.png)
Emits a signal when clicked on.
Output: The player that clicked it.
Configurations:
- Activation Time: How long it activates for. Default is 1.
- Max Distance: How far you can click this block. Default is 32.
- Toggleable: Whether if this block acts like a switch. Default is true.
Notice! This block is Admin+. |
![](http://static.miraheze.org/wubbypediawiki/thumb/9/97/Frame_loop_blockpreview.png/300px-Frame_loop_blockpreview.png)
Emits a signal everytime the server calculates a physics frame.
Output: the deltaTime between the frames.
Notice! deltaTime is the time (in milliseconds) the server took calculating a physics frame. |
![](http://static.miraheze.org/wubbypediawiki/thumb/f/f4/Humanoid_state_blockpreview.png/300px-Humanoid_state_blockpreview.png)
Emits a signal when a humanoid changes to the specified state.
Output: The player's username.
Configurations:
- Activation Time: How long it activates for. Default is 1.
- State: The block fires when a humanoid enters this state. Default is Landed.
- Use Activation Time: If this is off, then the block will only stop firing once the humanoid exits the state. Default is true.
![](http://static.miraheze.org/wubbypediawiki/thumb/a/aa/Key_input_blockpreview.png/300px-Key_input_blockpreview.png)
Emits a signal when a player presses the selected key or mobile button.
Output: The player's username.
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.
- 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.
- Key: The key which the player has to press/release to trigger the block. Default is LeftShift.
- Mobile Button Enabled: If this is on, touchscreen players will get a button on their screen that activates the block.
- Mobile Button Position: The UDIM2 position (possibly scale) of the mobile button on a players screen if "Mobile Button Enabled" is on.
- Mobile Button Text: What the text on the block's mobile button will be if "Mobile Button Enabled" is on.
![](http://static.miraheze.org/wubbypediawiki/thumb/6/6a/Npc_event_blockpreview.png/300px-Npc_event_blockpreview.png)
Emits a signal once an NPC does the selected NPC event.
Output: The NPC's NPC Block.
Configurations:
- Activation Time: How long it activates for. Default is 1.
- Event: The NPC Event to detect.
![](http://static.miraheze.org/wubbypediawiki/thumb/e/eb/Player_chatted_blockpreview.png/300px-Player_chatted_blockpreview.png)
Emits a signal every time a player chats.
Output: Either the player's username or what they said depending on the "Output Type" setting.
Configurations:
- Activation Time: How long it activates for. Default is 1.
- Output Type: Determines if the block will output the players chat message or their username when its fired. Default is "Message".
![](http://static.miraheze.org/wubbypediawiki/thumb/d/d0/Player_event_blockpreview.png/300px-Player_event_blockpreview.png)
Emits a signal when the selected player event is triggered.
Output: The player's username.
Configurations:
- Activation Time: How long it activates for. Default is 1.
- Event: The Player Event to detect.
PlayerLeft - Triggers when a player leaves the world
PlayerRespawned - Triggers when a player respawns
![](http://static.miraheze.org/wubbypediawiki/thumb/6/6b/Player_touch_detectorpreview.png/300px-Player_touch_detectorpreview.png)
Emits a signal when a Player/NPC touches this block.
Output: The player's username. (If Detect is set to "NPC" it always outputs the NPC Block)
Configurations:
- Activation Time: How long it activates for. Default is 1.
- Detect: A dropdown menu with the items: Players, NPCs, Everything.
- Use Activation Time: When this is off, the block will only stop firing once the Player/NPC stops touching the block.
![](http://static.miraheze.org/wubbypediawiki/thumb/9/99/Prompt_blockpreview.png/300px-Prompt_blockpreview.png)
Emits a signal when it's Proximity Prompt has been triggered.
Output: The player's username.
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.
![](http://static.miraheze.org/wubbypediawiki/thumb/5/5e/Shop_event_blockpreview.png/300px-Shop_event_blockpreview.png)
Emits a signal when the specified item name is bought.
Output: The player's username.
Configurations:
- Activation Time: How long it activates for. Default is 1.
- Item Name: The item to detect a purchase on.
![](http://static.miraheze.org/wubbypediawiki/thumb/c/cf/Tap_input_blockpreview.png/300px-Tap_input_blockpreview.png)
Emits a signal when a player presses a mouse button.
Output: The player's username.
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")
Logic
These are blocks that allow a player with build permissions to add extra functionality to their world, these examples include:
- Ctrl to sprint
- E to activate ability
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. "true" = active signal "false" = inactive signal This is known as a bool |