AI hero wont attack on creep

streng

Member
Reaction score
1
Hi guys. I have a problem with trigering AI. My map is based on hero arena with many creep camps(based on level and strong). Some of my creeps has acqusition range set to 1. Because in my map is diference betweeen agresive and pasive creeps but all of my creeps are based on neutral hostile. But i have a problem. AI Hero dont attack on creep wich have acqusition range set to 1. On other creep with acqusition range more than 150 hero attack.
Here is my Triger :
Code:
Untitled Trigger 003
    Events
        Time - Every 5.00 seconds of game time
    Conditions
    Actions
        Set AIpoint1 = (Position of (Random unit from (Units in Region 023 <gen>)))
        Set AIpoint2 = (Position of (Random unit from (Units in Region 024 <gen>)))
        Unit Group - Pick every unit in (Units in Region 018 <gen>) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        And - All (Conditions) are true
                            Conditions
                                ((Picked unit) is A Hero) Equal to True
                                (Percentage life of (Picked unit)) Greater than or equal to 85.00
                                (Level of (Picked unit)) Less than 6
                                ((Owner of (Picked unit)) controller) Equal to Computer
                    Then - Actions
                        Unit - Order (Picked unit) to Attack-Move To AIpoint1
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                And - All (Conditions) are true
                                    Conditions
                                        ((Picked unit) is A Hero) Equal to True
                                        (Percentage life of (Picked unit)) Greater than or equal to 85.00
                                        (Level of (Picked unit)) Greater than 5
                                        ((Owner of (Picked unit)) controller) Equal to Computer
                            Then - Actions
                                Unit - Order (Picked unit) to Attack-Move To AIpoint2
                            Else - Actions

My question is: Is any way to order hero to attack any creep in region, not only with acquisition range ?
And second question is how to learn hero about priority of attacking ? I Think if AI spot enemy hero lock target on him and atacking only on him.

Thanks for your answers.
 

thorhunter

You can change this now in User CP.
Reaction score
32
Yes, under 'Issue order targetting an unit', there is 'attack' order which direcly points at unit. I'm not an AI expert, but since you trigger enemy behaviors, you can aswell set priority using variables or conditions, eg. pick every unit in region and check if there's a hero, then attack, if not, attack random unit in region etc. You can aswell assign integer value of priority to every unit and then pick the one with highest to be attacked. All depends on how complez you want your AI to be.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top