I'm trying to get computer burrowed units to act hostile, meaning they will unburrow and attack when enemies get close, similar to burrowed units in Brood War. I can't figure out where this would be implemented... in the data editor? Trigger editor? If anyone has any idea on how to do this, please help!
Although there may be more elegant ways of accomplishing this, one interesting idea is to give the burrowed unit a gauss rifle that doesn't have any visual or damage :P then, do a trigger for whenever any unit attacks, if it is of the burrowed type, it unburrows. :P
Like I said, there are less contrived ways, but this one is a fun idea :)
I haven't worked out the "less contrived" way entirely in my head, but it would be something like a behavior that creates a search area that calls an effect that eventually causes the unit to unburrow. Like I said, I haven't figured it out in my head, but something like that.
Also, if the units are premade, then you can do the event "unit enters range of unit".
Yes, that would be problematic. I got nothing. I've had this same problem and ultimately ditched my map idea because of it. Only thing I can think of is add a ranged weapon, as suggested, that does 0 damage and has a decent range with the min. range being close to the max range [i.e. Max:7 Min:6, or something] that way they attack and then are forced to unburrow and melee. Not sure if that would work, though.