Skip to content

Commit

Permalink
Document maxbuildheight variable
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick <cowinkkeydinkinc@gmail.com>
  • Loading branch information
CoWinkKeyDinkInc committed Mar 17, 2024
1 parent bd3751a commit 2783b68
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/modules/mechanics/variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ You can define as many variables as you want and all variables must have a scope
| `<variable/>` | An individual variable. |
| `<score/>` | A score variable, allowing direct access to competitor's score. This is automatically scoped to teams. |
| `<timelimit/>` | A time limit variable which starts/stops the time limit of the match. |
| `<maxbuildheight/>` | A variable that sets the build height of the map. |
| `<with-team/>` | A team-rescoping variable that allows using a specific team's value from a different team-scoped variable as a match-scoped variable. |
</div>

Expand Down Expand Up @@ -156,6 +157,22 @@ can be ended by setting the value to `0`.
</actions>
```

### Maxbuildheight Variable
The `maxbuildheight` variable will give a height limit for placing blocks
after being set to a certain value.

```xml
<variables>
<maxbuildheight id="build-limit"/>
</variable>
<actions>
<action id="increase-buildheight" scope="match" expose="true">
<!-- Adds 1 to the current height, up to a maximum of 55 -->
<set var="build-limit" value="min(55,whatever+1"/>
</action>
</actions>
```

### Team-Rescoping Variables
Whenever `some-filter` matches for a player (e.g. entering a region), it will trigger an action that sets red team's score to exactly 10, then adds 5 to the score of the team the player is in.
In short, if a player in red team triggers `some-filter`, red is reset to 10 + 5 = 15, no other scores are affected.
Expand Down

0 comments on commit 2783b68

Please sign in to comment.