diff --git a/src/SUMMARY.md b/src/SUMMARY.md index d900957..c967010 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -59,6 +59,9 @@ - [Roughen](tools/manipulation/roughen.md) - [Shatter](tools/manipulation/shatter.md) - [Extrude](tools/manipulation/extrude.md) + - [Modify](tools/manipulation/modify.md) - [Ruler Tool](tools/ruler.md) - [Path Tool](tools/path.md) - +- [Advanced](advanced/intro.md) + - [Commands](advanced/commands.md) + - [Config](advanced/configuration.md) diff --git a/src/advanced/commands.md b/src/advanced/commands.md new file mode 100644 index 0000000..72fa409 --- /dev/null +++ b/src/advanced/commands.md @@ -0,0 +1,31 @@ +# Commands + +Commands are essential for management and debugging. + +### /axiomdocs + +- This command provides a link to this documentation. + +### /axiomenablecheats + +- Forces the world to have cheats enabled, even if they are disabled. + +### /axiomhandshake + +- Tests the connection by emulating a player join on a server. + +### /axiomintro + +- Displays the introduction shown when first using the mod. + +### /axiomtogglecapability + +- Target a capability and toggle it. + +### /whynoaxiom + +- Returns Axiom's status and information on how to resolve issues. + +## Compatible commands + +`//pos1` and `//pos2` are part of Axiom, but are intended to be used alongside WorldEdit. \ No newline at end of file diff --git a/src/advanced/configuration.md b/src/advanced/configuration.md new file mode 100644 index 0000000..57abecd --- /dev/null +++ b/src/advanced/configuration.md @@ -0,0 +1,41 @@ +# Configuration + +Axiom has its own dedicated configuration located in `.minecraft/config/axiom` containing 3 folders and 3 files. + +The folders are used to store saved [Blueprints](editor/blueprints.md), [Heightmaps](editor/tools/heightmap/elevation.md) and [Tool Presets](editor/toolpresets.md) so even if the mod is removed, your assets are saved. + +The files contain the more important information such as UI layout and enabled capabilities. Axiom uses a variant of JSON called HOCON (Human-Optimized Config Object Notation). + +Below are the three files alongside their descriptions. + +### `.axiominternal.hocon` + +| Key | Description | +| ------------------------------ | --------------------------------------------------------------------- | +| completedTutorials | Lists the tools that have shown their short tutorial. | +| customDowngradeSuggestions | Lists the downgrades suggested by Axiom. | +| globalScale | A float representing the [Editor](editor/intro.md) UI Scale. | +| lastTranslationCount | A value determining the amount of translations. | +| openEditorWindowTypes | A list of open windows in the editor. | +| rootEditorPalette | The default block palette for the editor mode. | +| savedCustomTheme | Stores the currently active theme as a string. | +| showCloseWindowButton | A boolean to toggle the "x" to close windows. | +| showNon90DegreeRotationWarning | A boolean to toggle the warning before applying non-90-degree angles. | +| showToolMaskOpenWarning | A boolean to toggle the warning when using tool masks. | +| shownIntroduction | A boolean representing whether the introduction has been completed. | + +### `.axiom.hocon` + +| Key | Description | +| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| blockAttributes | Contains the currently toggled block attributes. | +| blueprint | Stores the toggle to automatically refresh and a list of all used blueprint tags. | +| capabilities | Lists all abilities and their state. Also contains the `autoSwapToCreative` boolean that controls switching to creative when opening the [context menu](builder/contextmenu.md). | +| keybinds | Stores in-game keybinds and settings for the Builder Mode and camera movement. | +| toolKeybinds | Stores all Editor keybinds for switching tools. | +| rendering | Stores booleans representing the toggles in the Toolbox found in the [Context Menu](builder/contextmenu.md). | + + +### `imgui.ini` + +This file is generally not meant to be modified, hence why it uses a different file format. However, if you're having an issue with a specific window that you can't recover, you can either edit or delete this file to fix the issue. \ No newline at end of file diff --git a/src/advanced/intro.md b/src/advanced/intro.md new file mode 100644 index 0000000..a8ce53a --- /dev/null +++ b/src/advanced/intro.md @@ -0,0 +1,3 @@ +# Advanced + +The advanced section covers some of the niche but good-to-know bits of information such as commands and configurations. This can be especially helpful for debugging issues. \ No newline at end of file diff --git a/src/editor/mainmenubar.md b/src/editor/mainmenubar.md index 2ad3d54..0145040 100644 --- a/src/editor/mainmenubar.md +++ b/src/editor/mainmenubar.md @@ -9,7 +9,7 @@ The main menu bar gives users access to crucial functionality of the mod. Here y | Export Schematic | Exports a selection as a schematic file | | Open Reference Image | Adds a window with an image of your choice | | Load Bedrock Packs | Allows you to import Bedrock Edition textures or models. | -| Save Selection as CSV | Exports a selection to a CSV[^note3] format. | +| Save Selection as CSV | Exports a selection to a CSV[^note1] format. | | Save Clipboard as JSON Model | This allows you to take blocks and convert them to an item model. Models can be used in resource packs or imported into Blockbench. | ## Edit @@ -43,11 +43,11 @@ The View submenu lets you configure options related to viewing and rendering cer |----------------|------------------|-------------| | New View | None | Create a new [View](views.html) | | Show Selection | None | Lets you toggle the rendering of your selections | -| Show Biomes | Ctrl+B | Enables the biome overlay[^note1] | +| Show Biomes | Ctrl+B | Enables the biome overlay[^note2] | | Show Key Presses| None | This shows your inputs including mouse clicks on the bottom right of the viewport. This can be useful for making tutorials. | | UI Scale | None | A slider ranging from 0.5 to 2. This lets you change the size of all graphical elements in the editor mode. | | Min Brightness | None | A slider ranging from 0 to 1. This lets you change how dark unlit places look in your world. A value of 1 means all blocks are fully lit, this is also known as Fullbright. | -| Fluid Opacity | None | A slider ranging from 0 to 1. This lets you change the opacity of transluscent[^note2] fluids to make it easier to look through. A value of 0 will make the fluid invisible. | +| Fluid Opacity | None | A slider ranging from 0 to 1. This lets you change the opacity of transluscent[^note3] fluids to make it easier to look through. A value of 0 will make the fluid invisible. | ## Operations @@ -89,10 +89,11 @@ The **Help** submenu contains useful information and configuration options. The dropdown contains links to information and resources. The style editor can be accessed through this window, allowing you to change and import custom colours for the UI. -[^note1]: Be aware that biomes in Minecraft are defined in a 4x4x4 grid. However, to make biomes feel more natural, vanilla warps the biomes visually. The biome overlay shows the "real" position of biomes, while biome blending and the f3 screen show the "warped" position of biomes. - -[^note2]: Lava and other non-translucent fluids (if the game is modded) are not affected by opacity due to performance and mod compatibility concerns. +## References +[^note1]: comma-separated values (CSV) is a plaintext format that uses commas to separate values in a table-like manner. -[^note3]: comma-separated values (CSV) is a plaintext format that uses commas to separate values in a table-like manner. +[^note2]: Be aware that biomes in Minecraft are defined in a 4x4x4 grid. However, to make biomes feel more natural, vanilla warps the biomes visually. The biome overlay shows the "real" position of biomes, while biome blending and the f3 screen show the "warped" position of biomes. + +[^note3]: Lava and other non-translucent fluids (if the game is modded) are not affected by opacity due to performance and mod compatibility concerns. [^note4]: [CIELAB](https://en.wikipedia.org/wiki/CIELAB_color_space) is a type of colour space that can utilise the XYZ coordinates to display colours. \ No newline at end of file diff --git a/src/editor/toolmasks.md b/src/editor/toolmasks.md index 8f3f663..b6c1fe7 100644 --- a/src/editor/toolmasks.md +++ b/src/editor/toolmasks.md @@ -5,33 +5,56 @@ Tool Masks empower users to set up rules for tools, applying their effects only The conditions fall into two main categories: Logic and Masks. ## Logic conditions - -- **Any** -The 'Any' condition enables any rules within this block to take effect. For example, when selecting multiple blocks to mask, select 'any' block that matches grass_block or stone. - -- **All** -The 'All' condition requires all rules within this block to apply. For instance, if you want to select a block that has air above and dirt below it. However, conflicting rules won't function in the same 'All' block, meaning you can't have two 'block =' masks or two 'above =' masks simultaneously. But, it's possible to nest another 'Any' block inside. -- **Not** -The 'Not' condition reverses the rule outcomes, making them true only when the original conditions are not met. For example, setting the rule 'above = air' within a 'Not' block selects all blocks that do not have air above them. - Combining these logic conditions allows for a broad range of expressions in masks, enabling you to select almost all blocks meeting specific criteria. - + +| Logic | Description | +|------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **OR** | The `OR` condition enables any rules within this block to take effect. For example, when selecting multiple blocks to mask, select blocks that match grass_block `OR` stone. | +| **AND** | The `AND` condition requires all rules within this block to apply. For instance, if you want to select a block that has air above and dirt below it. However, conflicting rules won't function in the same `ANY` block, meaning you can't have two `block =` masks or two `above =` masks simultaneously. But, it's possible to nest another `AND` block inside. | +| **NOT** | The `NOT` condition reverses the rule outcomes, making them true only when the original conditions are not met. For example, setting the rule `above = air` within a `NOT` block selects all blocks that do not have air above them. | +| **OFFSET** | The `OFFSET` condition allows coordinate input to apply a mask for a nearby block relative to the current block. For example, using `offset(0,-1,0){ surface }` will mask block 1 block above the surface. | + ## Masks Masks are conditions that depend on the target's state or the surrounding blocks' state. - -- **Block** -The 'Block' mask returns true when the target matches the specified block or block state. -- **Y** -The 'Y' mask returns true when the target aligns with the given condition relating to the block's Y coordinate level. There are several conditions for the Y mask which can be modified by clicking on the '=' sign. -- **In Selection** -The 'In Selection' condition returns true when the target block is within the user-defined selection area. -- **Above** -The 'Above' condition is true when the block directly above the target block matches the specified block or block state. -- **Below** -The 'Below' condition is true when the block directly below the target block matches the specified block or block state. -- **Near** -The 'Near' condition is true when any of the blocks in the 3x3 area (26 blocks) surrounding the target match the specified block or block state. -- **Neighbor** -The 'Neighbor' condition returns true when any of the six blocks directly adjacent (up, down, north, south, east, west) to the target match the specified block or block state which allows the mask to check the immediate vicinity of the target block. + +| Mask | Description | +|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **Block** | The `Block` mask returns true when the target matches the specified block or block state. | +| **Above** | The `Above` condition is true when the block directly above the target block matches the specified block or block state. | +| **Below** | The `Below` condition is true when the block directly below the target block matches the specified block or block state. | +| **Near** | The `Near` condition is true when any of the blocks in the set radius surrounding the target match the specified block or block state. | +| **Neighbour** | The `Neighbor` condition returns true when any of the six blocks directly adjacent (up, down, north, south, east, west) to the target match the specified block or block state which allows the mask to check the immediate vicinity of the target block. | +| **Adjacent** | The `Adjacent` condition returns true when any of the four horizontally touching blocks match the specified block or block state. | +| **Y** | The `Y` mask returns true when the target aligns with the given condition relating to the block's Y coordinate level. There are several conditions for the Y mask which can be modified by clicking on the `=` sign. | +| **Angle** | The `Angle` mask utilises two inputs. The `Angle` input is used to mask a specific angle and the `Range` input is how many angles are used originating from the `Angle` input. For example, an angle of 90 and a range of 10 would cover all angles from 80 to 100. | +| **In Selection** | The `In Selection` condition returns true when the target block is within the user-defined selection area. | +| **Can See Sky** | The `Can See Sky` condition returns true if the target block has direct access to the sky. | +| **Surface** | The `Surface` mask returns true if the block is adjacent to air or liquids. | + +# Scripting + +Similar to the [Script Brush](/tools/painting/scriptbrush.md), the mask scripting allows users to input custom scripts using Lua. However, the rule of returning a boolean value still applies. + +## Custom Variables + +| Variables | Description | Example | +|-----------|----------------------------------------------------------------|--------------| +| x,y,z | These three variables represent the XYZ coordinates. | if y==5 | +| blocks | Can be used to retrieve the blockstate[^note4] ID for a block. | blocks.stone | + +## Custom Functions + +|
Functions
| Description | Example | +|-------------------------------------------|---------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------| +| getBlock(x,y,z) | Returns the block ID at the given position (x,y,z). | if getBlock(x,y,z)==blocks.stone | +| getBlockState(x,y,z) | Returns the blockstate[^note4] ID at a given position. | if getBlockstate(x,y,z)==withBlockProperty(blocks.chain,"axis=x") | +| getHighestBlockYAt(x,z) | Returns the Y value of the highest block on the XZ coordinates. | if getHighestBlockYAt(x,z)==20 | +| getSimplexNoise(x,y,z,"seed") | Returns a value between 0 and 1, representing the Simplex noise for the provided coordinates. | if getSimplexNoise(x,y,z,42)=>0.5 | +| getVoroniEdgeNoise(x,y,z,"seed") | Returns a value between 0 and 1, representing the Voroni Edge noise for the provided coordinates. | if getVoroniEdgeNoise(x,y,z,01134)=>0.5 | +| isSolid(block) | Returns true if the block is solid, false if not. | if isSolid(getBlock(x,y,z)) | +| isBlockTagged(block,"tag") | Returns true if the block has the provided tag, false if not. | if isBlockTagged(getBlock(x,y,z),"wooden_fences") | +| withBlockProperty(block,"property=value") | Used to return or set a block with a block property. | withBlockProperty(blocks.oak_slab,"waterlogged=true") | +| getBlockProperty(block,"property") | Returns the value of the provided block property. | if getBlockProperty(blocks.oak_slab,"waterlogged")==true | +| setBlock(x,y,z,block) | Set an additional block at a given position. | setBlock(x,y,z,blocks.stone) | \ No newline at end of file diff --git a/src/tools/drawing/shape.md b/src/tools/drawing/shape.md index a9618cc..c615d52 100644 --- a/src/tools/drawing/shape.md +++ b/src/tools/drawing/shape.md @@ -16,6 +16,7 @@ Each shape lets you tweak its XZ or XYZ dimensions. In addition to controlling r | Tube        | | Cone        | | Pyramid     | +| Torus | | Dodecahedron| | Icosahedron | diff --git a/src/tools/manipulation/modify.md b/src/tools/manipulation/modify.md new file mode 100644 index 0000000..416ea96 --- /dev/null +++ b/src/tools/manipulation/modify.md @@ -0,0 +1,38 @@ +## Modify + +The Modify tool is designed for manipulating [selections](/tools/selection/intro.md) in various ways. + +## Overview + +| Mode             | Description                                                        | +|------------------|--------------------------------------------------------------------| +| Revolve          | Stretches the selection in a circular structure                    | +| Translate Copies | Clones the selection a set number of times with a custom offset | +| Rotate Copies    | A mix between Revolve and Translate Copies                         | +| Twist            | Twists a selection using an angle and axis                         | + +## Revolve + +With your selection active, two circular lines will appear, the red indicates the inner part of the revolve and the green indicates the exterior. The two lines pointing from the cursor position indicate the points where the rotation may start. + +The Revolve tool can rotate on all three axes separately and has an option to control the amount of angle the tool uses. An angle of 360 does a full loop and 180 does a half loop.   + +## Translate Copies + +Similar to[stack](/builder/stack.md), Translate Copies allows for offsetting by relative or absolute values. The count controls the amount of copies to be made with the offset. + +Relative offsets are multiplied by the size of the selection. + +Absolute offsets are not multiplied so they are therefore absolute coordinates.   + +## Rotate Copies + +Like a mix between Revolve and Translate Copies, Rotate Copies rotates a set number of copies around a point set by the cursor. However, changing the **Type** from **Equidistant** to **Custom Angle** will remove the point rotation and rotate based on the set angle offset. + +The **Add Translation** Toggle enables the ability to offset the end copy. An offset of 1 on the Y-axis will create a spiral shape. + +## Twist + +The Twist function twists a selection at an angle alongside an axis. + +The axis controls the face direction of the twist and the angle determines how much it should twist. diff --git a/src/tools/painting/scriptbrush.md b/src/tools/painting/scriptbrush.md index 8c36376..b31975e 100644 --- a/src/tools/painting/scriptbrush.md +++ b/src/tools/painting/scriptbrush.md @@ -1,14 +1,24 @@ -## Script Brush +# Script Brush -The Script Brush is a very unique tool, it allows you to create your own brush. This can be for easing the building process or adding new tools to axiom. +The Script Brush is a very unique tool, the scripting functionality mixed with useful functions can lead to near-unlimited possibilities. The use of clever logic can lead to things like simple texture generators all the way to structural generators. -- The Script Brush is an advanced tool catered towards advanced users. The brush requires some knowledge of programming languages like Python. +Although intimidating at first, once you understand the basic concept of programming and have read this documentation, you'll be ready to make your own scripts! -- An IDE[^note4] window is used to input your code. It uses a similar language to Python called Lua[^note1]. +## Key Points -- Lua doesn't require line indentation like most languages but axiom provides a tabbing feature to indent. There is only one built-in library[^note3] and there are currently no others. +- The Script Brush is a powerful, yet advanced tool so some knowledge of programming languages similar to Python is recommended. -### The Script must return a block or use setBlock() to modify blocks in the world. +- The Script Brush is similar to [Mask Scripting](/editor/toolmasks.md). + +- An IDE[^note1] window is used to input your code. It uses a similar language to Python called Lua[^note2]. + +> [!TIP] +> Lua doesn't require line indentation like most languages but Axiom provides a tabbing feature to indent. +> +> There is only one built-in library[^note3] and there are currently no others. + +> [!IMPORTANT] +> The Script must return a block or use setBlock() to modify blocks in the world. There are many predefined variables and functions that can be used throughout the script to interact with the world. Listed below, are all variables and functions with descriptions and examples. @@ -17,22 +27,22 @@ There are many predefined variables and functions that can be used throughout th | Variables | Description | Example | |-----------|----------------------------------------------------------------|--------------| | x,y,z | These three variables represent the XYZ coordinates. | if y==5 | -| blocks | Can be used to retrieve the blockstate[^note2] ID for a block. | blocks.stone | +| blocks | Can be used to retrieve the blockstate[^note4] ID for a block. | blocks.stone | ## Custom Functions -| Functions | Description | Example | -|-------------------------------------------|---------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------| -| getBlock(x,y,z) | Returns the block ID at the given position (x,y,z). | if getBlock(x,y,z)==blocks.stone | -| getBlockState(x,y,z) | Returns the blockstate[^note2] ID at a given position. | if getBlockstate(x,y,z)==withBlockProperty(blocks.chain,"axis=x") | -| getHighestBlockYAt(x,z) | Returns the Y value of the highest block on the XZ coordinates. | if getHighestBlockYAt(x,z)==20 | -| getSimplexNoise(x,y,z,"seed") | Returns a value between 0 and 1, representing the Simplex noise for the provided coordinates. | if getSimplexNoise(x,y,z,"WILLATRONIXisCOOL")=>0.5 | -| getVoroniEdgeNoise(x,y,z,"seed") | Returns a value between 0 and 1, representing the Voroni Edge noise for the provided coordinates. | if getVoroniEdgeNoise(x,y,z,"coolseed")=>0.5 | -| isSolid(block) | Returns true if the block is solid, false if not. | if isSolid(getBlock(x,y,z)) | -| isBlockTagged(block,"tag") | Returns true if the block has the provided tag, false if not. | if isBlockTagged(getBlock(x,y,z),"wooden_fences") | -| withBlockProperty(block,"property=value") | Used to return or set a block with a block property. | withBlockProperty(blocks.oak_slab,"waterlogged=true") | -| getBlockProperty(block,"property") | Returns the value of the provided block property. | if getBlockProperty(blocks.oak_slab,"waterlogged")==true | -| setBlock(x,y,z,block) | Set an additional block at a given position. | setBlock(x,y,z,blocks.stone) | +|
Functions
| Description | Example | +|-------------------------------------------|---------------------------------------------------------------------------------------------------|----------------------------------------------------------------| +| getBlock(x,y,z) | Returns the block ID at the given position (x,y,z). | getBlock(x,y,z)==blocks.stone | +| getBlockState(x,y,z) | Returns the blockstate[^note4] ID at a given position. | getBlockstate(x,y,z)==withBlockProperty(blocks.chain,"axis=x") | +| getHighestBlockYAt(x,z) | Returns the Y value of the highest block on the XZ coordinates. | getHighestBlockYAt(x,z)==20 | +| getSimplexNoise(x,y,z,seed) | Returns a value between 0 and 1, representing the Simplex noise for the provided coordinates. | getSimplexNoise(x,y,z,42)=>0.5 | +| getVoroniEdgeNoise(x,y,z,seed) | Returns a value between 0 and 1, representing the Voroni Edge noise for the provided coordinates. | getVoroniEdgeNoise(x,y,z,01134)=>0.5 | +| isSolid(block) | Returns true if the block is solid, false if not. | isSolid(getBlock(x,y,z)) | +| isBlockTagged(block,"tag") | Returns true if the block has the provided tag, false if not. | isBlockTagged(getBlock(x,y,z),"wooden_fences") | +| withBlockProperty(block,"property=value") | Used to return or set a block with a block property. | withBlockProperty(blocks.oak_slab,"waterlogged=true") | +| getBlockProperty(block,"property") | Returns the value of the provided block property. | getBlockProperty(blocks.oak_slab,"waterlogged")==true | +| setBlock(x,y,z,block) | Set an additional block at a given position. | setBlock(x,y,z,blocks.stone) | ## Template Variables @@ -46,24 +56,63 @@ Template Variables are not shown in the help text. Template Variables are used t | `$float(title,default,min,max)$` | Creates a slider with decimal values. | `$float(Noise Threshold,0.5,0,1)$` | | `$boolean(title,default(true/false))$`| Creates a toggle | `$boolean(Disable Randomness,true)$` | -## Code Examples +# Code Examples -The script below places lily pads above water using white noise and simplex noise. +These four code examples range from a novice user all the way to a professional in terms of difficulty. Each script provides a description and a breakdown of how the script works. -
-chance=$float(Chance,0.5,0,1)$
-multiplier=$float(Multiplier,1,0,2)$
+> [!NOTE]
+> Feel free to copy these and mess around with them.
+
+### **Novice**
+
+This script below is very basic, it replaces oak leaves with birch leaves.
+
+```lua
+if getBlock(x,y,z)==blocks.oak_leaves then
+	return blocks.birch_leaves
+end
+```
+
+
+ Novice Code Breakdown + The if check ensures that the current block is oak leaves. Using "getBlock(x,y,z)" targets the active block. + + Then "blocks.oak_leaves" is used to check if the block IDs match. + + Finally, the script returns birch leaves, therefore replacing oak leaves. + +
+ +### **Advanced** + +This script places pink petal flowers using simplex noise to control the block property. + +```lua +multiplier=$float(Multiplier,1,0,2)$ noise=getSimplexNoise(x/8,y/8,z/8) -if getBlock(x,y-1,z)==blocks.water and getBlock(x,y,z)==blocks.air and noise<(0.5*multiplier) and math.random()< chance then - return blocks.lily_pad +if getBlock(x,y,z)==blocks.air and isSolid(getBlock(x,y-1,z)) and noise<(0.75*multiplier) then + return withBlockProperty(blocks.pink_petals,"flower_amount="..math.floor((getSimplexNoise(x/2,y/2,z/2,0)*4))) end -
+``` + +
+ Advanced Code Breakdown + + Firstly, The multiplier and noise variables by utilising the float variable and the simplex noise function. + + Then the script checks that the block is air and is above a solid surface while also checking if the noise is within range. -This more advanced script generates kelp underwater at a set length. + Finally, the block is placed using "withBlockProperty" to set the flower amount property. This uses a modified simplex noise that returns values between 0 and 4. -
+
+ +### **Expert** + +The script below generates kelp in water using a maximum height to control the length of kelp. + +```lua multiplier=$float(Multiplier,1,0.01,4)$ heightMax=$int(Maximum Height,25,1,50)$ @@ -78,14 +127,62 @@ if noise<(multiplier*0.1) and isSolid(getBlock(x,y-length,z)) and getBlock(x,y,z end return blocks.kelp end - +``` + +
+ Expert Code Breakdown + + Firstly, the script defines all the variables. + + As the script builds the kelp from top to bottom, it checks if the lowest attemptable block is solid. + + Then, for each solid block, the script places a kelp plant. + + Once all kelp plant blocks are placed, the script then sets the active block to be the top piece of kelp. + +
+ +### **Professional** + +This final script creates a curved bowl shape using mathematical formulae. This is one of the most complex types of script brushes in Axiom. + +```lua +$once$ +scale = $int(Scale,30,10,50)$ +flatness = $float(Bowl Flatness,0.8,0.1,2.5)$ +tolerance = (scale*10)*flatness +block=$blockState(Block)$ + +for DistX = -scale, scale do + for DistY = -scale, scale do + for DistZ = -scale, scale do + local formulaL = DistX^2 + DistY^2 + (DistZ^1.5)*-(flatness*10)^2 + local formulaR = 0 + if (formulaL - formulaR) <= tolerance then + setBlock(x + DistX, y + DistZ, z + DistY, block) + end + end + end +end +``` + +
+ Professional Code Breakdown + + This script represents the following equation: + (X²+Y²+(Z¹.⁵)(-n)10^2)=0 + Where n is the flatness variable. + + The script draws the 3D shape by using a loop for each axis. + +
## References -[^note1]: Lua is a lightweight programming language designed for embedded use within applications. +[^note1]: An integrated development environment (IDE) is a software application that provides comprehensive facilities for software development. -[^note2]: Blockstate IDs are calculated using [Block IDs](https://minecraftitemids.com/). The formula for blockstate IDs is `-n-x` where n is the Block ID and x is the block state. +[^note2]: Lua is a lightweight programming language designed for embedded use within applications. [^note3]: The [Math Library](https://www.lua.org/pil/18.html) is the only built-in library in the Script Brush. -[^note4]: An integrated development environment (IDE) is a software application that provides comprehensive facilities for software development. +[^note4]: Blockstate IDs are calculated using [Block IDs](https://minecraftitemids.com/). The formula for blockstate IDs is `-n-x` where n is the Block ID and x is the block state.