What i'm trying to make is: "If the enemy hero enter in the range of my tower, the tower stop attack the creeps and change the focus to enemy hero. But just if the enemy hero attack my hero, or my ally hero, if not, the tower don't need change the focus".
Some informations:
Combat: Attack target priority of the units:
My Hero: 1
Emeny Hero: 1
Creeps: 2
I didn't find this using google... how can i make this work?
It's been a while since I touched the original Dota, but in Dota 2 that's not how towers work. Towers will never switch targets until either the current target dies or goes out of range (exception: target reset trick). Towers prioritize heroes only if the hero is attacking the tower or allied units, otherwise they prioritize the closest unit.
Just a heads up in case you are trying to imitate dota-style towers accurately.
As to your question, I don't know much about battle mechanics in the editor, but I feel like there should be a combat priority field for each unit. If that doesn't allow you to get what you want done, then you could run some triggers to manually set the targets... Create a region, pick each tower in the game, center the region on the tower. Then loop through each unit in that region and perform logical checks to see which one should be the target, then order the tower to attack that unit.
This does not have to be made using triggers. There is something called "combat priority" or something like that in the data section for each unit. Give the creeps a certain number for that field maybe something like 20. But for heroes give it something higher.... maybe 100. I don't have the editor in front of me, to excuse any mistakes.
I think you're talking about "Combat: Attack target priority", the problem is, the Hero will never be able to attack the tower without receive damage, and this is not what i want. :\
Perhaps you could give a short term invisible buff/behavior to units that attack heroes. You could then search out enemy heroes within the radius of the tower that have this buff and tell the tower to attack them.
Alight, Its going to get messy. But, you want 2 triggers. The reason why i wrote them like this is because they are going to need alot of... well you. You will need to identify heroes, and towers. This is a decent blueprint to work off of.
A. Checks Targets.
B. Changes Targets.
A Trigger
Use the event
Unit - Any Unit acquires a target
Use the condition
(Unit type of (Triggering unit)) == Tower
(unit Type of (Acquired Target))==Hero
Use the Actions
If (Result of B trigger){
Nothing
}Else{
If(check for minions){
Order Tower to attack minion}
B trigger
Use event
Unit Attacks
Use Conditions
Attacking unit ==hero
Triggering unit == Hero
Actions
Order Tower to target hero
Note: For trigger B, the proper event is "Unit - Any unit is attacked."
I should also explain, a trigger is really a boolean function if you look at the script. It returns true if the conditions were true or it was told to ignore the conditions, otherwise it returns false. That being said, I still don't understand what he means by "If (Result of b trigger)."
I think his outline is a nice starting point to get you thinking in the right direction, but definitely not a fully functioning solution at this point.
Actually the way that Dota does it (or at least did it the last time I played it), was that when an order is issued targeting a tower to command that tower to target the hero. If a hero attacked a tower without issuing an order (ie; naturally) then it would not be targeted by the tower.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
What i'm trying to make is: "If the enemy hero enter in the range of my tower, the tower stop attack the creeps and change the focus to enemy hero. But just if the enemy hero attack my hero, or my ally hero, if not, the tower don't need change the focus".
Some informations:
Combat: Attack target priority of the units:
My Hero: 1 Emeny Hero: 1 Creeps: 2
I didn't find this using google... how can i make this work?
Thank you!
It's been a while since I touched the original Dota, but in Dota 2 that's not how towers work. Towers will never switch targets until either the current target dies or goes out of range (exception: target reset trick). Towers prioritize heroes only if the hero is attacking the tower or allied units, otherwise they prioritize the closest unit.
Just a heads up in case you are trying to imitate dota-style towers accurately.
As to your question, I don't know much about battle mechanics in the editor, but I feel like there should be a combat priority field for each unit. If that doesn't allow you to get what you want done, then you could run some triggers to manually set the targets... Create a region, pick each tower in the game, center the region on the tower. Then loop through each unit in that region and perform logical checks to see which one should be the target, then order the tower to attack that unit.
What type of triggers you suggest? I'm just lost right now, nothing works...
@Diego6D: Go
This does not have to be made using triggers. There is something called "combat priority" or something like that in the data section for each unit. Give the creeps a certain number for that field maybe something like 20. But for heroes give it something higher.... maybe 100. I don't have the editor in front of me, to excuse any mistakes.
@TerranMaster23: Go
I think you're talking about "Combat: Attack target priority", the problem is, the Hero will never be able to attack the tower without receive damage, and this is not what i want. :\
Perhaps you could give a short term invisible buff/behavior to units that attack heroes. You could then search out enemy heroes within the radius of the tower that have this buff and tell the tower to attack them.
@Diego6D: Go
Tomorrow I will try to whip up a quick example of what I'm talking about
Alight, Its going to get messy. But, you want 2 triggers. The reason why i wrote them like this is because they are going to need alot of... well you. You will need to identify heroes, and towers. This is a decent blueprint to work off of.
A. Checks Targets.
B. Changes Targets.
A Trigger
Use the event
Unit - Any Unit acquires a target
Use the condition
(Unit type of (Triggering unit)) == Tower
(unit Type of (Acquired Target))==Hero
Use the Actions
If (Result of B trigger){
Nothing
}Else{
If(check for minions){
Order Tower to attack minion}
B trigger
Use event
Unit Attacks
Use Conditions
Attacking unit ==hero
Triggering unit == Hero
Actions
Order Tower to target hero
Nvm, looks like SoulTaker drew up a nice outline.
Note: For trigger B, the proper event is "Unit - Any unit is attacked."
I should also explain, a trigger is really a boolean function if you look at the script. It returns true if the conditions were true or it was told to ignore the conditions, otherwise it returns false. That being said, I still don't understand what he means by "If (Result of b trigger)."
I think his outline is a nice starting point to get you thinking in the right direction, but definitely not a fully functioning solution at this point.
Actually the way that Dota does it (or at least did it the last time I played it), was that when an order is issued targeting a tower to command that tower to target the hero. If a hero attacked a tower without issuing an order (ie; naturally) then it would not be targeted by the tower.