Hello,
I am trying to do a tug of war map. Now, I have a siege tank positioned on top of a ramp. So I have a trigger that uses damage source for the AI to locate the siege tank, attacks it and then goes back to its planned route.
The problem is, if I have 2 siege tanks at different positions attacking the AI, the damage source trigger will send the AI haywire.
The AI will attack the first siege tank, but if the second siege tank attacks, they will target the 2nd siege tank instead of the 1st one UNTIL the first siege tank attacks.
Any ideas how to solve this? I am using " Unit - Order (Triggering unit) to ( Attack targeting (Damaging unit)) (Before Existing Orders)" I tried changing to replace, but it got worse!
first off all you want to make clear for yourself, how you want them to behave
i guess only run to the second if the first one got killed
-you can add a "cooldown" to the attack tank trigger
-you can simply do it without trigger and give the tanks a high priority in data
-do After Exsisting Orders if the unit is attacking a tank already
I tried after existing orders, but I already have an order to the units, which is to attack a specific region If i use after existing orders, it wouldnt work because they will attack the region first.
As for giving the tanks a high priority, that wouldn't work in my scenario because its not only tanks that will be on the ramp. Besides, if the tanks have a high priority I think the result will still be the same as the priorities for the tanks are the same.
As for the "you can add a "cooldown" to the attack tank trigger" this sounds interesting. Can you please elaborate more about it?
Edit: FIXED! Thanks for your help anyway. I used (Count of orders on (Triggering unit)) < 2 so that the orders wouldn't overwrite. But, can you still explain the cooldown to the trigger? I have a feeling this may help in other parts of my modding. Thanks!
why is there a problem with priority if there are other units on the ramp? priority does exactly what you want to achieve. as soon as a unit sees the high priority unit it attacks this unit instead of all other units around. if there are two or more units with the same priority, it stays on the same target until its dead
trigger cooldown:
-global variable boolean cooldownxy false
your trigger:
-condition: cooldown == false
-actions: set cooldown = true
do stuff
wait x seconds or start another timed trigger
set cooldown = false
Because the units on the ramp are varied. I dont want them to target a specific unit first and I don't want to have to set a priority rating to all my units. Because there will be turrets and such there also. Rather, target the first unit they see on the ramp.
all units and buildings have a general priority of 20. you just have to raise the priority of the tanks and they will attack everything else as soon as the see it and attack the tank as soon one is there.
Saying you want the first unit they see to be the target is opposite of your requests tanks being first target
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hello, I am trying to do a tug of war map. Now, I have a siege tank positioned on top of a ramp. So I have a trigger that uses damage source for the AI to locate the siege tank, attacks it and then goes back to its planned route.
The problem is, if I have 2 siege tanks at different positions attacking the AI, the damage source trigger will send the AI haywire.
The AI will attack the first siege tank, but if the second siege tank attacks, they will target the 2nd siege tank instead of the 1st one UNTIL the first siege tank attacks.
Any ideas how to solve this? I am using " Unit - Order (Triggering unit) to ( Attack targeting (Damaging unit)) (Before Existing Orders)" I tried changing to replace, but it got worse!
first off all you want to make clear for yourself, how you want them to behave
i guess only run to the second if the first one got killed
-you can add a "cooldown" to the attack tank trigger
-you can simply do it without trigger and give the tanks a high priority in data
-do After Exsisting Orders if the unit is attacking a tank already
you recommend data
@b0ne123: Go
Yes, that is what I want to achieve.
I tried after existing orders, but I already have an order to the units, which is to attack a specific region If i use after existing orders, it wouldnt work because they will attack the region first.
As for giving the tanks a high priority, that wouldn't work in my scenario because its not only tanks that will be on the ramp. Besides, if the tanks have a high priority I think the result will still be the same as the priorities for the tanks are the same.
As for the "you can add a "cooldown" to the attack tank trigger" this sounds interesting. Can you please elaborate more about it?
Edit: FIXED! Thanks for your help anyway. I used (Count of orders on (Triggering unit)) < 2 so that the orders wouldn't overwrite. But, can you still explain the cooldown to the trigger? I have a feeling this may help in other parts of my modding. Thanks!
why is there a problem with priority if there are other units on the ramp? priority does exactly what you want to achieve. as soon as a unit sees the high priority unit it attacks this unit instead of all other units around. if there are two or more units with the same priority, it stays on the same target until its dead
trigger cooldown:
-global variable boolean cooldownxy false
your trigger:
-condition: cooldown == false
-actions: set cooldown = true
do stuff
wait x seconds or start another timed trigger
set cooldown = false
Because the units on the ramp are varied. I dont want them to target a specific unit first and I don't want to have to set a priority rating to all my units. Because there will be turrets and such there also. Rather, target the first unit they see on the ramp.
all units and buildings have a general priority of 20. you just have to raise the priority of the tanks and they will attack everything else as soon as the see it and attack the tank as soon one is there.
Saying you want the first unit they see to be the target is opposite of your requests tanks being first target