••••••• ••••••• •• •• ••••••• • •• • • ••• ••• •• •• • • • •
@Flag Memory
#end
$
(I would like to thank Gregory Janson
for making most of these tips.)
$
It's very annoying to only have 9 flags
or less set at a time. You can, however,
#clear a flag and #set another one in its
place. Here are 7 efficient ways of
reducing, re-using, and recycling flags:
$
$List of flag-saving tips
$
1) Deleting old flags
2) #ZAPped flags
3) Environmental flags
4) Sequenced flags
5) Piggybacking flags
6) Inversed flags
7) No doubled flags!
$
$Deleting old flags
$
Be sure you #clear a flag once you are
done with it! For instance, if you get
a golden key, which will #set gkey, make
sure the door it opens will #clear gkey
and get out of the way, unless you want
the key to open all doors of a certain
kind, unlike conventional keys. Another
example is a wild errand run. You go from
one guy to another guy in another room,
to another guy, or back to the first, etc.
The player is a messenger. You can use
flags to determine your position in the
transactions and your deepness within
them. But in all that time, only one flag
remains SET at a time. A good sequence
could be: errand1, errand2, errand3, etc.
$
$#ZAPped flags
$
There are two methods I can think of to
do the job a flag does without using #set
or #clear at all. The first is #ZAPped
flags. If a flag is to be set and checked,
all in the same room, all you must do is
have three parts to your checking program.
A flag-is-cleared section, a flag-cleared-
to-flag-set transition section(with #zap),
and a flag-is-set section. It will start
initially in the flag-is-cleared section.
It is like this:
$
@Checker
#end
:touch
#play t--gc
You need a key!
#end
$
It is missing one line: #if <flag> then
<message>. Well, check the SETting object!
$
@Key
#end
:touch
#Checker:setflag
#play t+cegcegceg+sc
You got the key!
#die
$
This will shed light on the two other
sections of the door:
$
@Checker
#end
:touch
#play t--gc
You need a key!
#end
:setflag
#zap touch
#end
:touch
The door opens!
#play tcgbcgb+ic
#die
$
See? No #set, no #clear, and no #if! The
setter SENDS A MESSAGE to the door to open
next time the player touches it!
$
$Environmental flags
$
The second method is environmental
flags. Be aware that both of these
will only do the job of a flag that is
only needed in one room, and set in the
same room. They cannot be accessed in
remote rooms. So the environmental flag
method is as follows:
$
@Invisflag
#end
:iset
*#put <direction> <type1>
#end
:iclear
*#put <direction> <type2>
#end
:icheck
#if blocked <direction> isset
#Checker:isclear
#end
:isset
#Checker:isset
#end
$
There are many ways to modify the above
program. For one, you could add more flags
for the object to set by copying over each
of the sections, changing <direction> each
time:
$
@Invisflag
#end
:iset1
#put n invisible
#end
:iset2
#put e invisible
#end
:iclear1
#put n empty
#end
:iclear2
#put e empty
#end
:icheck1
#if blocked n isset1
#Checker1:isclear
#end
:isset1
#Checker1:isset
#end
:icheck2
#if blocked e isset2
#Checker2:isclear
#end
:isset2
#Checker2:isset
#end
$
To set a flag, an object will #send
invisflag:iset.
To clear a flag, an object will #send
invisflag:iclear.
To test a flag, an object will #send
invisflag:icheck.
For a "set" answer, the @Checker uses
a :isset label.
For a "cleared" answer, a @Checker uses
a :isclear label.
$
Or, only for method 1*, you could have
the invisible be a certain color, unused
by the rest of the board, take out any
:icheck or :isset sections and have the
checking object do an #if any <color>
invisible isset. Of course, the <color>
for the checker's program must be the same
as the invisible it is checking.
$
I am only using these label names for
example. You can name them anything you
want.
$
All <direction>s in the invisible setter
's program (per flag) must be the same.
$
* There are two methods of hiding the
flag's status. In the first method,
<type1> is normal and <type2> is fake.
In the second method, <type1> is invisible
and <type2> is empty. The player will not
see these differences, but the object
will.
$
As you can see, the object must be
blocked in the direction for the "flag"
to be set, and not blocked for the "flag"
to be cleared. Fake and empty are the only
types that will work for "not blocked".
Since invisibles and empties look alike,
and normals and fakes look alike, the
player sees nothing and thinks a real flag
has been set. So the program changes the
environmet for the pseudo-flag to be set.
$
NOTE: Be sure to hide this device
inside the wall. For method 1*, it is
surrounded by empties and is invisible,
and for method 2*, it looks like ² and is
surrounded by normals.
$
Now on to flag-saving methods using #set
and #clear.
$
$Sequenced flags
$
If you need one thing to get another,
this is your method. For instance, if you
need a key to open a chest that has a
certain treasure in it, here are programs
for the key and chest.
$
@key
#end
:touch
Got the key!
#play +tcegcegceg+sc
#set key
#die
$
@treasure
#end
:touch
#if not key oops
#clear key
#set treasure
Got the treasure!
#play tcdefsdefgifgabqgab+c
#die
:oops
#play h--gc
You need the key to open the chest!
#end
$
$Piggybacking flags
$
If there are two flags to set, you
can have one flag set for the both of
them.
$
@Item1
#end
:touch
You have item 1.
#if item2 piggyback
#set item1
#die
:piggyback
#clear item2
#set items
#die
@Item2
#end
:touch
You have item 2.
#if item1 piggyback
#set item2
#die
:piggyback
#clear item1
#set items
#die
@Checker
#if item1 item1
#if items item1
You do not have item 1!
/i/i/i/i/i/i
#item2check
:item1
'
You have item 1!
'
:item2check
#if item2 item2
#if items item2
You do not have item 2!
#end
:item2
'
You have item 2!
'
:itemschek
#if items good
You do not have both items.
#end
:good
#play icccexcqg
You have both items!!!! I'll take those..
#clear items
#die
$
If items is set, item1 nor item2 are
set, but are implied to be. If item1 is
set, item2 is cleared. If item2 is set,
item1 is cleared. All it takes is a little
logic!
$
$Inversed flags
$
This is a method where the goal for the
player is to #CLEAR as many flags as he
can. One object in the first room will set
as many flags as it will, and you CLEAR
flags along the way. You can combine this
method with others by inversing any #clear
and #set commands. And the next tip, NO
DOUBLING, will not be a danger with this
method. AND you can set 9 flags right away
and never worry about using too many, as
long as you have their names memorized or
written down somewhere.
$
$NO DOUBLED FLAGS!!!
$(Do not worry if you applied method #6.)
$
You can #clear <flag> as many times as
you like! But you cannot #set <flag> as
many times as you like. I have already
displayed an object disappearing after
its flag is set. But what if, for instance
, a flag represents a MEMORY? Or an
EXPERIENCE? You could place a book some-
where for the player to read. As he reads
it, a flag is set. This represents him
knowing something that he will apply later
, but only if the flag is set. Think about
it! The player himself will use the book
for reference, and each time he touches
it, <flag> is #set, over and over again!
A doubled flag serves no purpose, and is
VERY, VERY wasteful. Here is a program
representing the wasteful book:
$
@Book
#end
:touch
$
Ya, da ya, yah! Yakkity shmakkity. Blah
blah. Blah. By the way, you now know how
to make home-made ammo.
$
#set makeammo
#end
$
If this book is important, we would not
want to have it #die, like a scroll! Here
is an efficient solution:
$
@Book
#end
:touch
$
Yah! Yah! Yah! The same old yap. You
know how to make home-made ammo.
$
#if makeammo then stop
#set makeammo
:stop
#end
$
Get the difference? If makeammo is
already SET, the #set makeammo command is
skipped.
$
#end
•• •• • •• •• • • • • •• •• • • • • • •••• • ••• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •• •• • •• • • • • •• •• ••••••• ••••••• • • ••••••• ALL NEW COMMANDS! ••••••••••••••••• Feel free to • • • You'll learn come inside -------•-------•---------- more!!! :) the program • • :D and check my • • • programming! ••••••••••••••••• TRICKS AND ADVICE! Z Z T - O O P P R O G R A M M I N G L A N G U A G E T U T O R by: D a v i d P i n k s t o n