• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Making AI attack units by script concerns me

Status
Not open for further replies.
Level 9
Joined
May 24, 2016
Messages
304
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