The easiest way to do this is:
Object Rover "rover"
has animate
with name "dog" "rover",
...
daemon [;
if (parent(self) ~= parent(player))
move self to parent(player);
];
If at the end of a turn, the dog is not in the same room/container as
the player, move it there!
This has the problem that the dog doesn't appear in the room description
when the player arrives (because it hasn't followed yet). So you might
want to add a message like "Rover arrives" after the dog moves.
Alternatively, use the `NewRoom' entry point, so that the dog ends up in
the new room before it is described:
[ NewRoom;
if (FollowingFlag == 1 && parent(Rover) ~= parent(player))
move Rover to parent(player);
];
-- Gareth Rees