So what I would like to do is have several enemies chasing around several heroes. Right now, I issue an order to the enemies to attack all heroes in this area, and what happens is they each pick some hero to chase, and they do so for a little while and eventually give up.
Is there any way to make these enemies attempt to attack only the closest hero to them? i.e. If hero A is initially the closest to them, they go after A but then A runs away and now hero B is the closest target, so they switch and focus B.
This can be done I think by sending them an order every second or something but I was wondering if there is a more elegant (data) solution?
We use a target sort for the Laser tower in Element TD. The one we have sorts dynamically by HP, but you can sort by a wide range of values iirc.
Off the top of my head, I think you'll find it in the Weapon section under Target Sort (and under the Target Sorts data tab), but if you have trouble tracking it down I can open up the map and tell you exactly how we did it.
We use a target sort for the Laser tower in Element TD. The one we have sorts dynamically by HP, but you can sort by a wide range of values iirc.
Off the top of my head, I think you'll find it in the Weapon section under Target Sort (and under the Target Sorts data tab), but if you have trouble tracking it down I can open up the map and tell you exactly how we did it.
Right, but will that make them switch whenever a new target comes into range that is closer than the current target? I think the target sort would only work initially and not change targets until the first target is dead
So what I would like to do is have several enemies chasing around several heroes. Right now, I issue an order to the enemies to attack all heroes in this area, and what happens is they each pick some hero to chase, and they do so for a little while and eventually give up.
Is there any way to make these enemies attempt to attack only the closest hero to them? i.e. If hero A is initially the closest to them, they go after A but then A runs away and now hero B is the closest target, so they switch and focus B.
This can be done I think by sending them an order every second or something but I was wondering if there is a more elegant (data) solution?
@peranzormal: Go
We use a target sort for the Laser tower in Element TD. The one we have sorts dynamically by HP, but you can sort by a wide range of values iirc.
Off the top of my head, I think you'll find it in the Weapon section under Target Sort (and under the Target Sorts data tab), but if you have trouble tracking it down I can open up the map and tell you exactly how we did it.
Right, but will that make them switch whenever a new target comes into range that is closer than the current target? I think the target sort would only work initially and not change targets until the first target is dead
Sort by distance and every so often have another Search Area effect cast that does the ordering to allow changing fo targets.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg