I need to make it so the Top Left cannon only attacks units that are in Region 001 and the Bottom Left cannon only attacks units that are in Region 002.
The best way I can think of to do this is to use triggers to make the cannons attack (and remove it from the command card, presumably). Unfortunately, this leaves the player who owns the cannons unable to control which units are attacked (as the targets are designated by triggers). If you're willing to try, however, you might be able to instead validate the attack by checking for dummy behaviors placed on units entering the different regions.
My ways of doing this would involve making 1 sets of behavior/weapon per lane. Just duplicate the photon canon weapon and make a dummy behavior. Get validator for the weapon to only fire at unit with that specific behavior. Then use trigger to swap weapon for your cannon and apply behavior to the stalker. Most robust and time consuming solution i can think of
Another approach would be setting a target invulnerable to the cannon if it's not in the target region. There's a behavior you can add to a unit that makes it invulnerable to a specific unit. Just enable it if the target is not in the lane.
Note, I just stumbled across this last night and didn't actually test it, but the functionality looked to be there.
To be fair, it depends on the number of lanes he's using. Even if he uses up to 8 lanes it should work, just set set turret players to allies without shared vision. Not the most elegant solution, but hey.
I have been working on some triggers which are promising, however. There's one bug left I need to get out, but I'm pretty sure I know how to fix it.
set the target facing direction and then give the units weapon a bit of arc slow so it fires down the lane but not enough slop to fire out of the lane?
so basically don't let the photon cannon work as a turret, just have it set as a facing direction east or w/e you need
I tried programmer's method, which work exactly how I wanted. But it's very tedious to make 6 versions of the same unit in a map that will have 10+ sets of units.
I also tried ChromiumBoy's method that he posted, which also works just like I wanted. ChromiumBoy's method is much easier to implement though. Change a few fields in the triggers and you're set.
I"m going to use ChromiumBoy's method. Thanks everyone.
I realize that the problem is already solved, but I found a different approach that does not rely on a periodic trigger.
This way looks a bit weird since the photon cannon animates a shot even when the shot is canceled. There are probably an easy fix for this.. but I'll leave it as is for now.
Since units attack the closest target first, it's possible that the cannon gets "locked" on a unit outside the lane, so I added a pick / check loop, similar to Chromium's, to see if any units from the correct lane was attackable. This could be expanded to make sure that the cannon also always picks the closest target.
A picture is worth a thousand words:
I need to make it so the Top Left cannon only attacks units that are in Region 001 and the Bottom Left cannon only attacks units that are in Region 002.
Is there a way to do this?
Thank you.
The best way I can think of to do this is to use triggers to make the cannons attack (and remove it from the command card, presumably). Unfortunately, this leaves the player who owns the cannons unable to control which units are attacked (as the targets are designated by triggers). If you're willing to try, however, you might be able to instead validate the attack by checking for dummy behaviors placed on units entering the different regions.
That's all I've got, but I hope it helps
-Vulfe
Place line of sight blockers between the two lanes? Well, providing you don't want other units to fire between lanes as well.
If the latter applies, it can be done using triggers, but I don't have the time to post on it now. I'll have a look at it for you later tonight.
@ChromiumBoy: Go
If the cannons are owned by the same person, LoS-blockers won't do anything.
My ways of doing this would involve making 1 sets of behavior/weapon per lane. Just duplicate the photon canon weapon and make a dummy behavior. Get validator for the weapon to only fire at unit with that specific behavior. Then use trigger to swap weapon for your cannon and apply behavior to the stalker. Most robust and time consuming solution i can think of
If you want to make units fire just one way (like in your screenshot) this could help you Link...
Another approach would be setting a target invulnerable to the cannon if it's not in the target region. There's a behavior you can add to a unit that makes it invulnerable to a specific unit. Just enable it if the target is not in the lane.
Note, I just stumbled across this last night and didn't actually test it, but the functionality looked to be there.
@VulfeSC: Go
To be fair, it depends on the number of lanes he's using. Even if he uses up to 8 lanes it should work, just set set turret players to allies without shared vision. Not the most elegant solution, but hey.
I have been working on some triggers which are promising, however. There's one bug left I need to get out, but I'm pretty sure I know how to fix it.
set the target facing direction and then give the units weapon a bit of arc slow so it fires down the lane but not enough slop to fire out of the lane?
so basically don't let the photon cannon work as a turret, just have it set as a facing direction east or w/e you need
Ok, got it working by using a couple of triggers. See what you guys think.
Sorry for not replying sooner everyone.
I tried programmer's method, which work exactly how I wanted. But it's very tedious to make 6 versions of the same unit in a map that will have 10+ sets of units.
I also tried ChromiumBoy's method that he posted, which also works just like I wanted. ChromiumBoy's method is much easier to implement though. Change a few fields in the triggers and you're set.
I"m going to use ChromiumBoy's method. Thanks everyone.
I realize that the problem is already solved, but I found a different approach that does not rely on a periodic trigger.
This way looks a bit weird since the photon cannon animates a shot even when the shot is canceled. There are probably an easy fix for this.. but I'll leave it as is for now.
Since units attack the closest target first, it's possible that the cannon gets "locked" on a unit outside the lane, so I added a pick / check loop, similar to Chromium's, to see if any units from the correct lane was attackable. This could be expanded to make sure that the cannon also always picks the closest target.
@dre__: Go
No probs ;)
@Berrala: Go
You could include a "clear animation" on the first or second line of the trigger, to get rid of the attack animation.