Change: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{DISPLAYTITLE:change}} | {{DISPLAYTITLE:change}} | ||
'''#change''' is a [[ZZT-OOP]] command that lets you change all instances of a given element with another element. | '''#change''' is a [[ZZT-OOP]] command that lets you change all instances of a given element [[kind]] with another element. | ||
== Syntax == | == Syntax == | ||
<code>#change | <code>#change <source kind> <target kind></code> | ||
An empty string is treated as equivalent to a [[Edge|board edge]]. Providing an invalid [[kind]] will throw a <code>Bad #CHANGE</code> error. | |||
== Bugs/Quirks == | == Bugs/Quirks == | ||
* ZZT has a limit of 150 stats. If you try to #change statless elements into statful ones, it will only produce them up to that limit - the remaining elements will be turned to [[Empty|Empties]] instead. | * ZZT has a limit of 150 [[stat|stats]]. If you try to #change statless elements into statful ones, it will only produce them up to that limit - the remaining elements will be turned to [[Empty|Empties]] instead. | ||
* Due to a bug, errors thrown by #change do not stop execution of the command! This can cause uninitialized memory to be used as the element and/or color arguments - causing unexpected behaviour and, potentially, crashes. | * Due to a bug, errors thrown by #change do not stop execution of the command! This can cause uninitialized memory to be used as the element and/or color arguments - causing unexpected behaviour and, potentially, crashes. | ||
{{ZZT-OOP navbox}} | {{ZZT-OOP navbox}} | ||
Latest revision as of 11:10, 24 December 2025
#change is a ZZT-OOP command that lets you change all instances of a given element kind with another element.
Syntax
#change <source kind> <target kind>
An empty string is treated as equivalent to a board edge. Providing an invalid kind will throw a Bad #CHANGE error.
Bugs/Quirks
- ZZT has a limit of 150 stats. If you try to #change statless elements into statful ones, it will only produce them up to that limit - the remaining elements will be turned to Empties instead.
- Due to a bug, errors thrown by #change do not stop execution of the command! This can cause uninitialized memory to be used as the element and/or color arguments - causing unexpected behaviour and, potentially, crashes.
| ZZT-OOP | |
|---|---|
| Prefixes |
|
| Messages | |
| Directions | |
| Flags | |
| Commands | |