I wrote this in the “Recreating Zork 285”:
FIND limits search scope for GWIM to specific attribute flag
Search flag options:
Bit 0
1 HAVE Object must be in inventory
2 MANY Object can be multiple objects
3 TAKE Try to take object
4 ON-GROUND Set search scope for GWIM to objects at rooms top-level*
5 IN-ROOM Set search scope for GWIM recursively to all open containers on ground*
6 CARRIED Set search scope for FWIM recursively to all open containers in inventory*
7 HELD Set search scope for GWIM to objects at inventory top-level*
GWIM (Get What I Mean): If search scope narrows down to one object that meets the critera, then action is performed on that object.
* ZilLib in ZILF doesn't distinguish between HELD and CARRIED or ON-GROUND and IN-ROOM. They all search from top-level and
recursively in open containers in inventory or room, respectively.
Default search scope is (ON-GROUND IN-ROOM HELD CARRIED), i.e. <SYNTAX FOO OBJECT> is the same as <SYNTAX FOO OBJECT (ON-GROUND IN-ROOM HELD CARRIED)>.
This is a bit outside the scope for that because Zork 285 don’t use these flags. I nevertheless examined this a bit deeper and made a little test program on how the scope flags work.
"Example"
<VERSION XZIP>
<CONSTANT RELEASEID 1>
<CONSTANT GAME-BANNER "Search Flags test">
<ROOM ROOM1
(DESC "Room 1")
(NORTH TO ROOM2)
(FLAGS LIGHTBIT)>
<ROOM ROOM2
(DESC "Room 2")
(SOUTH TO ROOM1)
(FLAGS LIGHTBIT)>
<OBJECT ITEM1
(IN ROOM1)
(DESC "Item 1")
(SYNONYM ITEM1)
(FLAGS TAKEBIT)>
<OBJECT ITEM2
(IN ROOM1)
(DESC "Item 2")
(SYNONYM ITEM2)
(FLAGS TAKEBIT)>
<OBJECT ITEM3
(IN ROOM1)
(DESC "Item 3")
(SYNONYM ITEM3)>
<OBJECT ITEM4
(IN ROOM2)
(DESC "Item 4")
(SYNONYM ITEM4)
(FLAGS TAKEBIT)>
<OBJECT ITEM5
(IN ROOM2)
(DESC "Item 5")
(SYNONYM ITEM5)>
<ROUTINE GO ()
<SETG HERE ,ROOM1>
<MOVE ,PLAYER ,HERE>
<V-LOOK>
<MAIN-LOOP>>
<INSERT-FILE "zillib/parser">
<SYNTAX FOO OBJECT = V-FOO>
<SYNTAX FOOH OBJECT(HAVE)= V-FOO>
<SYNTAX FOOHHE OBJECT (HAVE HELD)= V-FOO>
<SYNTAX FOOHIR OBJECT (HAVE IN-ROOM)= V-FOO>
<SYNTAX FOODHHEIR OBJECT (HAVE HELD IN-ROOM) = V-FOO>
<SYNTAX FOOHE OBJECT (HELD) = V-FOO>
<SYNTAX FOOHEIR OBJECT (HELD IN-ROOM)= V-FOO>
<SYNTAX FOOIR OBJECT (IN-ROOM) = V-FOO>
<ROUTINE V-FOO () <TELL "You FOO the " D ,PRSO "." CR> <RTRUE>>
And a transcipt:
Room 1
There is a Item 1, a Item 3, and a Item 2 here.
> foo
What do you want to foo?
> get item1
You pick up the Item 1.
> foohe
[the Item 1]
You FOO the Item 1.
> fooir
What do you want to fooir?
> get item2
You pick up the Item 2.
> fooir
[the Item 3]
You FOO the Item 3.
> foohir
[the Item 3]
You aren't holding the Item 3.
> fooh
What do you want to fooh?
> drop item2
You drop the Item 2.
> fooh
What do you want to fooh?
> i
You are carrying:
a Item 1
> foohhe
[the Item 1]
You FOO the Item 1.
> n
Room 2
There is a Item 4 and a Item 5 here.
> get item3
You don't see that here.
> get item5
That's not something you can pick up.
> get item4
You pick up the Item 4.
> s
Room 1
There is a Item 2 and a Item 3 here.
> drop all
Item 4: Dropped.
Item 1: Dropped.
> n
Room 2
There is a Item 5 here.
> foo
[the Item 5]
You FOO the Item 5.
> fooheir
[the Item 5]
You FOO the Item 5.
> foohe
What do you want to foohe?
> fooir
[the Item 5]
You FOO the Item 5.
>
Enclosed is the compiled test. If anyone wants to experiment on their own…
sf-test.zip (12.9 KB)