This is an old revision of the document!
Table of Contents
ZZT Enhancer's ZZT-OOP enhancements
This article is a stub. You can help by reverse-engineering things.
General principles
- ZZT Enhancer commands are prefixed with
']
. This makes regular ZZT see them as comments, due to the preceding apostrophe. Prefixing the ZZT Enhancer command with ' makes its parser also treat it as a comment. - Variables must always be specified in quotes, like
']add “stones” 1
.
Variables
TODO (potential names: lastmx
, lastmy
, songpos
, songrow
, songvol
, enhancer
, playerx
, playery
, playerdist
)
Commands
ne, sw, se, nw
TODO
tn, ts, te, tw
TODO
tne, tsw, tse, tnw
TODO
activate
Takes two arguments.
add
Syntax: add “variable” x
Adds x
to “variable”
.
addcstat
Takes five arguments.
allocscreen
Takes one argument.
becomeb
Takes two arguments.
becomeo
Takes five arguments.
bgfade
Takes four arguments.
blinkmode
Takes one argument.
border
Takes one argument.
changeb
Takes four arguments.
charedit
Takes three arguments.
charid
Takes two arguments.
chstr
Takes one argument.
color, colour
Syntax: color x
Sets the color value of the tile to x
.
colorxy, colourxy
Takes three arguments.
cropscreen
Takes seven arguments.
defaultpal
Takes no arguments.
delete
Syntax: delete “variable”
Deletes the variable “variable”
.
dieitem
Takes no arguments.
divide
Syntax: divide “variable” x
Divides “variable”
by x
.
dualfont
Takes no arguments.
dup
Takes three or four arguments.
enhance
TODO
enhancedlogo
Takes one argument.
eraseplayer
Takes no arguments.
extern
Takes between one and eight arguments.
externc
Takes between one and eight arguments.
freescreen
Takes no arguments.
freewav
Takes one argument.
global
Takes no arguments.
goto
Takes one argument.
if
Operators:
==
- equal!=
- not equal>=
- greater than or equal⇐
- smaller than or equal»
- greater than«
- smaller than
ifat
Syntax: ifat x y element color command
.
If, at location x
, y
, there is an element element
of color color
, execute command
.
ifbup
Takes two arguments.
ifoat
Takes six arguments.
ifoup
Takes four arguments.
jump
Takes two arguments.
keyvar
Takes two arguments.
keyvard
Takes one argument.
loadfont
Takes two arguments.
loadfontres
Takes two arguments.
loadpal
Takes one argument.
loadpalres
Takes one argument.
loadscreen
Takes one argument.
loadscreenres
Takes two arguments.
loadwav
Takes two arguments.
loadwavres
Takes two arguments.
lockplayer
Takes one argument.
mainfont
Takes one argument.
mod
Takes two arguments.
mousepoll
Takes one argument.
moveplayer
Syntax: moveplayer x y
Moves the player to location x
, y
.
moveplayerhere
Takes no arguments.
multiply
TODO: Is mul also valid?
Syntax: multiply “variable” x
Multiplies “variable”
by x
.
playerchar
Takes one argument.
playercharn, playerchars, playerchare, playercharw
Takes one argument.
playercol
Takes one argument.
playsong
Syntax: playsong filename
.
Plays the song filename
.
playsongres
Takes one argument.
playwav
Takes five arguments.
putblock
Takes four arguments.
putcolor, putcolour
Takes three arguments.
putmes
Takes three arguments.
putobj
Takes seven arguments.
putobjup
Takes five arguments.
putsave
Takes five arguments.
puttext
Syntax: puttext x y color text
Puts the “text
” string in color color
location x
, y
.
putval
Takes four arguments.
random
Takes two arugments.
rel
Takes the following types of arguments: player
, self
, or <x> <y>
.
Makes future “x, y” location arguments be calculated relative to the provided target.
restorescreen
Takes three arguments.
rgb
Takes four arguments.
savescreen
Takes five arguments.
scrollchar
Takes four arguments.
secfont
Takes one argument.
set
Syntax: set “variable” x
Sets the variable “variable”
to the value x
.
setcoli
Syntax: setcoli c x
Sets the intensity of color c
to x
(0 - 100).
setmusicvol
Syntax: setmusicvol x
Sets the music volume to x
(0 - 100).
setpali
Syntax: setpali x
Sets the global palette intensity to x
(0 - 100).
setsongpos
Takes one argument.
singlefont
Takes no arguments.
showpal
Takes no arguments.
statvar
Takes two arguments.
stopsong
Stops the currently playing song.
subtract
Syntax: subtract “variable” x
Subtracts x
from “variable”
.
teleport
Takes four arguments.
uneraseplayer
Takes two arguments.
unlockplayer
Takes no arguments.
varstat
Takes two arguments.
walk
Takes two arguments.
walkxy
Takes four arguments.