[I6] Filtering Objects Upon Movement

Dear all,

I have (under Inform 6) a supermarket where I can pick up various goods. I do not want the player to be able to leave the supermarket while having unpaid goods with him, and I want him to be able to pay for specific goods. My thought was I could give each item a unique ID (like “unpaid#ware”) and check if the player has something with this ID with him. How could I accomplish this, or which other solution would enable me to filter movement by checking the players inventory for items with a special attribute?

Thanks and kind regards,
G.

A thing can be buyable. A thing is usually not buyable. 

When play begins:
      repeat with X running through things in the supermarket:
            now X is buyable.

Check going in the supermarket when the player encloses a buyable thing (called the merchandise):
      say "Oy! Where are you going with [regarding the merchandise][those] [merchandise]?" instead.

Thanks jrb, but that’s Inform 7. :neutral_face: An attribute is probably the way to go under I6, too, but I don’t know how to rummage through the entire inventory. Deep rummage that is, don’t want to promote shoplifting. :wink:

Sorry, I didn’t read carefully enough.

If you have declared an attribute:

Attribute unpaid;

then you can say

objectloop (obj in player) {
  if (obj has unpaid) print_ret "Bzzt.";
}

Works like a charm. Thanks Zarf!