Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions projects/assets/kelvin-vs/1.21/kelvin/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"kelvin.requirements.inhibited_by": "Inhibited by: %s (%s%%)",
"kelvin.requirements.max_pressure": "Maximum Pressure: %s Pa",
"kelvin.requirements.min_pressure": "Minimum Pressure: %s Pa",
"kelvin.requirements.max_temperature": "Maximum Temperature: %s K",
"kelvin.requirements.min_temperature": "Minimum Temperature: %s K"
}
7 changes: 7 additions & 0 deletions projects/assets/kelvin-vs/1.21/kelvin/lang/zh_cn.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"kelvin.requirements.inhibited_by": "抑制源:%s(%s%%)",
"kelvin.requirements.max_pressure": "最大压强:%s Pa",
"kelvin.requirements.min_pressure": "最小压强:%s Pa",
"kelvin.requirements.max_temperature": "最大温度:%s K",
"kelvin.requirements.min_temperature": "最小温度:%s K"
}
38 changes: 38 additions & 0 deletions projects/assets/zps/1.21/zps/doc/en_us/collisions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Collisions

There's an important limitation of the data system to be aware of: The cables can only carry one signal per tick.
If you have more than one device outputting into the network at the same time, the signal will be scrambled into gibberish for all receivers.

For example, if you have a serial bus on `get` mode and a script terminal outputting commands on the same network,
they will collide and cause the gibberish output.

However, there is a way around this problem. Using the **Data Comparator** or **Data Combinator** you can process multiple different signal inputs on the same tick.

## Data Comparator

The Data Comparator is a somewhat primitive form of combining network outputs.

It takes in an input from both sides, and outputs redstone based on three modes: **Equal**, **Contains**, and **Greater Than**.
_(You can change the mode by shift-right-clicking the Data Comparator with an empty hand.)_

In the below example, the Data Comparator is set to "contains" mode, and the script terminal is reading its value using `redstone`.
If the text in the book on the right (green) is contained within the book on the left (yellow), the script terminal (red) will read a redstone value `>0`.

![Comparing of lecterns](zps:textures/gui/manual/comparator_example_step_1.png)

This is useful for simple comparisons between networks, but is limited by the fact it only outputs redstone.

## Data Combinator

The Data Combinator is a more advanced way of combining network outputs. It has two modes, **Append** and **Replace**.

When in **Append** mode, it will output from the <u>back</u> the value from the <u>left</u> input (if any) with the input from the <u>right</u> (if any) added to the end.

![Appending commands](zps:textures/gui/manual/combinator_example_step_1.png)

However this only works if you want to append directly to the end of a command. For a more precise combination,
you can use the placeholder `%s` in the <u>left</u> input to specify where the <u>right</u> input should be inserted.

_(Make sure to shift-right-click the combinator with an empty hand to switch to replace mode)_

![Appending commands](zps:textures/gui/manual/combinator_example_step_2.png)
63 changes: 63 additions & 0 deletions projects/assets/zps/1.21/zps/doc/en_us/create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Create Integration

When [Create](https://modrinth.com/mod/create) is loaded, ZPS adds extra executors for supported blocks in Create or Create addons.

These executors allow automating behaviors in Create which usually require a player to tweak, such as speed, mode, range, or stack size.

Use tab-completion in the Script Terminal to see which `set_*` commands are available for the block you are targeting. The list of options depends on which blocks are targeted and which Create addons are loaded.

---

## Common Commands

| Executor | Argument | Description |
|----------|----------|-------------|
| `set_filter` | `<item>` | Sets the item filter on supported Create blocks. |
| `set_rpm` | `<int>` | Sets a block's speed in RPM. |
| `set_rotation_mode` | `<mode>` | Changes the mode used by a Mechanical Bearing. |
| `set_clock_hand` | `<mode>` | Changes the hand arrangement of a Clockwork Bearing. |
| `set_sticky_range` | `<int>` | Sets how many sticky sides a chassis uses. |
| `set_stack_size` | `<int>` | Sets the ejected stack size of a Weighted Ejector. |

Examples:

```
set_filter minecraft:iron_ingot
set_rpm 64
set_rotation_mode ROTATE
set_sticky_range 4
set_stack_size 16
```

---

## Where They Apply

Some commonly supported blocks include:

- `set_filter`: Mechanical Saw, Deployer, Track Observer, Stockpile Switch, Item Hatch, Brass Funnel, Smart Fluid Pipe, Smart Observer, Smart Chute, Mechanical Roller, Basin
- `set_rpm`: Creative Motor, Rotation Speed Controller
- `set_rotation_mode`: Mechanical Bearing
- `set_clock_hand`: Clockwork Bearing
- `set_sticky_range`: Linear Chassis, Secondary Linear Chassis, Radial Chassis
- `set_stack_size`: Weighted Ejector

If a command does not appear in tab-completion for the current target block, that block does not support it.

---

## Using Create Commands in Scripts

Create executors work like any other executor, so you can use literals, `value_of(...)`, and conditionals:

```
set_rpm value_of(redstone * 8)
```

```
if redstone > 7 set_rotation_mode ROTATE_PLACE
```

```
if block == create:weighted_ejector set_stack_size 16
```
139 changes: 139 additions & 0 deletions projects/assets/zps/1.21/zps/doc/en_us/executors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# Executors

Executors perform an action on the target block. Each takes one argument, which can be a literal or a `value_of()` expression.

Some executors are only available for specific block types. If the target block is not compatible, the executor is silently skipped.

---

## All Blocks

Available on: any target block

| Executor | Argument | Description |
|----------------|----------|-------------------------------------------------|
| `set_redstone` | `<0-15>` | The Serial Bus emits a redstone signal into the target block, like a repeater facing it. |
| `request_value` | `<value>` | The Serial Bus answers with the value, for a Script Terminal's `receive_value`. See [Variables](syntax.md#variables). |

Examples:

```
set_redstone 15
set_redstone value_of(page_number - 1)
if pos == @lectern request_value value_of(page_number)
```

---

## Data Lectern / Lectern

The following commands require the target block to be a `Data Lectern` or a regular `Lectern` with a book.

| Executor | Argument | Description |
|--------------|------------|----------------------------------------------------------------------|
| `set_page` | `<1-100>` | Sets the current page of the book in the lectern. Pages are 1-based. |
| `write_page` | `<string>` | Writes text to the current page, replacing its existing content. |

Examples:

```
set_page 1
set_page value_of(redstone + 1)
```

```
write_page "Hello, world!"
write_page value_of(dimension as_string)
```

---

## Script Terminal

The following command requires the target block to be a `Script Terminal`.

| Executor | Argument | Description |
|---------------|------------|-------------|
| `load_script` | `<string>` | Replaces the terminal's script, as if a player loaded it from a `.mungus` file. |

The string's lines are the script's lines; in a quoted string, write a line break as `\n`. If the first line is a header such as `# 4t REPEAT` or `# 8t IMPULSE`, it sets the terminal's delay and mode and is not part of the script. Without a header, the terminal keeps its current delay and mode. A header delay other than 2, 4, 8 or 16 keeps the current delay.

Inside a quoted string, write `"` as `\"` and `\` as `\\`, so an escape inside the loaded script is written `\\n`. A value from `value_of()` needs no escaping: its line breaks and backslashes arrive as they are. Loading the script the terminal already has, with the same delay and mode, changes nothing. Scripts over 32500 characters are skipped, and one line on the cable holds at most 3600 characters.

Examples:

```
load_script "# 4t REPEAT\nif redstone > 0 set_redstone 15"
load_script "write_page \"hi (there)\""
load_script value_of(code)
```

Copying one terminal to another, with a Serial Bus facing each:

```
#var code = none
if pos == @source request_value value_of(script_contents)
receive_value code
if pos == @copy load_script value_of(code)
```

---

## Radio Transmitter / Radio Receiver

The following command requires the target block to be a `Radio Transmitter` or `Radio Receiver`.

| Executor | Argument | Description |
|-----------------|---------------|-----------------------------------------------|
| `set_frequency` | `<frequency>` | Sets the radio channel the block is tuned to (an integer from 1 to 64). |

Example:

```
set_frequency 10
```

---

## Robotic Arm

The following commands require the target block to be a `Robotic Arm`.

Unlike other executors, the argument is a **block position** (`x y z`) telling the arm which block to act on, not a value applied to the arm itself. The arm first swings its hand to that position, then performs the action. The target must be within 4 blocks of the arm; positions out of range are skipped. The arm can only accept commands that require it to move `once every 16 ticks`.

| Executor | Argument | Description |
|---------------|-----------|---------------------------------------------------------------------------------------------------|
| `take_items` | `<x y z>` | Pulls items from the inventory at the target position into the arm's hand. |
| `put_items` | `<x y z>` | Deposits the arm's held items into the inventory at the target position. |
| `use` | `<x y z>` | Right-clicks the target with the held item (place a block, fill/empty a bucket, use an item, ...). |
| `shift_use` | `<x y z>` | Sneak right-clicks the target with the held item. |
| `drop_items` | `<x y z>` | Drops held items into the world at the target position as item entities. |
| `break` | `<x y z>` | Breaks the target block at once, as if mining it with an iron pickaxe. Drops go into the hand. |
| `silk_break` | `<x y z>` | Like `break`, but with a silk touch iron pickaxe, so the block itself drops (glass, stone, ores). |
| `set_transfer_count` | `<int>` | Sets the maximum stack size moved by `take_items`, `put_items`, and `drop_items` (1-64). |

`take_items`, `put_items`, and `drop_items` move at most the **transfer amount** configured in the arm's GUI (1–64) per instruction; any remainder stays in the arm's hand. `use` and `shift_use` interact with the held item and do not transfer a quantity.

`break` and `silk_break` only break blocks an iron pickaxe can mine; the hand still moves to anything else but leaves it. Drops that don't fit in the hand fall into the world.

Examples:

```
take_items 1 3 5
put_items 0 1 2
set_transfer_count 16
drop_items 0 2 2
break 1 1 3
silk_break 1 2 3
```

```
use 0 1 2
use value_of(pos offset_y 1)
```

---

## Additional Executors

- [Create](create.md) — auto-generated executors for Create mod blocks (`set_rpm`, `set_filter`, `set_rotation_mode`, ...)
69 changes: 69 additions & 0 deletions projects/assets/zps/1.21/zps/doc/en_us/genesis.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Genesis Integration

When [Genesis](https://modrinth.com/mod/genesis) is loaded, commands for querying celestial bodies become available.

---

## Getter

| Getter | Output | Description |
|-------------|------------|---------------------------------------------------------------|
| `celestial` | Celestials | This is the starting point for all Genesis celestial queries. |

---

## Celestials Mappers

Produced by: `celestial`

| Mapper | Output | Description |
|--------|--------|-------------|
| `current` | Celestial | Returns the celestial body associated with the current dimension, or null if the current dimension is not a celestial surface. |
| `nearest` | Celestial | Returns the nearest celestial body to the target block's position. Useful in the space dimension, where `current` returns null. |
| `of <celestial_id>` | Celestial | Returns a specific celestial body by its resource location. |

Examples:

```
if celestial current == genesis:moon set_redstone 15
```

```
if celestial nearest size > 0 set_redstone 15
```

```
if celestial of genesis:moon gravity < 0.5 set_redstone 15
```

---

## Celestial Mappers

Produced by: `celestial current`, `celestial nearest`, `celestial of <celestial_id>`

| Mapper | Output | Description |
|--------|--------|-------------|
| `gravity` | Double | Surface gravity of the celestial body, as a multiplier on vanilla gravity (the overworld is 1) |
| `size` | Double | Diameter of the celestial body in blocks |
| `is_visitable` | Boolean | True if the body has a dimension of its own to arrive in |
| `pos` | Vec Pos | The celestial body's current position in the space dimension |
| `as_string` | String | The resource location of the celestial body |
| `== <celestial_id>` | Boolean | True if equal to the given celestial |

Examples:

```
if celestial current gravity < 0.5 set_redstone 15
if celestial current is_visitable set_redstone 15
```

---

## Null Safety

If `current` or `nearest` returns null (e.g. no celestial is associated with the current dimension), all subsequent celestial mappers return safe defaults:
- Numeric mappers return `0` or `0.0`
- Boolean mappers return `false`
- String mappers return an empty string
- `pos` returns `Vec3.ZERO`
Loading
Loading