[ZILF] Sytax - Get Up and Sit Down

I’m trying to add this syntax to my game:

< SYNTAX GET UP = CHAIR-EXIT-F >
< SYNTAX SIT DOWN = CHAIR-SIT-F >

But since Up and Down are part of the DIRECTIONS object, I don’t know how to get this syntax to work.

Does anybody have any ideas?

  • D

Steal the Infocom approach you like best! (The more readable examples seemed to start on page 2 of this particular search.)

(Nice easy Planetfall example on page 1 for sitting down.)

According to the old Infocom manual (page 38), the parser isn’t capable of handling syntax like “GET UP” or “SIT DOWN”. So there’s a hacky workaround using the FIND feature: you define your verb with an object, then FIND a special bit that’s only set on the (internal, normally-not-referenceable) ROOMS object. If the player doesn’t supply an object, FIND will return ROOMS (as the only object in scope which has the flag); if they do try to supply an object for some bizarre reason, they can’t possibly reference ROOMS (it has no synonyms), so ,PRSO will be set to something else.

In other words, you do something like this:

<SYNTAX GET UP OBJECT (FIND ROOMSBIT) = V-GET-UP>

And then check if ,PRSO is equal to ,ROOMS within your action routine. If it is, the player typed GET UP without an object, and you’re good to go. (Some games call it RMUNGBIT instead, but the idea is the same.)

…unfortunately, I don’t know if the modern library still requires/uses this hack. So I’ll defer to others on that.

1 Like

Standing and sitting aren’t in the ZILF stdlib, so, no, no progress on this problem since 1989!

But that’s a great explanation for why the Infocom approach is so confusingly hacky!

Thanks. I see this explained a bit in Learning Zil by Steve Meretzky. So my code for GET UP is like yours, but when I try it, I get: What do you want to get up? The parser is getting hung up somewhere.

I’m not sure what I’m missing here. The example is just like this.

Not sure why, but it works with KLUDGEBIT. So the code is:

< SYNTAX GET UP OBJECT (FIND KLUDGEBIT) = V-GET-UP >

If anybody finds this post down the road. :slight_smile:

Ah, that must be the modern name for it! Is the only object with that bit still ROOMS?

That isn’t actually necessary - the bit is handled as a special case in GWIM, in Infocom’s parser as well as ZILF’s. Infocom used several different flags for this in different games, including RLANDBIT, which was set on most rooms:

$ grep -r --include='*.zil' 'SYNTAX STAND UP' . | \
  sed -e 's/^.*(FIND \(\S*\)).*$/\1/' | sort | uniq -c
      1 FL-LOCATION
      1 FL-ROOMS
      4 KLUDGEBIT
      3 LOCATION
     19 RLANDBIT
     12 RMUNGBIT
      1 ROOMSBIT