I'm trying to make a weapon that attacks a random unit within its range each time it fires (it can also attack more than one time the same unit).
I've tried setting the AcquireFilters to TSRandom, but this doesn't work: the unit always attack the same unit... I think it's because the target is acquired only once at the beginning and then the unit keeps firing at the target until it dies.
The only way I found to do that is to use an EnumArea effect for the weapon (instead of a Damage one) with MaxCount=1, Effect=WeaponDamageEffect and TargetSorts TSRandom. This works fine but I'm sure there is a way to make it work without using an EnumArea effect. Maybe related to the constant scan flag?
You would think so but really there's no built in way of doing this. When a SC2 unit acquires an attack target it will always continue to attack that target as long as its available. You've already found the workaround, but the main difficulty is setting it up so if you give it an attack order it will stay on target while if it auto-acquires a target then it'll re-acquire after every shot. This is a PITA but I'm sure it's possible.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hi all!
I'm trying to make a weapon that attacks a random unit within its range each time it fires (it can also attack more than one time the same unit).
I've tried setting the AcquireFilters to TSRandom, but this doesn't work: the unit always attack the same unit... I think it's because the target is acquired only once at the beginning and then the unit keeps firing at the target until it dies.
The only way I found to do that is to use an EnumArea effect for the weapon (instead of a Damage one) with MaxCount=1, Effect=WeaponDamageEffect and TargetSorts TSRandom. This works fine but I'm sure there is a way to make it work without using an EnumArea effect. Maybe related to the constant scan flag?
You would think so but really there's no built in way of doing this. When a SC2 unit acquires an attack target it will always continue to attack that target as long as its available. You've already found the workaround, but the main difficulty is setting it up so if you give it an attack order it will stay on target while if it auto-acquires a target then it'll re-acquire after every shot. This is a PITA but I'm sure it's possible.