HyperScript 1.5.4
Version 1.5.4
Big change
Check your scripts before updating to 1.5.4
Braces now mean variables and nothing else. Built-in values such as the player's name are no longer written with braces:
| Before 1.5.4 | From 1.5.4, inside text | From 1.5.4, in code |
|---|---|---|
%{player.name}% | %player.name% | player.name |
%{server.tps}% | %server.tps% | server.tps |
%{arg.1}% | %arg.1% | arg.1 |
%{event.message}% | %event.message% | event.message (or just message) |
- Your own variables are unchanged:
{player.coins},{global.event_active}and, inside text,%{player.coins}%. - Scripts written for older versions need updating. A script that still writes a built-in value in braces does not load; the error names the line and shows how to write it instead, for example
{player.name} is a built-in value, not a variable. Write it as player.name in code and as %player.name% inside text. %player.name%is also accepted in code, so only the braces have to go.- A variable can now have any name that is not a built-in, including ones starting with
event.orserver.. - The bundled
demo.hsuses the new style. A copy already installed on a server is not replaced automatically; delete it and restart to get the new one, or edit it.
Changed (check existing scripts)
Braces now mean variables and nothing else. Built-in values such as the player's name are no longer written with braces:
| Before 1.5.4 | From 1.5.4, inside text | From 1.5.4, in code |
|---|---|---|
%{player.name}% | %player.name% | player.name |
%{server.tps}% | %server.tps% | server.tps |
%{arg.1}% | %arg.1% | arg.1 |
%{event.message}% | %event.message% | event.message (or just message) |
- Your own variables are unchanged:
{player.coins},{global.event_active}and, inside text,%{player.coins}%. - Scripts written for older versions need updating. A script that still writes a built-in value in braces does not load; the error names the line and shows how to write it instead, for example
{player.name} is a built-in value, not a variable. Write it as player.name in code and as %player.name% inside text. %player.name%is also accepted in code, so only the braces have to go.- A variable can now have any name that is not a built-in, including ones starting with
event.orserver.. - The bundled
demo.hsuses the new style. A copy already installed on a server is not replaced automatically; delete it and restart to get the new one, or edit it.
Added
- Parts of a location can be read and changed:
add 1 to y of {_loc},set x of {_loc} to 0,subtract 5 from z of {player.home}, and as valuesy of {_loc}andworld of {_loc}. - Clearer errors when types are mixed up. Adding a number to a whole location, or doing math on an item, stops the trigger and logs what went wrong with both kinds of value named, for example
Cannot add a number to a location (world 10.5, 64, -3.25). To change one coordinate, name it: add 1 to y of <variable>. log-script-errorsinconfig.yml(defaulttrue). Set it tofalseto hide warnings about scripts that fail while running. The failing trigger still stops; mistakes found when a script is loaded are always reported.argscan be written on its own in code for all command arguments together.
Unchanged, for the record
- A variable whose name starts with
_is local: it lasts for one run of the trigger and is never saved.{_loc}and_locare the same variable. This was already the case.