home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / GAMES_A / ZZTTOOL.ZIP / ZZTTRICK.DOC < prev   
Text File  |  1994-01-01  |  13KB  |  400 lines

  1. ---Zzttrick.Doc
  2. ---
  3. ---Interesting Tricks and Techniques for ZZT and Super ZZT Object Programming
  4. ---
  5. ---Copyright 1993 (C) Software Visions,
  6. ---All Rights Reserved.
  7. ---ZZT and Super ZZT are Copyrights of Epic Megagames
  8.  
  9.  
  10. Contained within this document are numerous tricks to help you max out when
  11. programming in ZZT and Super ZZT. They are not arranged in any order, just
  12. the order in which they came to mind, were remembered, or were contributed.
  13.  
  14. #CHANGE LINE LINE
  15.  
  16.    Whenever you #put line or #change something line, (or erase lines) the
  17.    line walls are distorted. Use this command to return them to normal (the
  18.    way they would appear if recently drawn within the editor) You can use
  19.    this for WEB in Super ZZT as well.
  20.  
  21. DIAGONAL MOVEMENT
  22.  
  23.    For an object to move diagonally, simply have it #walk in one direction
  24.    and #go in the other. This is not TRUE diagonal movement; The object
  25.    will not move through walls touching at the corner. Example:
  26.  
  27.    #walk n
  28.    /e       'or #go e
  29.    #walk idle
  30.  
  31.    will have the object move one space to the north east.
  32.  
  33. EASY MOVEMENT (Super ZZT)
  34.  
  35.    In Super ZZT, you often want an object to move many times in a given
  36.    direction. (alas, this trick does not work in ZZT!) To move multiple
  37.    times in a single direction, simply add a number after the direction:
  38.  
  39.    /n 10
  40.  
  41.    will move north ten times. There MUST be a space between the direction
  42.    and the number.
  43.  
  44. MOVE AND MESSAGE (ZZT)
  45.  
  46.    The ZZT version of the above trick can be modified to save a little
  47.    space and confuse editors. In ZZT, if there is any extra numbers or
  48.    letters after a direction, they are interpreted as a message to print
  49.    at the bottom of the screen. If it is a command and it follows
  50.    IMMEDIATELY after the direction, it is interpreted. Examples:
  51.  
  52.    /nBLAH    'North, then print "BLAH"
  53.    /n BLAH   'North, then print " BLAH" (note the leading space)
  54.    /n#play C 'North, then play the note 'C'
  55.    /n #play C'North, then print " #play C"
  56.  
  57. COLOR-CHANGING OBJECTS
  58.    
  59.    How often have you wished you could change the color of an object? Well,
  60.    too bad there's no #color command...But there is something close. Simply
  61.    utilize another object next to the object you wish to change color:
  62.  
  63.    Two objects next to each other:
  64.    OBJECT 1 OBJECT 2
  65.  
  66.    @object1
  67.    #cycle 1
  68.    #end
  69.    :touch
  70.    I will turn red!
  71.    /i/i
  72.    #object2:red
  73.    #end
  74.  
  75.    @object2
  76.    #cycle 1
  77.    #end
  78.    :red
  79.    #put w red object
  80.    #end
  81.  
  82.    As you see here, simply have one object #put an object of a certain color
  83.    OVER an existing object. The object retains it's program and status.
  84.  
  85. SMOOTH FADING
  86.  
  87.    Often, you can use the sequence of SOLID, NORMAL, BREAKABLE, EMPTY to fade
  88.    in and out. For a smoother fade, add WATER between BREAKABLE and EMPTY.
  89.    It sounds wierd, but the water looks like this: ░░░ when used in this
  90.    manner.
  91.  
  92. OBJECT TRANSPORTER
  93.  
  94.    Here's a complex trick that's worth learning. It's a way to transport the
  95.    player to almost anywhere on the current screen. To do this, simply
  96.    have an object #put n player (or whatever direction) This puts a COPY of
  97.    the player. The real player is still in his original position. But as soon
  98.    as he moves, he moves next to the COPY. Have a way of telling when the
  99.    player is there (check for CONTACT or ALLIGNED) then shoot the COPY.
  100.    Voila! Sometimes if you time it fast enough, the player doesn't even have
  101.    to move if he recently pressed an object (or moved) in the right direction.
  102.    This trick works best with experience. (Note- Not tested on Super ZZT)
  103.  
  104. RANDOM MOVEMENT
  105.   
  106.    For easy, totally random movement, use:
  107.  
  108.    #try rndp rndne   'or
  109.    #go rndp rndne
  110.  
  111.    This will move randomly in one of the four possible directions.
  112.  
  113. LABELS
  114.  
  115.    Labels ( :LABEL ) are suspicious to a few small quirks:
  116.  
  117.    1) I have found that the labels of :DIE or :END rarely work as expected.
  118.       It is possible that labels matching ANY commands do not work, although
  119.       I have gotten :PLAY to work. Labels matching commands aren't a good
  120.       idea anyways, since you can't use #label, since it's interpreted as a
  121.       command.
  122.    2) If one label is a subset of another, IE start and startagain, sometimes
  123.       one label will trigger the other.
  124.    3) Labels are not case sensitive.
  125.  
  126.    You do know, BTW, that you can use #label instead of #send:label? And you 
  127.    can use #object:message instead of #send object:message.
  128.  
  129. TWO VOICE MUSIC
  130.  
  131.    By using thirtysecond notes ('T') you can simulate a form of multiple
  132.    voices on the PC speaker. Example: To play the notes A and C 
  133.    "simultaneously", use:
  134.  
  135.    #play T ACACACAC
  136.  
  137.    for a quarter note. For parts with only one note playing, either
  138.    interleave with rests, beats, or with itself.
  139.  
  140. RANDOMNESS
  141.   
  142.    Although you know how to MOVE randomly, what about random events? Simply
  143.    use "BLOCKED". If an object is blocked on the north, but not on the east,
  144.    (fake walls are of a good use here) then:
  145.  
  146.    #if blocked rndne label
  147.  
  148.    will go to "label" 50% of the time. With a little creativity, you can
  149.    create easy casinos, slot machines, and other "random" games and events.
  150.  
  151. LOOP THE LOOP
  152.  
  153.    Often one uses a loop to check for something:
  154.  
  155.    :loop
  156.    #if not alligned loop
  157.  
  158.    will cycle endlessly waiting to be alligned. But only a few of these
  159.    REALLY slows the game down. You should insert some sort of wait-
  160.    
  161.    #cycle 1
  162.    :loop
  163.    /i
  164.    #if not alligned loop
  165.  
  166.    Since the player moves at "cycle 1", you do not lose anything.
  167.  
  168. INVISIBLE FLAGS
  169.  
  170.    Since the flag limit is fairly small, especially for ZZT, sometimes you
  171.    need to use methods to reduce flag usage. To create a pseudo-flag,
  172.    put an INVISIBLE in a color not used, then check for it's presence to
  173.    see if the flag is "set" or not. These flags are board-specific- They
  174.    only affect the current board. They also require a blank area where the
  175.    player never goes. Example:
  176.  
  177.    @invisflag
  178.    #cycle 1
  179.    #end
  180.    'Put this object in an unaccessible area with
  181.    'an "empty" above it, and no other yellow
  182.    'invisibles on-screen
  183.    :iset
  184.    #put n yellow invisible
  185.    #end
  186.    :iclear
  187.    #put n empty
  188.    #end
  189.  
  190.    To set this flag, use #invisflag:iset. To clear, use #invisflag:iclear.
  191.    To check, use #if any yellow invisible.
  192.  
  193. UNDOCUMENTED IFS
  194.  
  195.    There are a few undocumented IF conditions:
  196.  
  197.    #if any [color] thing label
  198.    #if not any [color] thing label
  199.  
  200.    These check for the presence (or absence) of a certain type of object.
  201.  
  202. PRE-CANNED LABELS
  203.  
  204.    Not exactly pre-canned, but pre-zapped labels can be created by simply
  205.    using ' instead of : IE making it into a comment. This is, in effect,
  206.    what #zap does to begin with.
  207.  
  208. PIGGYBACKING FLAGS
  209.  
  210.    Sometimes you can double up on flags. Say there is an ORB and a SWORD
  211.    you can collect. This could allow three combos: ORB, SWORD, and BOTH.
  212.    So the programs could be:
  213.  
  214.    @orb
  215.    #end
  216.    :touch
  217.    You grab the orb.
  218.    #if SWORD piggy
  219.    #set ORB
  220.    #die
  221.    :piggy
  222.    #clear SWORD
  223.    #set ORBSWORD
  224.    #end
  225.  
  226.    @sword
  227.    #end
  228.    :touch
  229.    You equip the sword.
  230.    #if ORB piggy
  231.    #set SWORD
  232.    #die
  233.    :piggy
  234.    #clear ORB
  235.    #set ORBSWORD
  236.    #end
  237.  
  238.    Now, to check for the orb, you must check for both ORB and ORBSWORD. It
  239.    adds extra programming, but is worth the gain of a flag in ZZT.
  240.  
  241. DOUBLE FLAGS
  242.  
  243.    You never want to #set a flag twice, even accidentally, because it takes
  244.    up two flags instead of one. Instead, whenever you #set a flag and there
  245.    is even the SLIGHTEST chance it could already be set, #clear it first.
  246.    #clearing a flag that is already clear, fortunately, has no ill effects.
  247.  
  248. SEQUENCING FLAGS
  249.  
  250.    A twist on piggy backing, sequencing is used when one object infers
  251.    another. Example: There is a HILT, and a BLADE, but you need the HILT to
  252.    get the BLADE.
  253.  
  254.    @hilt
  255.    #end
  256.    :touch
  257.    You grab the hilt.
  258.    #set HILT
  259.    #end
  260.  
  261.    @blade
  262.    #end
  263.    :touch
  264.    #if not HILT oops
  265.    You stick the blade onto the hilt!
  266.    #clear HILT
  267.    #set SWORD
  268.    #end
  269.    :oops
  270.    You need a hilt to stick on the blade.
  271.    #end
  272.  
  273.    Now, the flag HILT means you have just the HILT, while SWORD means you
  274.    have the hilt and the blade both. Another flag conserved!
  275.  
  276. INVISIBLE INVISIBLES
  277.  
  278.    Invisible walls are great, but what if you want a TRUE invisible wall,
  279.    one that simply blocks, not appears? In the editor, use white text and
  280.    draw a space. But in the game it doesn't seem simple- there is no way
  281.    to #put text. But there is a solution. Use #put n green to put an
  282.    invisible "green" wall. Not sure how to get rid of them other than
  283.    #put'ting an empty over them.
  284.  
  285. HUNGRY PUSHERS
  286.  
  287.    Pushers eat gems, it's a fact of ZZT. If a pusher cannot move further but
  288.    there are gems in the series of blocks it is pushing, the gems will be
  289.    crushed. Strangely, if the pusher is right next to a lone gem, the gem
  290.    is safe. The player can crush gems with boulders and sliders as well.
  291.  
  292. STUPID OBJECTS
  293.  
  294.    Objects can be real stupid; They will keep running into a wall over and
  295.    over. If you use the label :thud, you should put #lock or #zap thud
  296.    (depending on the situation) to prevent the object from returning to
  297.    :thud over and over and over... (remember to #unlock or #restore thud
  298.    when done!)
  299.  
  300. HIDDEN PASSAGES
  301.  
  302.    Within S-TOOL-K.ZZT, there is a colored passages screen. If you select
  303.    one that is single color (looks like a solid block) then place it, you
  304.    can later have an object #put n blue passage (or any other color or
  305.    direction) on top of it. The passage will lead in the proper direction,
  306.    but will now be visible.
  307.  
  308. LOCK OR ZAP?
  309.  
  310.    When an object is :touch'ed, you should usually #lock to prevent multiple
  311.    touches. But sometimes you should use #zap touch instead, to allow other
  312.    objects to still send messages to the object. Don't use #zap touch, of
  313.    course, if there are more touch labels later on.
  314.  
  315. DESTROYING BLINKWALLS
  316.  
  317.    When you #change blinkwall empty, sometimes the blinkwall disappears, but
  318.    often the wall part remains. So far, there are only two known methods to
  319.    prevent this:
  320.  
  321.    1) Have an object clean up after the wall, IE go along #put'ting emptys
  322.       where the wall used to be.
  323.    2) First put a boulder directly in front of the blink wall to block the
  324.       wall, THEN #change it.
  325.  
  326. WILD TRANSPORTERS
  327.  
  328.    When you #change whatever transport, you get a neat looking transporter
  329.    that seems to switch between north-facing and south-facing. It seems to
  330.    be useless, but it sure looks neat...
  331.  
  332. A COLORFUL LIFE
  333.  
  334.    Although using S-TOOL-K.ZZT is the best way to get special colors,
  335.    sometimes you need to make special colors appear while playing. To do
  336.    this, #put one of the following objects then #change it or #put something
  337.    over it of the desired type.
  338.  
  339.    Item          Color
  340.    ----          -----
  341.    Torch         Brown
  342.    Ammo          Dark Cyan
  343.    Energizer     Dark Purple
  344.    Forest        Black on Green
  345.    Shark         Light Grey
  346.    Empty         Black on Grey
  347.  
  348.    If you change one of the above to a door, it will become white flasing on
  349.    a colored background of the color stated (black background for forest or
  350.    empty)
  351.  
  352. BLACK KEYS
  353.   
  354.    In S-TOOL-K.ZZT, there are black keys and doors. These give and take 256
  355.    gems each, respectively. They also show wild messages along the bottom of
  356.    the screen.
  357.  
  358. WACKY BOARD TITLES
  359.  
  360.    For an interesting board title, enter $ then the title. It will appear
  361.    centered and in white. (only in the board list) To have it white but not
  362.    centered, use : then the title. The : will still be there, though. To
  363.    make the board appear as an option, (with a purple arrow) use !title.
  364.    The ! stays, though. To remove the !, use !label;title. Then the !label;
  365.    part is not shown. If this title is selected and there is a board named
  366.    :label, then the first board (!label;Title) is unaccessable! Selecting it
  367.    will instead jump to the :label board. Examples:
  368.  
  369.    Title                 Appearance in Board List            Color
  370.    -----                 ----------------------------------  -----
  371.    Board Title           Board Title                         Yellow
  372.    $Board Title                     Board Title              White
  373.    :Board Title          :Board Title                        White
  374.    !Board Title              !Board Title                   White w/Purple 
  375.    !label;Board Title        Board Title                    White w/Purple 
  376.  
  377. SPREADING WATER
  378.  
  379.    Slimes are an easy way to quickly fill an area with breakables during play.
  380.    But sometimes it would be nice to have slimes leave trails of water, gems,
  381.    solids, bombs, enemies, etc.. (you get the idea)
  382.  
  383.    An easy way to do this:
  384.  
  385.    @Flood
  386.    #cycle 1
  387.    #end
  388.    'This program assumes there are no blue slimes
  389.    'or blue breakables on-screen.
  390.    :go
  391.    #put n blue slime
  392.    :loop
  393.    /i
  394.    'Replace "cyan water" with what you want the
  395.    'slime to leave a trail of.
  396.    #change blue breakable cyan water
  397.    #if any blue slime loop
  398.    Flooded out!
  399.    #end
  400.