I hit an interesting quirk while FREDding With Tanks. This is general advice for using set-immobile, but it's particularly handy when you're dealing with objects that have to be managed primarily through coordinate manipulation because the regular AI can't be trusted.
set-immobile is a great SEXP for locking something in place - an installation, a warship you need to stop RIGHT THERE, a company of tanks whose AI just doesn't quite work by normal FreeSpace standards. But it comes with a pretty funny caveat!
If you set-immobile an object with AI and the ability to move, it still thinks it's moving. So does any AI shooting at it. This means that if you, say, set-immobile a fighter that's attempting to waypoint at 100 m/s, any AI attacking it will aim for a 100 m/s lead point even though the target's dead still. And unless they're shooting from straight ahead, they'll probably miss.
One solution is to clear the ship's AI so it doesn't try to move. Sometimes, though, a quirk of the mission you're working in (like the AI bugs caused by the proximity of a massive terrain model!) can make these solutions difficult. Or you might be worried about upsetting the fragile balance of a mission by altering AI behavior in even the slightest way. Or you might want your ship to retain its current orders, whatever they are, when it goes mobile again. (we should really get a sexp that returns a ship's current orders)
If you set-object-speed 0 your target on x/y/z every frame, however, AI attacking it will correctly decide that it's worth aiming straight for center of mass, instead of going for the false leadpoint. This is a quick and dirty solution to the problem that doesn't require any messing with AI orders. And you can switch it off when you set the target mobile again.
It's a crazy corner case, but Now You Know!
i'll give it three posts before someone points out a much easier workaround for this whole problem