i need to solve this problem. i create 2 ravens, and i need 1 of them to cast hsm when he see one unit.
i want to make this in a clean and nice way, without workarounds.
i cant find how to instruct AI to do this.. so i found a trigger
" Unit - Any Unit Enters a distance of 3.0 from (Unit 1 from ravens) "
where ravens is a unit group containing the 2 ravens..
but this trigger never triggers.. i suppose because at start ravens = 0, and then i create 2 ravens and assign them to the group, but the trigger already "registered" himself with ravens = 0, and the variable is not update and the trigger always run with raven = 0.
Unit - Any Unit Enters a distance of 3.0 from (Unit 1 from ravens)
Debug - Display "triggers" as debug output using Type 1, and Do display it in the game window
Unit - Order (Unit 1 from ravens) to (Raven - Raven - Seeker Missile (Triggering unit)) (Replace Existing Orders)
i haev this trigger, ravens is a unit group (i create 2 ravens and assign them to this unit group)
this will never triggers.. dont know why.
I don't know if you really want to use triggers, but it can be done simply with behaviors and effects.
First, create an effect (Issue Order). Set the issued order to the ability you want to use.
Then, create another effect (Search Area). Set the area to something high, like 10 or 15. in the search filters, set Visible to Required. finally, in the search area, set the effect to your issue order you just created.
finally, create a behavior (Buff) with a duration of -1, a period of 0.0001 and the effect will be your Search effect you created. Add the behavior to your unit and it should cast the ability to the units that come in his "sight range"
There may be some field I didn't mentioned, check my map to be sure :P