There is a better method, using a 1 pixel size location constantly centered on the zergling.
The system uses triggers to move a Devouring One to the ling's centered location. Since the location is 1 pixel in size, therefore the Devouring One cannot in fact move to the location - sense that it isn't there, and you've detected whether or not the ling is burrowed (more or less). If the Devouring One is successfully moved to the location, then the zergling is burrowed and you have that information. Whatever the outcome, immediately move the Devouring One back to where it was originally to prevent any disturbances. Then you can create the lurker temporarily.
Fixed. Why would you use a Dark Templar? Don't.
Be wary of tight spaces that might prevent the Dark Templar from being moved to the Zergling even if it is burrowed - tight spaces like that would also prevent the Lurker from being created.
This is only an issue when you use a Dark Templar. If you use a Devouring One instead, you can no longer get too close to walls or edges for it to break. The system will only screw up if something walks over you while you're burrowed.
Of course, there are ways to get around this. For one, if the Zergling is in the playing field where other units can pass over it, then you can detect when it burrows to give the Lurker, and detect when it moves to kill the Lurker.
Another solution is to make it so the Zergling will automatically unburrow when another unit walks above him.
Yet another possibility is to make it so two Zerglings occupying the same 1x1 area causes the game to separate them. You can make this separation only activate when both Zerglings are burrowed on top of one another.
The best solution might be a combination of the first two. Once the Zergling burrows, the 1x1 pixel location stops centering on it. When there's no unit above the burrowed Zergling, it continually does a normal unburrow check as illustrated above. When there is another unit at the burrowed Zergling's location, it stops and assumes the Zergling remains burrowed. If at any time the Zergling leaves the 1x1 pixel location, its status is changed to unburrowed.
The issue I see with this is, if two Zerglings burrow on top of each other, one of them can unburrow and will retain his Lurker until he moves. Still, it shouldn't be a terribly huge concern.
Post has been edited 2 time(s), last time on Oct 12 2010, 2:21 am by DevliN. Reason: Mineral abuse.