AnssiR66 / AlanStdLib

The Standard Library for ALAN Interactive Fiction Language
Other
5 stars 2 forks source link

Clarification Needed for 'put_against' ceiling #121

Closed tajmone closed 3 years ago

tajmone commented 3 years ago

@AnssiR66, I wanted to ask you why, amongst all ROOM-objects, the put_against verb is allowed for the ceiling?

I wanted to add some comments about this exception, in the source module; but couldn't come up with any potential usage for this verb on ceiling. If you could clarify the original intention behind this, and provide a couple of usage examples, I'll add them to the in-source comments.

Here's the code from lib_locations.i:

ADD TO EVERY room_object

  VERB put_against
    WHEN bulk
      CHECK THIS = ceiling
        ELSE "That's not possible."
  END VERB put_against.

  VERB put_behind, put_near, put_under
    WHEN bulk
      DOES ONLY "That's not possible."
  END VERB put_behind.

  VERB look_behind, look_through, look_under
    DOES ONLY "That's not possible."
  END VERB look_behind.

END ADD TO.
AnssiR66 commented 3 years ago

Ok, the verb put_against is meant to work with walls and the floor (put ladder against the wall, put mattress against floor, or cases like that). it is arguable whether "put (something) against floor" is actually needed, but I decided to keep it possible. Now, I wanted to anyway disable "put (something) against ceiling", and that is the reason for the coding. But now that your point it out. I can see it is of course wrong, because it should be "CHECK THIS <> ceiling" and then it makes sense. There is no DOES (ONLY) section in this verb, to enable the default response for "put_against" to be carried out with the other indoor objects. So, please just change the "=" into "<>" and then it works ok.

tajmone commented 3 years ago

Thanks!

I've now tweaked the CHECKs to allow the action only on walls. The verb was being blocked on ceiling anyhow, due to the distant attribute. As for the floor, it wouldn't make much sense for the action would be grammatically incorrect, so it's best to just preserve it for the wall.