//copy+: write docs

This commit is contained in:
Starbeamrainbowlabs 2021-11-11 02:36:37 +00:00
parent d560583121
commit acb1ef1a0a
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
4 changed files with 41 additions and 7 deletions

View file

@ -14,6 +14,7 @@ Note to self: See the bottom of this file for the release template text.
- Add `//noiseapply2d` for running commands on columns where a noise value is over a threshold
- Add `//ellipsoid2` which creates an ellipsoid that fills the defined region
- Add `//spiral2` for creating both square and circular spirals
- Add `//copy+` for copying a defined region across multiple axes at once
- Use [luacheck](https://github.com/mpeterv/luacheck) to find and fix a large number of bugs and other issues [code quality from now on will be significantly improved]
- Multiple commands: Allow using quotes (`"thing"`, `'thing'`) to quote values when splitting
- `//layers`: Add optional slope constraint (inspired by [WorldPainter](https://worldpainter.net/))

View file

@ -193,7 +193,7 @@ Floods all connected nodes of the same type starting at _pos1_ with `<replace_no
```
## `//wbox <replace_node>`
### `//wbox <replace_node>`
Sets the edges of the current selection to `<replace_node>`to create an outline of a rectangular prism. Useful for roughing in walls.
```weacmd
@ -201,7 +201,7 @@ Sets the edges of the current selection to `<replace_node>`to create an outline
//wbox dirt
```
## `//wcompass <replace_node> [<bead_node>]`
### `//wcompass <replace_node> [<bead_node>]`
Creates a compass around pos1 with a single node bead pointing north (+Z).
```weacmd
@ -210,7 +210,7 @@ Creates a compass around pos1 with a single node bead pointing north (+Z).
//wcompass gold diamond
```
## `//wcorner <replace_node>`
### `//wcorner <replace_node>`
Set the corners of the current selection to `<replace_node>`. Useful for outlining building sites and setting boundaries.
```weacmd
@ -218,7 +218,7 @@ Set the corners of the current selection to `<replace_node>`. Useful for outlini
//wcorner stone_with_iron
```
## `//scale <axis> <scale_factor> | <factor_x> [<factor_y> <factor_z> [<anchor_x> <anchor_y> <anchor_z>`
### `//scale <axis> <scale_factor> | <factor_x> [<factor_y> <factor_z> [<anchor_x> <anchor_y> <anchor_z>`
Advanced version of [`//stretch` from WorldEdit](https://github.com/Uberi/Minetest-WorldEdit/blob/master/ChatCommands.md#stretch-stretchx-stretchy-stretchz) that can scale both up and down at the same time by transparently splitting it into 2 different operations. Scaling up is *always* done before scaling down.
Although the syntax looks complicated, it's really quite simple. The key concept to understand is that of the scale factor. It refers to how much the defined region should be scaled up or down by, and can be specified in multiple different ways:
@ -300,6 +300,40 @@ By adding 3 extra numbers for the x, y, and z axes respectively, we can control
So in the above example, we scale in the positive x and z directions, and the negative y direction.
### `//copy+ <axis:x|y|z|-x|-y|-z|?|front|back|left|right|up|down> <count> [<axis> <count> [...]]`
Fully backwards-compatible with `//copy` from regular WorldEdit, but allows you to specify multiple axes at once in a single copy operation. Each successive axis in the list is specified in the form `<axis> <count>`, where:
- `<axis>` is the name of the axis to move the defined region along
- `<count>` is the number of nodes along the defined axis to move
All of the following values are valid axes:
- `x`
- `y`
- `z`
- `-x`
- `-y`
- `-z`
- `?` / `front` / `f`
- `back` / `b`
- `left` / `l`
- `right` / `r`
- `up` / `u`
- `down` / `d`
Additionally all the absolute axis names (`x`/`y`/`z`/`-x`/`-y`/`-z`) may also be specified multiple times under the same count - e.g. `xy-z 6`.
```
//copy+ x 6
//copy+ y 10 z 4
//copy+ front 6 left 5
//copy+ ? 10 r 25 y 50
//copy+ xz 50 front 22
//copy+ yx 25
//copy+ -xz-y 10
```
### `//replacemix <target_node> [<chance>] <replace_node_a> [<chance_a>] [<replace_node_b> [<chance_b>]] [<replace_node_N> [<chance_N>]] ...`
Replaces a given node with a random mix of other nodes. Functions like `//mix`.
@ -311,8 +345,6 @@ This command is best explained with examples:
The above functions just like `//replace` - nothing special going on here. It replaces all `dirt` nodes with `stone`.
Let's make it more interesting:
```weacmd

View file

@ -41,6 +41,7 @@ The detailed explanations have moved! Check them out [here](https://github.com/s
- [`//spiral2 [<circle|square>] [<replace_node=dirt> [<interval=3> [<acceleration=0>] ] ]`](https://worldeditadditions.mooncarrot.space/Reference/#spiral2)
### Misc
- [`//copy+ <axis:x|y|z|-x|-y|-z|?|front|back|left|right|up|down> <count> [<axis> <count> [...]]`](https://worldeditadditions.mooncarrot.space/Reference/#copy+)
- [`//replacemix <target_node> [<chance>] <replace_node_a> [<chance_a>] [<replace_node_b> [<chance_b>]] [<replace_node_N> [<chance_N>]] ....`](https://worldeditadditions.mooncarrot.space/Reference/#replacemix)
- [`//floodfill [<replace_node> [<radius>]]`](https://worldeditadditions.mooncarrot.space/Reference/#floodfill)
- [`//scale <axis> <scale_factor> | <factor_x> [<factor_y> <factor_z> [<anchor_x> <anchor_y> <anchor_z>]]`](https://worldeditadditions.mooncarrot.space/Reference/#scale) **experimental**

View file

@ -25,7 +25,7 @@ end
-- ██ ██ ██ ██ ██
-- ██████ ██████ ██ ██
worldedit.register_command("copy+", { -- TODO: Make this an override
params = "<axis:x|y|z|-x|-y|-z|?|front|back|left|right|up|down> <count> [mirror|mir] [<axis> <count> [mirror|mir] [...]]",
params = "<axis:x|y|z|-x|-y|-z|?|front|back|left|right|up|down> <count> [<axis> <count> [...]]",
description = "Copies the defined region to another location - potentially across multiple axes at once.",
privs = { worldedit = true },
require_pos = 2,