Re: Inform: objectloop


20 Nov 1995 18:53:14 GMT

In article <48pj8q$fcl@mercury.kingston.ac.uk>,
Adrian Preston <te_s343@kingston.ac.uk> wrote:
>Why doesn't this work?
>
>
> objectloop ( i in player ) move i to room_name;
>
>
>Only the first object in the players inventory is moved.
>Thanks in advance.

An informed (no pun intended) guess (I'm not an expert on the internals
of Inform) is that it's because objectloop works by traversing a linked
list of objects (moving from each object to its sibling). When you
execute
move i to room_name
object i is removed from the player and its sibling is set to nothing.

*After* this has happened, objectloop tries to continue with the object's
sibling, which is nothing...

The Designer's manual specifically warns against doing things like this.

I'm sorry, but I'm not good enough at Inform to suggest a better solution.

Magnus