Hi
I'm making an AI system which is rather basic but I am trying to make them prioritize weak units, buildings and heroes. Here is my attempt:
However this doesn't seem to work so I was wondering if anyone knew how to make them prioritize attacking heroes first, then weak buildings and finally weak units?
I'm making an AI system which is rather basic but I am trying to make them prioritize weak units, buildings and heroes. Here is my attempt:
-
AI Threat Detection
-

Events
-

Conditions
-

Actions
-


Set AIMoveAllyGroup = (Units within 800.00 of TempPoint matching ((((Matching unit) belongs to an ally of AITempPlayer) Equal to True) and (((Matching unit) is alive) Equal to True)))
-


Unit Group - Pick every unit in AIMoveAllyGroup and do (Actions)
-



Loop - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






(Owner of TempUnit) Not equal to Neutral Passive
-
-





Then - Actions
-






Set TempUnit = (Picked unit)
-






Set AIMoveAllyHP = (AIMoveAllyHP + (Life of TempUnit))
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








(TempUnit is A Hero) Equal to True
-
-







Then - Actions
-








Set AIMoveAllyLevel = (AIMoveAllyLevel + (4 + (Hero level of TempUnit)))
-
-







Else - Actions
-








If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-









If - Conditions
-










(Unit-type of TempUnit) Equal to Tidal Guardian (Level 1)
-
-









Then - Actions
-










Set AIMoveAllyLevel = (AIMoveAllyLevel + 12)
-
-









Else - Actions
-










If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-











If - Conditions
-












(Unit-type of TempUnit) Equal to Tidal Guardian (Level 2)
-
-











Then - Actions
-












Set AIMoveAllyLevel = (AIMoveAllyLevel + 20)
-
-











Else - Actions
-












If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-













If - Conditions
-














(Unit-type of TempUnit) Equal to Tidal Guardian (Level 3)
-
-













Then - Actions
-














Set AIMoveAllyLevel = (AIMoveAllyLevel + 30)
-
-













Else - Actions
-














If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-















If - Conditions
-
















(TempUnit is A structure) Equal to False
-
-















Then - Actions
-
















Set AIMoveAllyLevel = (AIMoveAllyLevel + (Level of TempUnit))
-
-















Else - Actions
-
-
-
-
-
-
-
-
-
-
-





Else - Actions
-
-
-
-


Set AIMoveAllyAverage = (AIMoveAllyHP x (Real(AIMoveAllyLevel)))
-


Set AIMoveEnemyGroup = (Units within 800.00 of TempPoint matching ((((Matching unit) belongs to an enemy of AITempPlayer) Equal to True) and (((Matching unit) is alive) Equal to True)))
-


Unit Group - Pick every unit in AIMoveEnemyGroup and do (Actions)
-



Loop - Actions
-




Set TempUnit = (Picked unit)
-




Set AIMoveEnemyHP = (AIMoveEnemyHP + (Life of TempUnit))
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






(Owner of TempUnit) Not equal to Neutral Passive
-
-





Then - Actions
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








(TempUnit is A Hero) Equal to True
-
-







Then - Actions
-








Set AIMoveEnemyLevel = (AIMoveEnemyLevel + (4 + (Hero level of TempUnit)))
-
-







Else - Actions
-








If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-









If - Conditions
-










(Unit-type of TempUnit) Equal to Tidal Guardian (Level 1)
-
-









Then - Actions
-










Set AIMoveEnemyLevel = (AIMoveEnemyLevel + 12)
-
-









Else - Actions
-










If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-











If - Conditions
-












(Unit-type of TempUnit) Equal to Tidal Guardian (Level 2)
-
-











Then - Actions
-












Set AIMoveEnemyLevel = (AIMoveEnemyLevel + 20)
-
-











Else - Actions
-












If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-













If - Conditions
-














(Unit-type of TempUnit) Equal to Tidal Guardian (Level 3)
-
-













Then - Actions
-














Set AIMoveEnemyLevel = (AIMoveEnemyLevel + 30)
-
-













Else - Actions
-














If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-















If - Conditions
-
















(TempUnit is A structure) Equal to False
-
-















Then - Actions
-
















Set AIMoveEnemyLevel = (AIMoveEnemyLevel + (Level of TempUnit))
-
-















Else - Actions
-
-
-
-
-
-
-
-
-
-
-





Else - Actions
-
-
-
-


Set AIMoveEnemyAverage = (AIMoveEnemyHP x (Real(AIMoveEnemyLevel)))
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




AIMoveAllyAverage Less than (AIMoveEnemyAverage x 0.65)
-
-



Then - Actions
-




Unit - Order AIHeroUnit to Move To AIMovePoint
-




Unit Group - Add AIHeroUnit to AIMoveGroup
-
-



Else - Actions
-




Unit Group - Pick every unit in AIMoveEnemyGroup and do (Actions)
-





Loop - Actions
-






Set TempUnit = (Picked unit)
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








(TempUnit is A structure) Equal to False
-








(TempUnit is A Hero) Equal to False
-








(Percentage life of TempUnit) Less than 15.00
-
-







Then - Actions
-








Unit - Order AIHeroUnit to Move To AIMovePoint
-








Unit Group - Add AIHeroUnit to AIMoveGroup
-
-







Else - Actions
-








If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-









If - Conditions
-










(TempUnit is A Hero) Equal to True
-










(Percentage life of TempUnit) Less than 40.00
-
-









Then - Actions
-










Unit - Order AIHeroUnit to Move To AIMovePoint
-










Unit Group - Add AIHeroUnit to AIMoveGroup
-
-









Else - Actions
-










If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-











If - Conditions
-












(TempUnit is A structure) Equal to True
-












(Percentage life of TempUnit) Less than 20.00
-
-











Then - Actions
-












Unit - Order AIHeroUnit to Move To AIMovePoint
-












Unit Group - Add AIHeroUnit to AIMoveGroup
-
-











Else - Actions
-












Unit Group - Remove AIHeroUnit from AIMoveGroup
-
-
-
-
-
-
-
-
-




Unit Group - Remove AIHeroUnit from AIMoveGroup
-
-
-


Set AIMoveAllyHP = 0.00
-


Set AIMoveAllyLevel = 0
-


Set AIMoveEnemyHP = 0.00
-


Set AIMoveEnemyLevel = 0
-
-
