User Tools

Site Tools


release:zzt_enhancer:oop_enhancements

This is an old revision of the document!


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)

String IDs

ID String
7 Torches:
8 Gems:
11 T
25 Torch

TODO: Complete list.

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

Syntax: addcstat ypos color char name “variable”

Adds a stat to the sidebar, at Y position ypos, with an icon color, char, name name, tracking variable “variable”.

allocscreen

Takes one argument.

becomeb

Syntax: becomeb element color.

Becomes a statless element of color color.

becomeo

Syntax: becomeo element_id color ??? ??? ???

Becomes a statted element with the specified parameters.

bgfade

Takes four arguments.

blinkmode

Takes one argument.

border

Takes one argument.

changeb

Syntax: changeb from_element from_color to_element to_color.

Changes all instances of a given element ID and color to the other element ID and color. ? may be used as a wildcard in from_color. Faster than ZZT #change.

TODO: Can ? be used elsewhere?

charedit

Takes three arguments.

charid

Takes two arguments.

chstr

Syntax: chstr string_id contents

Replaces the string with ID string_id with contents.

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”.

deletecstat

Seemingly not implemented as of Enhancer 0.3b. TODO: Verify

Syntax: deletecstat ypos

Removes the custom stat at ypos.

dieitem

Syntax: dieitem

Destroys the object and moves stat 0 - the player - to its location.

divide

Syntax: divide “variable” x

Divides “variable” by x.

dualfont

Takes no arguments.

dup

Takes three or four arguments.

enhance

TODO

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

Syntax: playsongres resource_index.

Playes the song at asset index resource_index.

playwav

Takes five arguments.

putblock

Syntax: putblock x y element color.

Place a statless element of color color at position x, y.

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

Syntax: rgb id r g b

Set the color id to color values r, g, b (range 0-63).

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

Syntax: walk x y

Sets the walking direction to x, y. For instance, walk -1 -1 will cause the object to walk north-west.

walkxy

Takes four arguments.

release/zzt_enhancer/oop_enhancements.1622283852.txt.gz · Last modified: 2021/05/29 10:24 by asie