I understand how the attack priority system works, but I want to be able to give lets say a photon cannon the priority to always attack hero units first above normal units.
If I change the hero's attack priority everything, not just the photon cannon will attack the hero first.
How can I make it so the cannon will always shoot the hero 1st , if present?
I tried to do something like this for a DOTA map once- like League of Legends. If this is a DOTA map, where you only have pre-placed turrets, try something with triggers. You could find each unit, check if any have a hero attribute, and take appropriate action. Otherwise, I don't know...
Rollback Post to RevisionRollBack
Feel free to Send me a PM if you have any questions/concerns!
Ya it's a dota like map. Man doing it that way sounds like it will bog down the map. I mean that would be a constant thing running non stop for multiple turrets :\
Target Sorts comes to mind when i think about this kind of situation w/o triggers. though there is not one for units directly but there is one for behavior count and one for priority so i assume you can ether give your heroes a buff that just tells you they are a hero or you can set it up so that it likes that level of priority more then others. But i have never tried this so it may not work
Ok. So I created a buff and gave it to a hero. The buff does nothing, it's just for the sort thing. Now what is the request count and the request percentage?
Also do I need to set the unit+ field on the sort filter to target?
i have used these so little i had to go back and check my abilities to see how i had them set. for my abilities both percent and count are set to zero but you might have to play around with them to get them to do what you need as i am not entirely sure what they do.
Target sorts for weapon attacks are broken, only the ones for Search Area effects work, though you don't even need sorts in your case.
Put a behavior on the cannon, which periodically runs a Search Area effect, the effect should have a Radius that's about as big as the attack range of the cannon and its Search Filters should filter out everything that isn't a Hero, the actual effect is an Issue Order effect with these settings:
Ability Attack
Player + (None):Target
Target + (None):Target Unit
Unit + (None):Source
ok so the best way i have found is give anyone you want it to focus on the Heroic attribute. then create 3 effects. a set, search, and order.
start with the order and set ability to attack, player to source, target to target, and unit to source. set any of those different and it could cause issues.
Then do the search under search areas array set effect to your order, set radius to whatever radius you want it to pick up the hero. don't set higher then its attack range though cause it can make it so it wont attack anything if the hero is at the perfect range. Then set max count to 1, if you set it to anything else it will attack everything at the same time. then under search filters set required for heroic. we are not going to use target sorts for this because if you do you will get the same issue as setting too many max count depending on what is sorted and another issue is when the units enter range it picks an order for them and doesn't change until they get far enough away which will allow someone to train or control your cannon fire. beyond setting it to focus heroes anyway.
next go to the Set effect and add the search effect and the damage effect for your cannon. Actually for your cannon you need to set it to the launch missile if you want the shooting effect but usually it would be the damage.
finally go to the weapon for the cannon and set the effect to your set effect.
now you are done. no buffs or sorts required. this makes it so that every time the weapon fires it will so a search for any unit with the heroic tag if none then it continues with what it was doing if there is a hero then it will attack the hero. and it shouldn't constantly switch between heroes constantly.
I understand how the attack priority system works, but I want to be able to give lets say a photon cannon the priority to always attack hero units first above normal units.
If I change the hero's attack priority everything, not just the photon cannon will attack the hero first.
How can I make it so the cannon will always shoot the hero 1st , if present?
@Zero0018: Go
I tried to do something like this for a DOTA map once- like League of Legends. If this is a DOTA map, where you only have pre-placed turrets, try something with triggers. You could find each unit, check if any have a hero attribute, and take appropriate action. Otherwise, I don't know...
@zeldarules28: Go
Ya it's a dota like map. Man doing it that way sounds like it will bog down the map. I mean that would be a constant thing running non stop for multiple turrets :\
No other way?
Target Sorts comes to mind when i think about this kind of situation w/o triggers. though there is not one for units directly but there is one for behavior count and one for priority so i assume you can ether give your heroes a buff that just tells you they are a hero or you can set it up so that it likes that level of priority more then others. But i have never tried this so it may not work
@neverwin1011: Go
Hmmmm. For target sorts are you referring to the actual weapon of the turret?
I don't understand these values, attached pictures.
yes but you will have to create your own. they are located under edit advanced Data in the tabs pulldown menu
@neverwin1011: Go
Ok. So I created a buff and gave it to a hero. The buff does nothing, it's just for the sort thing. Now what is the request count and the request percentage?
Also do I need to set the unit+ field on the sort filter to target?
Unit+ needs to be target
i have used these so little i had to go back and check my abilities to see how i had them set. for my abilities both percent and count are set to zero but you might have to play around with them to get them to do what you need as i am not entirely sure what they do.
Target sorts for weapon attacks are broken, only the ones for Search Area effects work, though you don't even need sorts in your case.
Put a behavior on the cannon, which periodically runs a Search Area effect, the effect should have a Radius that's about as big as the attack range of the cannon and its Search Filters should filter out everything that isn't a Hero, the actual effect is an Issue Order effect with these settings:
Ability Attack Player + (None):Target Target + (None):Target Unit Unit + (None):Source
Please use the data editor settings in this thread, that is the standard.
http://www.sc2mapster.com/forums/general/wiki-discussion/20995-info-data-editor-fieldnames/#p1
Also that method would ened a target sort and behaviour added to prevent it attacking random stuff (like levi ground attack)
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
From Neverwin1011:
ok so the best way i have found is give anyone you want it to focus on the Heroic attribute. then create 3 effects. a set, search, and order. start with the order and set ability to attack, player to source, target to target, and unit to source. set any of those different and it could cause issues. Then do the search under search areas array set effect to your order, set radius to whatever radius you want it to pick up the hero. don't set higher then its attack range though cause it can make it so it wont attack anything if the hero is at the perfect range. Then set max count to 1, if you set it to anything else it will attack everything at the same time. then under search filters set required for heroic. we are not going to use target sorts for this because if you do you will get the same issue as setting too many max count depending on what is sorted and another issue is when the units enter range it picks an order for them and doesn't change until they get far enough away which will allow someone to train or control your cannon fire. beyond setting it to focus heroes anyway. next go to the Set effect and add the search effect and the damage effect for your cannon. Actually for your cannon you need to set it to the launch missile if you want the shooting effect but usually it would be the damage. finally go to the weapon for the cannon and set the effect to your set effect.
now you are done. no buffs or sorts required. this makes it so that every time the weapon fires it will so a search for any unit with the heroic tag if none then it continues with what it was doing if there is a hero then it will attack the hero. and it shouldn't constantly switch between heroes constantly.
Attached is a test map of it working.
Thanks to Neverwin1011 for the help also this doesn't work for the bunker shrike turret. I think because it's a damage instead of a launch missile.
Does anyone know how to fix that so it works with the shrike turret?
Update:
It works. Never mind ;p
Glad to be of help. I learned a lot of new things doing this as well.