Hi Guys, as u can see in the Thread Title I am making an Aggro System like in RPG's such as wow.
Here is a Video to show you how far i am.
If Video is not availible it is still processing!
ps. sorry about the musik in the video... i didn't notice it was recording that.
I have attached a Picture with all the Triggers so you can look at it.
My Problem is as you can see in the Video. The Aggro is Global to all attacking units. I am trying to find a way so that the Aggro is different for each enemy unit. If you understand what i mean. In the Video you will see that the first Zergling i attack is correctly attacking the Unit who has more aggro. But the second Zergling also attacks the Unit with the Most Aggro. What i want is that the Second Zergling starts at 0 0 0 Aggro for all Heroes.
Hope i explained it good enough :)
You can Modify and use the code for my Aggro System as ur own. But i would be glad if you gave me a little credit ;)
If i get some help so the Aggro system works on every single unit not on all globaly. I will release The Code as Libary.
So ;) pls help :)
ps. It could be that i made it a bit complicated :) But im still learning trigger editor :) so be nice.
Its a bit so-so how I would do this. How many units you need to be able to count the aggro from and how large you wan to area to be that the aggro affect? As it is now, the zergling would run all over the map if the people with the most aggro would be far away.
Im not sure if there is some really smart way of doing this, but I quess I would go with action definition or periodic triggers.
You pick units in some area around zerglng and check who has the most aggro, this way the zergling doesnt even need to attack unit to detect who has the most aggro.
Yea...loops are the only way to go here. Those triggers just seem plain bad for some reason, even tought it works....
Only thing I can even think of, because I'm still kind of a nub, would be to somehow use an Array and limit the number of monsters that a player could reasonably fight at a time so as to not go over the array's capabilities.
As I said, it depends what you need. You should be able to make atleast 10-20 units with loops system (10-20 enemies on screen same time). The loops activate when enemies come near and will stop when unit dies/enemies go away....
Of cource the loops wont run all the time. You can activate them when you spawn unit, attack unit, unit enter region or whatever...
And you could even use loops for the heroes only, to check if there is nearby ally that has more agro and then pick every nearby enemy and order them to attack the one with most aggro.