• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[GUI] AI System v2.2.4

GUI AI System

AI system made by GUI. No need to use JASS anymore!!

-The AI does list-

+This AI will look for targets and attacks them.
+AI retreats if they know they are going to lose the battle.
+AI defends base.
+AI hero retreats when they are dying.
+AI hero picks items. And uses them.
+AI heroes learns skills.


-The AI does not list-

-Buy items from shop. (The AOS version of this system has a item buy system try it.)
-Use skills. (I recomend to use the blizzard's order string.)

If you don't have heroes, it's easy. Copy and paste and change the arrays of the vairable to 12. If you have heroes, you have to set the skill build. If you don't know how to set the skill build, ask me.

1. The initial size of variables except for "FightingForceStrength" must be 12. For "FightingForceStrength" it must be set to 2.
2. In "AI Is attacked" trigger, you can change when the AI retreats. The higher the value is the AI will feel strong (It means if the value is low, the AI will act like cowards). Also you can set the item pick range there.
3. To set skill build for custom heroes see the "AI Initialization" trigger.


wc3scrnshot021412144624.jpg

AI heroes retreat.
wc3scrnshot021412144547.jpg

wc3scrnshot021412144557.jpg

AI uses spells and picks skills.
wc3scrnshot021512130332.jpg

AI defends their base.
wc3scrnshot021512123757.jpg

AI flees battle that they know they are going to lose.


  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • -------- Remove this line below when you import this --------
          • Player - For (Picked player), turn Shared vision On toward Player 1 (Red)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) controller) Equal to Computer
            • Then - Actions
              • Set AITargetUnit[(Player number of (Picked player))] = No unit
              • Player Group - Add (Picked player) to AIPlayers
            • Else - Actions
      • Hashtable - Create a hashtable
      • Set AbilityHash = (Last created hashtable)
      • -------- Get the raw code of the Hero and the Ability. The first key is the raw code of the Hero and the second key is the level to learn it. --------
      • Custom script: set udg_TempInteger2 = 'Hpal'
      • Custom script: set udg_TempInteger = 'AHhb'
      • Hashtable - Save TempInteger as TempInteger2 of 1 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 4 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 8 in AbilityHash
      • Custom script: set udg_TempInteger = 'AHds'
      • Hashtable - Save TempInteger as TempInteger2 of 2 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 5 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 9 in AbilityHash
      • Custom script: set udg_TempInteger = 'AHad'
      • Hashtable - Save TempInteger as TempInteger2 of 3 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 7 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 10 in AbilityHash
      • Custom script: set udg_TempInteger = 'AHre'
      • Hashtable - Save TempInteger as TempInteger2 of 6 in AbilityHash
      • Custom script: set udg_TempInteger2 = 'Hamg'
      • Custom script: set udg_TempInteger = 'AHbz'
      • Hashtable - Save TempInteger as TempInteger2 of 1 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 4 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 8 in AbilityHash
      • Custom script: set udg_TempInteger = 'AHwe'
      • Hashtable - Save TempInteger as TempInteger2 of 2 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 5 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 9 in AbilityHash
      • Custom script: set udg_TempInteger = 'AHab'
      • Hashtable - Save TempInteger as TempInteger2 of 3 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 7 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 10 in AbilityHash
      • Custom script: set udg_TempInteger = 'AHmt'
      • Hashtable - Save TempInteger as TempInteger2 of 6 in AbilityHash
      • Custom script: set udg_TempInteger2 = 'Hmkg'
      • Custom script: set udg_TempInteger = 'AHtb'
      • Hashtable - Save TempInteger as TempInteger2 of 1 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 4 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 8 in AbilityHash
      • Custom script: set udg_TempInteger = 'AHtc'
      • Hashtable - Save TempInteger as TempInteger2 of 2 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 5 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 9 in AbilityHash
      • Custom script: set udg_TempInteger = 'AHbh'
      • Hashtable - Save TempInteger as TempInteger2 of 3 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 7 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 10 in AbilityHash
      • Custom script: set udg_TempInteger = 'AHav'
      • Hashtable - Save TempInteger as TempInteger2 of 6 in AbilityHash
      • Custom script: set udg_TempInteger2 = 'Hblm'
      • Custom script: set udg_TempInteger = 'AHfs'
      • Hashtable - Save TempInteger as TempInteger2 of 1 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 4 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 8 in AbilityHash
      • Custom script: set udg_TempInteger = 'AHbn'
      • Hashtable - Save TempInteger as TempInteger2 of 2 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 5 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 9 in AbilityHash
      • Custom script: set udg_TempInteger = 'AHdr'
      • Hashtable - Save TempInteger as TempInteger2 of 3 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 7 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 10 in AbilityHash
      • Custom script: set udg_TempInteger = 'AHpx'
      • Hashtable - Save TempInteger as TempInteger2 of 6 in AbilityHash
      • Custom script: set udg_TempInteger2 = 'Obla'
      • Custom script: set udg_TempInteger = 'AOwk'
      • Hashtable - Save TempInteger as TempInteger2 of 1 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 4 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 8 in AbilityHash
      • Custom script: set udg_TempInteger = 'AOmi'
      • Hashtable - Save TempInteger as TempInteger2 of 2 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 5 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 9 in AbilityHash
      • Custom script: set udg_TempInteger = 'AOcr'
      • Hashtable - Save TempInteger as TempInteger2 of 3 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 7 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 10 in AbilityHash
      • Custom script: set udg_TempInteger = 'AOww'
      • Hashtable - Save TempInteger as TempInteger2 of 6 in AbilityHash
      • Custom script: set udg_TempInteger2 = 'Ofar'
      • Custom script: set udg_TempInteger = 'AOcl'
      • Hashtable - Save TempInteger as TempInteger2 of 1 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 4 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 8 in AbilityHash
      • Custom script: set udg_TempInteger = 'AOfs'
      • Hashtable - Save TempInteger as TempInteger2 of 2 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 5 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 9 in AbilityHash
      • Custom script: set udg_TempInteger = 'AOsf'
      • Hashtable - Save TempInteger as TempInteger2 of 3 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 7 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 10 in AbilityHash
      • Custom script: set udg_TempInteger = 'AOeq'
      • Hashtable - Save TempInteger as TempInteger2 of 6 in AbilityHash
      • Custom script: set udg_TempInteger2 = 'Otch'
      • Custom script: set udg_TempInteger = 'AOsh'
      • Hashtable - Save TempInteger as TempInteger2 of 1 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 4 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 8 in AbilityHash
      • Custom script: set udg_TempInteger = 'AOws'
      • Hashtable - Save TempInteger as TempInteger2 of 2 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 5 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 9 in AbilityHash
      • Custom script: set udg_TempInteger = 'AOae'
      • Hashtable - Save TempInteger as TempInteger2 of 3 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 7 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 10 in AbilityHash
      • Custom script: set udg_TempInteger = 'AOre'
      • Hashtable - Save TempInteger as TempInteger2 of 6 in AbilityHash
      • Custom script: set udg_TempInteger2 = 'Oshd'
      • Custom script: set udg_TempInteger = 'AOhw'
      • Hashtable - Save TempInteger as TempInteger2 of 1 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 4 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 8 in AbilityHash
      • Custom script: set udg_TempInteger = 'AOhx'
      • Hashtable - Save TempInteger as TempInteger2 of 2 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 5 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 9 in AbilityHash
      • Custom script: set udg_TempInteger = 'AOsw'
      • Hashtable - Save TempInteger as TempInteger2 of 3 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 7 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 10 in AbilityHash
      • Custom script: set udg_TempInteger = 'AOvd'
      • Hashtable - Save TempInteger as TempInteger2 of 6 in AbilityHash
      • Custom script: set udg_TempInteger2 = 'Udea'
      • Custom script: set udg_TempInteger = 'AUdc'
      • Hashtable - Save TempInteger as TempInteger2 of 1 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 4 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 8 in AbilityHash
      • Custom script: set udg_TempInteger = 'AUdp'
      • Hashtable - Save TempInteger as TempInteger2 of 2 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 5 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 9 in AbilityHash
      • Custom script: set udg_TempInteger = 'AUau'
      • Hashtable - Save TempInteger as TempInteger2 of 3 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 7 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 10 in AbilityHash
      • Custom script: set udg_TempInteger = 'AUan'
      • Hashtable - Save TempInteger as TempInteger2 of 6 in AbilityHash
      • Custom script: set udg_TempInteger2 = 'Ulic'
      • Custom script: set udg_TempInteger = 'AUfn'
      • Hashtable - Save TempInteger as TempInteger2 of 1 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 4 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 8 in AbilityHash
      • Custom script: set udg_TempInteger = 'AUfa'
      • Hashtable - Save TempInteger as TempInteger2 of 2 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 5 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 9 in AbilityHash
      • Custom script: set udg_TempInteger = 'AUdr'
      • Hashtable - Save TempInteger as TempInteger2 of 3 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 7 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 10 in AbilityHash
      • Custom script: set udg_TempInteger = 'AUdd'
      • Hashtable - Save TempInteger as TempInteger2 of 6 in AbilityHash
      • Custom script: set udg_TempInteger2 = 'Udre'
      • Custom script: set udg_TempInteger = 'AUcs'
      • Hashtable - Save TempInteger as TempInteger2 of 1 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 4 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 8 in AbilityHash
      • Custom script: set udg_TempInteger = 'AUsl'
      • Hashtable - Save TempInteger as TempInteger2 of 2 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 5 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 9 in AbilityHash
      • Custom script: set udg_TempInteger = 'AUav'
      • Hashtable - Save TempInteger as TempInteger2 of 3 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 7 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 10 in AbilityHash
      • Custom script: set udg_TempInteger = 'AUin'
      • Hashtable - Save TempInteger as TempInteger2 of 6 in AbilityHash
      • Custom script: set udg_TempInteger2 = 'Ucrl'
      • Custom script: set udg_TempInteger = 'AUim'
      • Hashtable - Save TempInteger as TempInteger2 of 1 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 4 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 8 in AbilityHash
      • Custom script: set udg_TempInteger = 'AUcb'
      • Hashtable - Save TempInteger as TempInteger2 of 2 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 5 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 9 in AbilityHash
      • Custom script: set udg_TempInteger = 'AUts'
      • Hashtable - Save TempInteger as TempInteger2 of 3 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 7 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 10 in AbilityHash
      • Custom script: set udg_TempInteger = 'AUls'
      • Hashtable - Save TempInteger as TempInteger2 of 6 in AbilityHash
      • Custom script: set udg_TempInteger2 = 'Ekee'
      • Custom script: set udg_TempInteger = 'AEer'
      • Hashtable - Save TempInteger as TempInteger2 of 1 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 4 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 8 in AbilityHash
      • Custom script: set udg_TempInteger = 'AEfn'
      • Hashtable - Save TempInteger as TempInteger2 of 2 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 5 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 9 in AbilityHash
      • Custom script: set udg_TempInteger = 'AEah'
      • Hashtable - Save TempInteger as TempInteger2 of 3 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 7 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 10 in AbilityHash
      • Custom script: set udg_TempInteger = 'AEtq'
      • Hashtable - Save TempInteger as TempInteger2 of 6 in AbilityHash
      • Custom script: set udg_TempInteger2 = 'Emoo'
      • Custom script: set udg_TempInteger = 'AEst'
      • Hashtable - Save TempInteger as TempInteger2 of 1 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 4 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 8 in AbilityHash
      • Custom script: set udg_TempInteger = 'AEfa'
      • Hashtable - Save TempInteger as TempInteger2 of 2 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 5 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 9 in AbilityHash
      • Custom script: set udg_TempInteger = 'AEar'
      • Hashtable - Save TempInteger as TempInteger2 of 3 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 7 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 10 in AbilityHash
      • Custom script: set udg_TempInteger = 'AEsf'
      • Hashtable - Save TempInteger as TempInteger2 of 6 in AbilityHash
      • Custom script: set udg_TempInteger2 = 'Edem'
      • Custom script: set udg_TempInteger = 'AEmb'
      • Hashtable - Save TempInteger as TempInteger2 of 1 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 4 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 8 in AbilityHash
      • Custom script: set udg_TempInteger = 'AEim'
      • Hashtable - Save TempInteger as TempInteger2 of 2 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 5 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 9 in AbilityHash
      • Custom script: set udg_TempInteger = 'AEev'
      • Hashtable - Save TempInteger as TempInteger2 of 3 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 7 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 10 in AbilityHash
      • Custom script: set udg_TempInteger = 'AEme'
      • Hashtable - Save TempInteger as TempInteger2 of 6 in AbilityHash
      • Custom script: set udg_TempInteger2 = 'Ewar'
      • Custom script: set udg_TempInteger = 'AEfk'
      • Hashtable - Save TempInteger as TempInteger2 of 1 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 4 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 8 in AbilityHash
      • Custom script: set udg_TempInteger = 'AEbl'
      • Hashtable - Save TempInteger as TempInteger2 of 2 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 5 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 9 in AbilityHash
      • Custom script: set udg_TempInteger = 'AEsh'
      • Hashtable - Save TempInteger as TempInteger2 of 3 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 7 in AbilityHash
      • Hashtable - Save TempInteger as TempInteger2 of 10 in AbilityHash
      • Custom script: set udg_TempInteger = 'AEsv'
      • Hashtable - Save TempInteger as TempInteger2 of 6 in AbilityHash
  • AI Every 2 sec
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Set TempGroup = (Units in (Playable map area) matching (((Matching unit) is alive) Equal to True))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Player Group - Pick every player in AIPlayers and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Picked unit)) Equal to (Picked player)
                  • ((Picked unit) is A peon-type unit) Equal to False
                  • ((Picked unit) is A structure) Equal to False
                  • ((Picked unit) is in AIInjuredHeroes[(Player number of (Picked player))]) Equal to False
                  • ((Picked unit) is in AIUnits[(Player number of (Picked player))]) Equal to False
                  • ((Picked unit) is in CastingAIUnits) Equal to False
                • Then - Actions
                  • Unit Group - Add (Picked unit) to AIUnits[(Player number of (Picked player))]
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is A Hero) Equal to True
                    • Then - Actions
                      • Unit Group - Add (Picked unit) to AIHeroes[(Player number of (Picked player))]
                    • Else - Actions
                • Else - Actions
      • Player Group - Pick every player in AIPlayers and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • AITargetUnit[(Player number of (Picked player))] Equal to No unit
            • Then - Actions
              • Set AITargetUnit[(Player number of (Picked player))] = (Random unit from TempGroup)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Owner of AITargetUnit[(Player number of (Picked player))]) is an ally of (Picked player)) Equal to True
                • Then - Actions
                  • Set AITargetUnit[(Player number of (Picked player))] = No unit
                • Else - Actions
              • Set TempPoint = (Position of AITargetUnit[(Player number of (Picked player))])
              • Unit Group - Order AIUnits[(Player number of (Picked player))] to Attack-Move To TempPoint
              • Custom script: call RemoveLocation(udg_TempPoint)
            • Else - Actions
              • Set TempPoint = (Position of AITargetUnit[(Player number of (Picked player))])
              • Unit Group - Order AIUnits[(Player number of (Picked player))] to Attack-Move To TempPoint
              • Custom script: call RemoveLocation(udg_TempPoint)
          • Unit Group - Pick every unit in AIHeroes[(Player number of (Picked player))] and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Percentage life of (Picked unit)) Less than 35.00
                • Then - Actions
                  • Unit Group - Remove (Picked unit) from AIUnits[(Player number of (Picked player))]
                  • Unit Group - Add (Picked unit) to AIInjuredHeroes[(Player number of (Picked player))]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of items carried by (Picked unit)) Less than 6
                • Then - Actions
                  • Item - Pick every item in (Playable map area) and do (Actions)
                    • Loop - Actions
                      • Set TempPoint = (Position of (Picked item))
                      • Set TempPoint2 = (Position of (Picked unit))
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Distance between TempPoint and TempPoint2) Less than 500.00
                        • Then - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Item-type of (Picked item)) Equal to Tome of Power
                              • (Hero level of (Picked unit)) Equal to 10
                            • Then - Actions
                            • Else - Actions
                              • Unit - Order (Picked unit) to Right-Click (Picked item)
                        • Else - Actions
                      • Custom script: call RemoveLocation(udg_TempPoint)
                      • Custom script: call RemoveLocation(udg_TempPoint2)
                • Else - Actions
          • Unit Group - Pick every unit in AIInjuredHeroes[(Player number of (Picked player))] and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Percentage life of (Picked unit)) Less than 100.00
                • Then - Actions
                  • Set TempPoint = ((Picked player) start location)
                  • Unit - Order (Picked unit) to Move To TempPoint
                  • Custom script: call RemoveLocation(udg_TempPoint)
                • Else - Actions
                  • Unit Group - Add (Picked unit) to AIUnits[(Player number of (Picked player))]
                  • Unit Group - Remove (Picked unit) from AIInjuredHeroes[(Player number of (Picked player))]
      • Custom script: call DestroyGroup(udg_TempGroup)
  • AI Remove Dead Unit
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Unit Group - Remove (Triggering unit) from CastingAIUnits
      • Player Group - Pick every player in AIPlayers and do (Actions)
        • Loop - Actions
          • Unit Group - Remove (Triggering unit) from AIUnits[(Player number of (Picked player))]
          • Unit Group - Remove (Triggering unit) from AIInjuredHeroes[(Player number of (Picked player))]
          • Unit Group - Remove (Triggering unit) from AIHeroes[(Player number of (Picked player))]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to AITargetUnit[(Player number of (Picked player))]
            • Then - Actions
              • Set AITargetUnit[(Player number of (Picked player))] = No unit
            • Else - Actions
  • AI Is attacked
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • Set AITargetUnit[(Player number of (Owner of (Attacked unit)))] = (Attacking unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Triggering unit)) controller) Equal to Computer
          • AIIsDefendingBase[(Player number of (Owner of (Triggering unit)))] Equal to False
        • Then - Actions
          • Set TempPoint = (Position of (Attacking unit))
          • Set TempGroup = (Units within 1200.00 of TempPoint matching (((Owner of (Matching unit)) is an ally of (Owner of (Attacking unit))) Equal to True))
          • Unit Group - Pick every unit in TempGroup and do (Actions)
            • Loop - Actions
              • Set FightingForceStrength[1] = (FightingForceStrength[1] + (Life of (Picked unit)))
          • Custom script: call DestroyGroup(udg_TempGroup)
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Set TempPoint = (Position of (Attacked unit))
          • Set TempGroup = (Units within 1200.00 of TempPoint matching (((Owner of (Matching unit)) is an ally of (Owner of (Attacked unit))) Equal to True))
          • Unit Group - Pick every unit in TempGroup and do (Actions)
            • Loop - Actions
              • Set FightingForceStrength[2] = (FightingForceStrength[2] + (Life of (Picked unit)))
          • Custom script: call DestroyGroup(udg_TempGroup)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (FightingForceStrength[1] - FightingForceStrength[2]) Greater than or equal to 3500.00
            • Then - Actions
              • Set TempPoint2 = ((Owner of (Attacked unit)) start location)
              • Unit Group - Order AIUnits[(Player number of (Owner of (Triggering unit)))] to Move To TempPoint2
              • Custom script: call RemoveLocation(udg_TempPoint2)
            • Else - Actions
          • Set AITargetUnit[(Player number of (Owner of (Triggering unit)))] = No unit
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Custom script: call RemoveLocation(udg_TempPoint2)
          • Set FightingForceStrength[1] = 0
          • Set FightingForceStrength[2] = 0
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Triggering unit)) controller) Equal to Computer
          • ((Triggering unit) is A structure) Equal to True
        • Then - Actions
          • Unit Group - Pick every unit in AIUnits[(Player number of (Owner of (Triggering unit)))] and do (Actions)
            • Loop - Actions
              • Set AIIsDefendingBase[(Player number of (Owner of (Triggering unit)))] = True
              • 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
                      • ((Picked unit) is in CastingAIUnits) Equal to False
                      • AIIsDefendingBase[(Player number of (Owner of (Triggering unit)))] Equal to False
                • Then - Actions
                  • Hero - Order (Picked unit) to use (Item carried by (Picked unit) in slot 1) on (Attacked unit)
                  • Unit - Order (Picked unit) to Hold Position
                • Else - Actions
          • Wait 10.00 seconds
          • Set AIIsDefendingBase[(Player number of (Owner of (Triggering unit)))] = False
        • Else - Actions
  • AI Hero Learn Skill
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • ((Owner of (Triggering unit)) controller) Equal to Computer
    • Actions
      • Custom script: call SelectHeroSkill( GetTriggerUnit(), LoadInteger(udg_AbilityHash, GetUnitTypeId(GetTriggerUnit()), GetUnitLevel(GetTriggerUnit())))
  • AI Hero Learn Skill 2
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • ((Owner of (Triggering unit)) controller) Equal to Computer
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Custom script: call SelectHeroSkill( GetTriggerUnit(), LoadInteger(udg_AbilityHash, GetUnitLevel(GetTriggerUnit()), GetUnitTypeId(GetTriggerUnit())))
  • AI Hero Cast
    • Events
      • Unit - A unit Starts the effect of an ability
      • Unit - A unit Begins casting an ability
      • Unit - A unit Begins channeling an ability
    • Conditions
      • ((Owner of (Triggering unit)) controller) Equal to Computer
    • Actions
      • Unit Group - Remove (Triggering unit) from AIUnits[(Player number of (Owner of (Triggering unit)))]
      • Unit Group - Add (Triggering unit) to CastingAIUnits
  • AI Hero Cast Stop
    • Events
      • Unit - A unit Stops casting an ability
      • Unit - A unit Finishes casting an ability
    • Conditions
      • ((Owner of (Triggering unit)) controller) Equal to Computer
    • Actions
      • Unit Group - Add (Triggering unit) to AIUnits[(Player number of (Owner of (Triggering unit)))]
      • Unit Group - Remove (Triggering unit) from CastingAIUnits

v1.0.1 Forgot to use the CastingAIUnits Group.
v1.1.1 Added Item Pick system
v1.2.1 AI now flee battles that they know that they are going to lose. AI defends their base.
v1.2.4 AI base defending bug is fixed.
Fixed a leak. (Thank Bribe)
v1.2.5 Cleaned some systems
v2 Fixed a lot of things. Now it is easier to import. (Thank Maker)
v2.1 Found out why the AI were acting like cowards.
v2.1.1 Finished the hero skill build.
v2.2.2 Fixed the hero skill learn system. (Thank Maker for the help)
v2.2.3 Fixed AI defend base system and skill learn system. (Thank Maker)
v2.2.4 Made it clear how to import.


Please give credits when used.

This CAN be used for AOS maps. Find my post on page 5 and download the map and try it. The AOS AI System Supports item buy.

WAIT!!! If you want a AOS AI System that includes hero chasing and better performance click HERE


Keywords:
AI, Computer, Hero, Arena, Target, Destroy, Retreat, Skill, Spell, AOS
Contents

GUI AI System (Map)

Reviews
Approved The system works, but it could be a lot more efficient and could provide more intelligent heroes. Required changes Add importing instructions into the map file including how to customize the skill build for heroes You also must...
Level 14
Joined
Jul 25, 2011
Messages
1,065
From what I can tell, this'll mean Computer controlled units will attack random targets and not in groups, thus causing each individual unit to be /Very/ vulnerable to a single play who /does/ group up their units, and also for them to challenge much stronger units than themselves, which honestly, I don't think is that great - considering it decreases aplicability to other maps.

I'd suggest adding an option so that you can make AI units group together and attack /as a group/ rather than as individual units, as for preventing them from picking a losing fight - I honestly don't know what you'd do about that (I mean, you wouldn't get a footman to attack a knight, that'd be just silly)


They retreat if they know thay are going to lose (The health defference is more than 3500 <- you can change this to any value.). They'll attack as a group because the trigger is "Order unit group".
 
Ah right I see, Although the other thing I was goinbg to meantion

What happens if they all target a unit that is invisible? will they just follow it indefinately?

And another thing: Doesn't this hive them sight of units they "haven't found" yet? I.e. units which a player may be trying to "sneak around the back" which they'll just know the locations of and go to immediately anyway?
 
Level 14
Joined
Jul 25, 2011
Messages
1,065
Ah right I see, Although the other thing I was goinbg to meantion

What happens if they all target a unit that is invisible? will they just follow it indefinately?

And another thing: Doesn't this hive them sight of units they "haven't found" yet? I.e. units which a player may be trying to "sneak around the back" which they'll just know the locations of and go to immediately anyway?

I think so. I couldn't improve it better.... They know where you are...
 
Level 2
Joined
Mar 13, 2012
Messages
19
From what I can tell, this'll mean Computer controlled units will attack random targets and not in groups, thus causing each individual unit to be /Very/ vulnerable to a single play who /does/ group up their units, and also for them to challenge much stronger units than themselves, which honestly, I don't think is that great - considering it decreases aplicability to other maps.

I'd suggest adding an option so that you can make AI units group together and attack /as a group/ rather than as individual units, as for preventing them from picking a losing fight - I honestly don't know what you'd do about that (I mean, you wouldn't get a footman to attack a knight, that'd be just silly)

In my battle map, they are suppose to attack random targets. It is basically a free for all deathmatch.
 
Level 14
Joined
Jul 25, 2011
Messages
1,065
Wow. I looked at the triggers and I didn't understand any.... They run away like cowards... Any ways I think this is good.

You can change that by changing the value of the "AI Retreat" trigger.

EDIT : LOL. I just found out why were the AIs acting like cowards. Because I forgot to set the "FightingForceStrength" to 0.

EDIT : Here's the AOS test map.

EDIT : Fixed the AOS test map.

EDIT : Added item buy system.
 

Attachments

  • GUI AI System AOS.w3x
    48.3 KB · Views: 120
Last edited:
Level 4
Joined
Oct 2, 2015
Messages
76
They use their ablilities. And it's easy to use. For example, you make a ablility that heals your units. Then set the order string to someting like "Heal" things. Then computer players will use it automaticlly. And just add your custom spell to the "AI Hero Learn Skill" trigger.
clipboard01oubf.jpg

Change it to someting you want.

Wtf i don't see the image
 
Top