home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #1
/
monster.zip
/
monster
/
GAMES_A
/
ZZTTOOL.ZIP
/
ZZTTRICK.DOC
< prev
Wrap
Text File
|
1994-01-01
|
13KB
|
400 lines
---Zzttrick.Doc
---
---Interesting Tricks and Techniques for ZZT and Super ZZT Object Programming
---
---Copyright 1993 (C) Software Visions,
---All Rights Reserved.
---ZZT and Super ZZT are Copyrights of Epic Megagames
Contained within this document are numerous tricks to help you max out when
programming in ZZT and Super ZZT. They are not arranged in any order, just
the order in which they came to mind, were remembered, or were contributed.
#CHANGE LINE LINE
Whenever you #put line or #change something line, (or erase lines) the
line walls are distorted. Use this command to return them to normal (the
way they would appear if recently drawn within the editor) You can use
this for WEB in Super ZZT as well.
DIAGONAL MOVEMENT
For an object to move diagonally, simply have it #walk in one direction
and #go in the other. This is not TRUE diagonal movement; The object
will not move through walls touching at the corner. Example:
#walk n
/e 'or #go e
#walk idle
will have the object move one space to the north east.
EASY MOVEMENT (Super ZZT)
In Super ZZT, you often want an object to move many times in a given
direction. (alas, this trick does not work in ZZT!) To move multiple
times in a single direction, simply add a number after the direction:
/n 10
will move north ten times. There MUST be a space between the direction
and the number.
MOVE AND MESSAGE (ZZT)
The ZZT version of the above trick can be modified to save a little
space and confuse editors. In ZZT, if there is any extra numbers or
letters after a direction, they are interpreted as a message to print
at the bottom of the screen. If it is a command and it follows
IMMEDIATELY after the direction, it is interpreted. Examples:
/nBLAH 'North, then print "BLAH"
/n BLAH 'North, then print " BLAH" (note the leading space)
/n#play C 'North, then play the note 'C'
/n #play C'North, then print " #play C"
COLOR-CHANGING OBJECTS
How often have you wished you could change the color of an object? Well,
too bad there's no #color command...But there is something close. Simply
utilize another object next to the object you wish to change color:
Two objects next to each other:
OBJECT 1 OBJECT 2
@object1
#cycle 1
#end
:touch
I will turn red!
/i/i
#object2:red
#end
@object2
#cycle 1
#end
:red
#put w red object
#end
As you see here, simply have one object #put an object of a certain color
OVER an existing object. The object retains it's program and status.
SMOOTH FADING
Often, you can use the sequence of SOLID, NORMAL, BREAKABLE, EMPTY to fade
in and out. For a smoother fade, add WATER between BREAKABLE and EMPTY.
It sounds wierd, but the water looks like this: ░░░ when used in this
manner.
OBJECT TRANSPORTER
Here's a complex trick that's worth learning. It's a way to transport the
player to almost anywhere on the current screen. To do this, simply
have an object #put n player (or whatever direction) This puts a COPY of
the player. The real player is still in his original position. But as soon
as he moves, he moves next to the COPY. Have a way of telling when the
player is there (check for CONTACT or ALLIGNED) then shoot the COPY.
Voila! Sometimes if you time it fast enough, the player doesn't even have
to move if he recently pressed an object (or moved) in the right direction.
This trick works best with experience. (Note- Not tested on Super ZZT)
RANDOM MOVEMENT
For easy, totally random movement, use:
#try rndp rndne 'or
#go rndp rndne
This will move randomly in one of the four possible directions.
LABELS
Labels ( :LABEL ) are suspicious to a few small quirks:
1) I have found that the labels of :DIE or :END rarely work as expected.
It is possible that labels matching ANY commands do not work, although
I have gotten :PLAY to work. Labels matching commands aren't a good
idea anyways, since you can't use #label, since it's interpreted as a
command.
2) If one label is a subset of another, IE start and startagain, sometimes
one label will trigger the other.
3) Labels are not case sensitive.
You do know, BTW, that you can use #label instead of #send:label? And you
can use #object:message instead of #send object:message.
TWO VOICE MUSIC
By using thirtysecond notes ('T') you can simulate a form of multiple
voices on the PC speaker. Example: To play the notes A and C
"simultaneously", use:
#play T ACACACAC
for a quarter note. For parts with only one note playing, either
interleave with rests, beats, or with itself.
RANDOMNESS
Although you know how to MOVE randomly, what about random events? Simply
use "BLOCKED". If an object is blocked on the north, but not on the east,
(fake walls are of a good use here) then:
#if blocked rndne label
will go to "label" 50% of the time. With a little creativity, you can
create easy casinos, slot machines, and other "random" games and events.
LOOP THE LOOP
Often one uses a loop to check for something:
:loop
#if not alligned loop
will cycle endlessly waiting to be alligned. But only a few of these
REALLY slows the game down. You should insert some sort of wait-
#cycle 1
:loop
/i
#if not alligned loop
Since the player moves at "cycle 1", you do not lose anything.
INVISIBLE FLAGS
Since the flag limit is fairly small, especially for ZZT, sometimes you
need to use methods to reduce flag usage. To create a pseudo-flag,
put an INVISIBLE in a color not used, then check for it's presence to
see if the flag is "set" or not. These flags are board-specific- They
only affect the current board. They also require a blank area where the
player never goes. Example:
@invisflag
#cycle 1
#end
'Put this object in an unaccessible area with
'an "empty" above it, and no other yellow
'invisibles on-screen
:iset
#put n yellow invisible
#end
:iclear
#put n empty
#end
To set this flag, use #invisflag:iset. To clear, use #invisflag:iclear.
To check, use #if any yellow invisible.
UNDOCUMENTED IFS
There are a few undocumented IF conditions:
#if any [color] thing label
#if not any [color] thing label
These check for the presence (or absence) of a certain type of object.
PRE-CANNED LABELS
Not exactly pre-canned, but pre-zapped labels can be created by simply
using ' instead of : IE making it into a comment. This is, in effect,
what #zap does to begin with.
PIGGYBACKING FLAGS
Sometimes you can double up on flags. Say there is an ORB and a SWORD
you can collect. This could allow three combos: ORB, SWORD, and BOTH.
So the programs could be:
@orb
#end
:touch
You grab the orb.
#if SWORD piggy
#set ORB
#die
:piggy
#clear SWORD
#set ORBSWORD
#end
@sword
#end
:touch
You equip the sword.
#if ORB piggy
#set SWORD
#die
:piggy
#clear ORB
#set ORBSWORD
#end
Now, to check for the orb, you must check for both ORB and ORBSWORD. It
adds extra programming, but is worth the gain of a flag in ZZT.
DOUBLE FLAGS
You never want to #set a flag twice, even accidentally, because it takes
up two flags instead of one. Instead, whenever you #set a flag and there
is even the SLIGHTEST chance it could already be set, #clear it first.
#clearing a flag that is already clear, fortunately, has no ill effects.
SEQUENCING FLAGS
A twist on piggy backing, sequencing is used when one object infers
another. Example: There is a HILT, and a BLADE, but you need the HILT to
get the BLADE.
@hilt
#end
:touch
You grab the hilt.
#set HILT
#end
@blade
#end
:touch
#if not HILT oops
You stick the blade onto the hilt!
#clear HILT
#set SWORD
#end
:oops
You need a hilt to stick on the blade.
#end
Now, the flag HILT means you have just the HILT, while SWORD means you
have the hilt and the blade both. Another flag conserved!
INVISIBLE INVISIBLES
Invisible walls are great, but what if you want a TRUE invisible wall,
one that simply blocks, not appears? In the editor, use white text and
draw a space. But in the game it doesn't seem simple- there is no way
to #put text. But there is a solution. Use #put n green to put an
invisible "green" wall. Not sure how to get rid of them other than
#put'ting an empty over them.
HUNGRY PUSHERS
Pushers eat gems, it's a fact of ZZT. If a pusher cannot move further but
there are gems in the series of blocks it is pushing, the gems will be
crushed. Strangely, if the pusher is right next to a lone gem, the gem
is safe. The player can crush gems with boulders and sliders as well.
STUPID OBJECTS
Objects can be real stupid; They will keep running into a wall over and
over. If you use the label :thud, you should put #lock or #zap thud
(depending on the situation) to prevent the object from returning to
:thud over and over and over... (remember to #unlock or #restore thud
when done!)
HIDDEN PASSAGES
Within S-TOOL-K.ZZT, there is a colored passages screen. If you select
one that is single color (looks like a solid block) then place it, you
can later have an object #put n blue passage (or any other color or
direction) on top of it. The passage will lead in the proper direction,
but will now be visible.
LOCK OR ZAP?
When an object is :touch'ed, you should usually #lock to prevent multiple
touches. But sometimes you should use #zap touch instead, to allow other
objects to still send messages to the object. Don't use #zap touch, of
course, if there are more touch labels later on.
DESTROYING BLINKWALLS
When you #change blinkwall empty, sometimes the blinkwall disappears, but
often the wall part remains. So far, there are only two known methods to
prevent this:
1) Have an object clean up after the wall, IE go along #put'ting emptys
where the wall used to be.
2) First put a boulder directly in front of the blink wall to block the
wall, THEN #change it.
WILD TRANSPORTERS
When you #change whatever transport, you get a neat looking transporter
that seems to switch between north-facing and south-facing. It seems to
be useless, but it sure looks neat...
A COLORFUL LIFE
Although using S-TOOL-K.ZZT is the best way to get special colors,
sometimes you need to make special colors appear while playing. To do
this, #put one of the following objects then #change it or #put something
over it of the desired type.
Item Color
---- -----
Torch Brown
Ammo Dark Cyan
Energizer Dark Purple
Forest Black on Green
Shark Light Grey
Empty Black on Grey
If you change one of the above to a door, it will become white flasing on
a colored background of the color stated (black background for forest or
empty)
BLACK KEYS
In S-TOOL-K.ZZT, there are black keys and doors. These give and take 256
gems each, respectively. They also show wild messages along the bottom of
the screen.
WACKY BOARD TITLES
For an interesting board title, enter $ then the title. It will appear
centered and in white. (only in the board list) To have it white but not
centered, use : then the title. The : will still be there, though. To
make the board appear as an option, (with a purple arrow) use !title.
The ! stays, though. To remove the !, use !label;title. Then the !label;
part is not shown. If this title is selected and there is a board named
:label, then the first board (!label;Title) is unaccessable! Selecting it
will instead jump to the :label board. Examples:
Title Appearance in Board List Color
----- ---------------------------------- -----
Board Title Board Title Yellow
$Board Title Board Title White
:Board Title :Board Title White
!Board Title !Board Title White w/Purple
!label;Board Title Board Title White w/Purple
SPREADING WATER
Slimes are an easy way to quickly fill an area with breakables during play.
But sometimes it would be nice to have slimes leave trails of water, gems,
solids, bombs, enemies, etc.. (you get the idea)
An easy way to do this:
@Flood
#cycle 1
#end
'This program assumes there are no blue slimes
'or blue breakables on-screen.
:go
#put n blue slime
:loop
/i
'Replace "cyan water" with what you want the
'slime to leave a trail of.
#change blue breakable cyan water
#if any blue slime loop
Flooded out!
#end