Aligning with the Alien
Suppose you want to align one of your objects with somebody else's object. Say, for example, you're making a railroad switch on somebody else's railroad (maybe even a Linden railroad!) and you can't just ask the creator which way the guide prims are pointed. What to do?
Scripts can find out all kinds of interesting facts about other people's objects (and avatars), but it can be tricky to identify to the script which object to report on. Picking from a list of sensor-detected items used to be a common solution to the problem, but it's far from handy. Now we can specify the target object by finding what's directly in front of our cam.
Once we've identified the target object, the handiest, most direct way to get at its orientation data is to put one's own "Indicator" object in the same position and rotation as the target -- and with that Indicator selected in the editor, its orientation can be copied directly to any to-be-aligned object, using a feature of some third-party viewers. Also, with that Indicator selected, the viewer's built-in origin axes are extremely handy for visualizing the object's rotation.
Here are a couple of scripts that each go in a fresh box prim and work together to get the position and rotation (and other fun statistics) about somebody else's objects. The first makes a little HUD you attach to figure out what object your cam is looking at. The second makes an unattached "Pos+Rot Indicator" object that will zip to the object the HUD thinks you're looking at, so you can see the position and rotation directly from that Indicator object.
For the HUD attachment: (log in to get this script from the inworld version of The Post!)
For the unattached Pos+Rot Indicator box: (log in to get this script from the inworld version of The Post!)
As convenient as this makes copying the parameters, the downside is that the Indicator must be able to enter and run scripts on the parcel that contains the target object, and will be subject to that parcel's auto-return. It would be an easy exercise to make the HUD report the information some way other than moving the Indicator around, but that would be much less convenient for cases where the land is accessible to the user's scripted objects.