Re: before inform exits
Thu, 15 Jun 1995 10:57:45 GMT
In article <60.5704.4154.0N1E65D0@canrem.com>,
Tim Middleton <tim.middleton@canrem.com> wrote:
>I simply can't get Inform to give me any control during the BEFORE property
>of an EXIT verb... for an example...
>
>Nearby chair "Chair"
> with
> name "comfy" "cozy" "chair",
> description "You see a comfy chair",
> before [; enter: print "You sink deeply into the plush cushions.^";
> exit : Print "Gosh, that was cozy.^";
> ],
> has supporter enterable static scenery;
>
>
>Shove this rudimentary object into a room and sit on it. You will get the
>"enter" message before you sit. However you won't get the "exit" message
>when you stand up.
>
>Am i missing something or is this a bug?
>
Check the grammar.h file for exit. You'll see that the verb
requires no noun. Hence, the object's before routine is never called.
As the chair is static, you could test this in the room's before-
before[;
exit : if (parent(player) == chair) print "Gosh, that was cozy.^";
],