I have run a couple experiments in fort mode to attempt to find a method of making the components automatically follow in the direction of the root unit, so that the creature stays together without special handling in my code.
I was hoping dragging might work, as there were two possible ways it could be implemented that came to my mind, only the latter of which would be useful: either the draggee is moved into the *position* that the dragger last occupied, or the draggee is moved in the *direction* that the dragger last moved in. I embarked and assigned a horse to pasture, and then teleported it two tiles away from the dwarf as the job was in progress, seeing if it would spring forward and continue following the dwarf at one tile away, as previously, or if it would continue following at two tiles away. Alas, the former implementation method turned out to be the reality, so dragging cannot be used in my case.
I then tried using mounting to accomplish the desired effect. I used Rumrusher's online script to try to mount a mason on a woodworker; however, it crashed initially by trying to access the 'relationships' data member of the rider unit. I originally didn't know how to fix it, so I just commented out that line and hoped for the best; in doing so, however, I managed to accidentally stumble upon exactly the sort of thing I needed for observer components -- although the woodworker (the mount) wandered about as normal, the mason (the rider) was completely immobilized, but *still attempted to take jobs.* I suppose setting the 'rider' flag while not completing the cross-references creates this effect, so warmist, if you still need such a method but don't want to go the route of copying the raws entirely like I did for non-observer components, then here it is.
I suspected commenting out the line that accesses the 'relationships' data member was the culprit for this strange behavior, so I decided to check if units actually have a 'relationships' data member through gui/gm-editor, and thus found the 'relationship_ids' member. Surmising that this was the replacement for the original, I edited Rumrusher's code accordingly, booted up a new world and new embark, and this time mounted a woodcutter on a yak, then designated a swath of trees to be felled. The woodcutter took the woodcutting job, but both woodcutter and yak were immobile for a moment. Then the yak moved, and as far as I could deduce the woodcutter immediately teleported onto the yak's back. However, both of them wandered about the wagon, like the yak would normally do, instead of moving towards the tree that was the object of the woodcutter's job.
These findings seem to imply a startling fact: that the *mount* is in fact the unit that is leading and is responsible for pathing, not the rider. Those goblins which storm your fortress on beak dogs are actually entirely subservient to their beak dogs (at least, until the beak dogs get killed). This might change soon enough, though, as Toady introduces adventurer mounts; I assume he intends the player to have at least some measure of control over their mount.
In any case, mounting will not be useful to me either, as I do need components to stay on different tiles. I guess I will have to manually assign paths and/or movement velocities for every component in the creature.