I'm sure this problem has already been solved somewhere and the information can be figured out in various data guides anyway - but I've tried for hours now and I really need some help :S
It's quite simple: I have an AOE spell that applies a buff to nearby units, and it should only be auto-casted if a nearby unit does NOT have the buff.
I thought this would be simple and straight forward but sadly I failed to create it.
Create a Unit Compare Behavior Count validator. Change the (Basic) Validator: Behavior field to the buff behavior and ensure that the (Basic) Validator: Value field is set to 0.
Create an Enumerate Area validator. Set the (Basic) Target: Location + field to Caster Unit/Point. Under the (Basic) Search: Areas + field, click the green plus (+) to add a field. Set the Arc to 360, Compare to Equal To, Count to 0, and the Radius to the desired "nearby"range in which you want the validator to evaluate units for the state of the ability's auto cast. Set the Validator to the Unit Compare Behavior Count validator you created earlier.
From there, assuming you have the auto cast filters and other fields set up correctly for your ability, all you have to do is add this newly created Enumerate Area validator to the Ability: Auto Cast Validators + field of your ability.
I hope I understood your problem correctly; this makes it so that if units with the said buff are within the radius designated in the Enumerate Area validator, the ability will not be auto cast.
I made a small adjustment with the "Area - Count" by setting it to "-1". Perhaps there was a misunderstanding with how it was supposed to work exactly. Either way the overall spell works with the validator. I've tested it a couple of times and it works exactly as I intended. The spell is only cast if a nearby unit does not have the buff.
Thank you so much aZergBaneling. My problem is solved!
Ah, my mistake; setting the Count to 0 in the Enumerate Area will make the validator return true only if there are 0 units with 0 of the buff in that area. What you did was make it so it searched to ensure that an infinite units in the area have 0 of the buff.
In other words, my solution contained a double negative, returning true only if there are 0 units with 0 of the behavior within the area.
The other way you could have fixed it would be by setting the (Basic) Validator: Value field in the Unit Compare Behavior Count validator to evaluate for greater than or equal to 1 or greater than 0; this would make the Enumerate Area validator run true if 0 units in the area have one or more of the buff on them.
I'm sure this problem has already been solved somewhere and the information can be figured out in various data guides anyway - but I've tried for hours now and I really need some help :S
It's quite simple: I have an AOE spell that applies a buff to nearby units, and it should only be auto-casted if a nearby unit does NOT have the buff.
I thought this would be simple and straight forward but sadly I failed to create it.
Thanks for looking into this!
Create a Unit Compare Behavior Count validator. Change the (Basic) Validator: Behavior field to the buff behavior and ensure that the (Basic) Validator: Value field is set to 0.
Create an Enumerate Area validator. Set the (Basic) Target: Location + field to Caster Unit/Point. Under the (Basic) Search: Areas + field, click the green plus (+) to add a field. Set the Arc to 360, Compare to Equal To, Count to 0, and the Radius to the desired "nearby"range in which you want the validator to evaluate units for the state of the ability's auto cast. Set the Validator to the Unit Compare Behavior Count validator you created earlier.
From there, assuming you have the auto cast filters and other fields set up correctly for your ability, all you have to do is add this newly created Enumerate Area validator to the Ability: Auto Cast Validators + field of your ability.
I hope I understood your problem correctly; this makes it so that if units with the said buff are within the radius designated in the Enumerate Area validator, the ability will not be auto cast.
Custom Campaign Initiative | Mapster Community Project: Data Wizards
Starcraft II: Unsung Rebels, a custom campaign for Starcraft II
SC2Saver, a way to create saved games via trigger
Frustrated with the editor and would like answers in real time? Join the SC2Mapster Discord!
That worked!
I made a small adjustment with the "Area - Count" by setting it to "-1". Perhaps there was a misunderstanding with how it was supposed to work exactly. Either way the overall spell works with the validator. I've tested it a couple of times and it works exactly as I intended. The spell is only cast if a nearby unit does not have the buff.
Thank you so much aZergBaneling. My problem is solved!
Ah, my mistake; setting the Count to 0 in the Enumerate Area will make the validator return true only if there are 0 units with 0 of the buff in that area. What you did was make it so it searched to ensure that an infinite units in the area have 0 of the buff.
In other words, my solution contained a double negative, returning true only if there are 0 units with 0 of the behavior within the area.
The other way you could have fixed it would be by setting the (Basic) Validator: Value field in the Unit Compare Behavior Count validator to evaluate for greater than or equal to 1 or greater than 0; this would make the Enumerate Area validator run true if 0 units in the area have one or more of the buff on them.
Custom Campaign Initiative | Mapster Community Project: Data Wizards
Starcraft II: Unsung Rebels, a custom campaign for Starcraft II
SC2Saver, a way to create saved games via trigger
Frustrated with the editor and would like answers in real time? Join the SC2Mapster Discord!