Script Block: Difference between revisions

Incorporate more Script articles
m (Adapt old wiki page 'How many custom blocks can I nest inside each other?')
(Incorporate more Script articles)
 
Line 6: Line 6:


A '''script block''' block that is only visible on editor (unless only script blocks are in the level), it cannot be used as an object and doesn't have a [[Collider]].
A '''script block''' block that is only visible on editor (unless only script blocks are in the level), it cannot be used as an object and doesn't have a [[Collider]].
Script blocks can be filled with blocks by tapping on the option beside the pencil icon. Moreover, it could be done with every editable custom block:


[[File:Script Block button.png|thumb|none|The option to open the block. This is where to generally compact scripts in a singular location.]]
[[File:Script Block button.png|thumb|none|The option to open the block. This is where to generally compact scripts in a singular location.]]


A maximum of four custom blocks containing scripts can be nested inside. The "Too many blocks inside blocks!" error displays if more than four is nested.
A maximum of four custom blocks containing scripts can be nested inside. The "Too many blocks inside blocks!" error displays if more than four is nested.
== Wire ports ==
To create a wire port, open the block and drag an open input or output wire to the side of the script block. The wire should snap to the block.
Script block's ports are usually 3 voxels away from left/down, and 1 voxel away from the bottom.
Rename by tapping on the block and dragging the port, leaving it unconnected. Then, tap on the button on the bottom-right corner to change name.
Remove a port by opening the script block, tapping one of the two blocks that connect, then disconnecting the other end.
You may have a [[wire splits|wire split]] at a port; with an input or output of the same type, create a wire port while aligning it with the port to share multiple values.


[[Category:Blocks]]
[[Category:Blocks]]
[[Category:Scripting]]