In my TD, there are a few spots with the lanes close together. I was wondering whether anyone had a suggestion for how to prevent players from attacking units in another lane. The only thing different about the units in each lane is their custom values.
Lots of ways of doing it.... laziest way is to make a Unit Attacks trigger, check if the unit should be attackable by the player and if not issue a Stop order to the unit.
More complicated (but robust) method: for each player, make a unique creep player. Make it so the other creep players are neutral or allied, and then edit all your attacks and abilities and forbid them to target neutral and/or allied units.
Change the target sort on the towers to random then. They will never "waste" attacks as in SC2 the cooldown does not occur until the attack is actually made, and the Unit Starts Attacking event occurs prior to the Damage Point delay. The only issue is that they won't attack at all because they acquire an invalid target and keep trying to attack it instead of finding a different one. So change it so they acquire targets at random until one is valid - or use triggers to manually find the most appropriate target. Lots of ways to make it work.
In my TD, there are a few spots with the lanes close together. I was wondering whether anyone had a suggestion for how to prevent players from attacking units in another lane. The only thing different about the units in each lane is their custom values.
@Vexal: Go
Lots of ways of doing it.... laziest way is to make a Unit Attacks trigger, check if the unit should be attackable by the player and if not issue a Stop order to the unit.
More complicated (but robust) method: for each player, make a unique creep player. Make it so the other creep players are neutral or allied, and then edit all your attacks and abilities and forbid them to target neutral and/or allied units.
@RileyStarcraft: Go
It's a 10 player map. So that will exceed player limit.
Can't use triggers because towers will waste attacks attempting to acquire a target they won't be allowed to shoot.
@Vexal: Go
Change the target sort on the towers to random then. They will never "waste" attacks as in SC2 the cooldown does not occur until the attack is actually made, and the Unit Starts Attacking event occurs prior to the Damage Point delay. The only issue is that they won't attack at all because they acquire an invalid target and keep trying to attack it instead of finding a different one. So change it so they acquire targets at random until one is valid - or use triggers to manually find the most appropriate target. Lots of ways to make it work.
Or use multiple creep players, you only need 2-3 to ensure that each players towers wont attack the neighbors creeps. (http://en.wikipedia.org/wiki/Graph_coloring)