So, I have a unit with 2 weapons that can attack simultaneously. What I want to know is if anyone has any ideas on how I can have those weapons NOT attack the same unit at the same time. Right now I have it set up so that the weapons apply an invis buff with their normal attacks. I have a validator that checks before the weapon fires to see if the weapon's target has said invis buff and prevents the weapon from attacking that unit if it does. So this is great, I have what I want, EXCEPT that this method means that the same unit (controlled by a different player) cannot attack the unit while the first player is attacking it.
Not sure if I made it clear enough so I'll try explaining like so: Player A has the unit TANK. The unit TANK has 2 cannons. I want those 2 cannons to be unable to attack the target Q at the same time, but I still want a different unit TANK (controlled by Player B) to be able to attack target Q with one of its cannons.
At this point I'm thinking that Target Sorts is the closest I can get to this. I'm also looking through various validators and the markors on the effects to try and check the difference between the two TANK units and their controlling Player, but not quite sure how to do this.
What I have decided to do is to split the two cannons into separate weapons (Cannon 1 and Cannon 2) and rather than have the cannons apply the same invis buff have them apply there own specific buff. Cannon 1 will apply "Cannon 1 attack target" and Cannon 2 will apply "Cannon 2 attack target." Then I will just use validators to prevent Cannon 1 from attacking the unit with "Cannon 2 attack target" and vice-versa. This way at least the two cannons will be unable to attack the same target simultaneously while still allowing Cannon 1 on the TANK unit controlled by Player B to attack the same target as Player A's TANK unit. This just means that Cannon 1 on Player B's Tank unit will not be able to attack the same target as Cannon 1 from Player A's TANK unit, but hopefully that wont really matter.
you could use the flags that allow the weapon to attack stuff outside the attack target. Then use a Unit Order Queue validator so one weapon can not attack the target of the attack ability.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
oh right the "only fire at attack target" flag. I thought he was referring to something similar to "Caster Outer Point" that you would see in Effect: Unit+ on apply behavior effects and the like for some reason.
Edit: hrmm... still having problems. worse yet, something got tripped somewhere and now only one of the turrets will fire unless i remove all validators from it. trying to debug it, but everything seems to be in order. not sure what the problem is.
All right, I managed to get it working again using the unit order queue, but what's interesting is that it only works some of the time. occasionally, one of the cannons simply refuses to fire for some time then starts working fine after that. I've checked the "continuous scan" box for both weapons and that seems to have decreased the chances of one of the cannons refusing to fire.
So, I have a unit with 2 weapons that can attack simultaneously. What I want to know is if anyone has any ideas on how I can have those weapons NOT attack the same unit at the same time. Right now I have it set up so that the weapons apply an invis buff with their normal attacks. I have a validator that checks before the weapon fires to see if the weapon's target has said invis buff and prevents the weapon from attacking that unit if it does. So this is great, I have what I want, EXCEPT that this method means that the same unit (controlled by a different player) cannot attack the unit while the first player is attacking it.
Not sure if I made it clear enough so I'll try explaining like so: Player A has the unit TANK. The unit TANK has 2 cannons. I want those 2 cannons to be unable to attack the target Q at the same time, but I still want a different unit TANK (controlled by Player B) to be able to attack target Q with one of its cannons.
At this point I'm thinking that Target Sorts is the closest I can get to this. I'm also looking through various validators and the markors on the effects to try and check the difference between the two TANK units and their controlling Player, but not quite sure how to do this.
What I have decided to do is to split the two cannons into separate weapons (Cannon 1 and Cannon 2) and rather than have the cannons apply the same invis buff have them apply there own specific buff. Cannon 1 will apply "Cannon 1 attack target" and Cannon 2 will apply "Cannon 2 attack target." Then I will just use validators to prevent Cannon 1 from attacking the unit with "Cannon 2 attack target" and vice-versa. This way at least the two cannons will be unable to attack the same target simultaneously while still allowing Cannon 1 on the TANK unit controlled by Player B to attack the same target as Player A's TANK unit. This just means that Cannon 1 on Player B's Tank unit will not be able to attack the same target as Cannon 1 from Player A's TANK unit, but hopefully that wont really matter.
you could use the flags that allow the weapon to attack stuff outside the attack target. Then use a Unit Order Queue validator so one weapon can not attack the target of the attack ability.
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
ah! Didn't think of Unit Order Queue I'll try that out then. What specific flags are you referring to? On the weapon or the weapon's effect?
There are flags on the Weapon object which allows it to attack non-attack ability targets. Check the diamondback to see how it's done.
oh right the "only fire at attack target" flag. I thought he was referring to something similar to "Caster Outer Point" that you would see in Effect: Unit+ on apply behavior effects and the like for some reason.
Edit: hrmm... still having problems. worse yet, something got tripped somewhere and now only one of the turrets will fire unless i remove all validators from it. trying to debug it, but everything seems to be in order. not sure what the problem is.
All right, I managed to get it working again using the unit order queue, but what's interesting is that it only works some of the time. occasionally, one of the cannons simply refuses to fire for some time then starts working fine after that. I've checked the "continuous scan" box for both weapons and that seems to have decreased the chances of one of the cannons refusing to fire.
Look at my harvest simulator demo map to see that validator abused to its finest.
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