| 03-05-2005, 12:45 AM | #1 |
Ok, is it possible to have a trigger that picks the closest unit to another unit? Example : A unit casts a spell, a dummy caster is created and the dummy caster uses the spell on the closest unit to the original casting unit. |
| 03-05-2005, 02:22 AM | #2 |
Code:
Unit - Order [u]DummyUnit[/u] to [u]DummySpell[/u] (Random unit from (Units within [u]x[/u] of (Position of [b]DummyUnit[/b]))) |
| 03-05-2005, 04:27 AM | #3 |
Uh, that'll just pick a random unit, he wants the CLOSEST unit. I spose you could create an interger trigger that picked every unit within 10, 20, 30, 40 ect of the casting unit and just got bigger till it hit something. An edited fan of knives to have only 1 missile would also choose the closest unit. But i'm not sure if whatever enemy it hits is detectable or not. |
