| 01-18-2005, 03:58 AM | #1 |
how can i make it so a unit fires a projectile at the closest unit to him? replies are greatly appreciated |
| 01-18-2005, 09:42 AM | #2 |
variables: closestunit (unit) distance (integer) set distance=9999999999999999999999999 Code:
Pick all units in playable map and do actions
- if distance between picked unit and your unit < distance then
set distance = distance between picked unit and your unit.
set closestunit = picked unitor, give him a big acquisition range, and make him stop (then he will automaticly attack the closest) |
