Making AI attack units by script concerns me

Status
Not open for further replies.
Level 10
Joined
May 24, 2016
Messages
339
So I have an scripted AI units making them to attack nearby units.
1)Some units may return to their start position, only after they respond to timer, checking if they are execute attack order
Code:
if FocusedUnit[i] != null and GetUnitCurrentOrder(F) != String2OrderId("attack") then
                        call IssuePointOrder(F, "attack", GetUnitX(FocusedUnit[i]), GetUnitY(FocusedUnit[i]))
                    endif
2)When a group gets larger, it becomes to brake often on their way. I guess it is realted with a fact I force to give an order separately to each unit in a group.

Also I wonder is it a correct way (GetUnitCurrentOrder(F) != String2OrderId("attack")) to check if unit is executing attack command right now.
 
Status
Not open for further replies.
Top