1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Dismiss Notice
  3. After a long wait, the results for Terraining Contest #18 are finally out! Drop by and congratulate the winners!
    Dismiss Notice
  4. The poll for Concept Art Contest #9 is up! Cast your vote for your favourite entry!
    Dismiss Notice
  5. Hero Contest #8 is up and running! This time it's a joint contest between artists and coders. Go here for team matchmaking.
    Dismiss Notice
  6. Our first StarCraft contest, The Galaxy Terraining Contest #1 - World Wonders has started. Enter to show off your Galaxy Editor skills and win a custom rank icon among other things.
    Dismiss Notice
  7. Ever wanted to get your sets ready for fast texturing while still having fun? Now it is possible with our newest Mini-Texturing Contest.
    The Skeleton Units need your dire help!
    Dismiss Notice
  8. The poll for Techtree Contest #11 is up! Cast your vote for your favorite entry.
    Dismiss Notice

[GUI] AI System v2.2.4

Submitted by shinji
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.)

How to import
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.


Screen Shots
[​IMG]
AI heroes retreat.
[​IMG]
[​IMG]
AI uses spells and picks skills.
[​IMG]
AI defends their base.
[​IMG]
AI flees battle that they know they are going to lose.


Triggers
  • 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

Change Log
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)

  1. MilesTro

    MilesTro
    Joined:
    Mar 13, 2012
    Messages:
    18
    I like how the three enemies attack, but I also want the creeps to be enemies too and attack the same way as the enemy AI players. And I don't want anyone sleeping, and no fog of war please.
     
  2. shinji

    shinji
    Joined:
    Jul 25, 2011
    Messages:
    884
    Ok. I'll work on that.
     
  3. shinji

    shinji
    Joined:
    Jul 25, 2011
    Messages:
    884
    @MilesTro

    Here you go my friend.
     

    Attached Files:

  4. MilesTro

    MilesTro
    Joined:
    Mar 13, 2012
    Messages:
    18
    Thanks.

    Some of the AI characters are still not working. The Night Elf is still remaining at one spot, and one Gnoll is still being playable.

    I'll try working one of them.
     
  5. shinji

    shinji
    Joined:
    Jul 25, 2011
    Messages:
    884
    Did you set player 4 to a computer player while playing?
     
  6. MilesTro

    MilesTro
    Joined:
    Mar 13, 2012
    Messages:
    18
    No I haven't.
     
  7. shinji

    shinji
    Joined:
    Jul 25, 2011
    Messages:
    884
    AI will only run if you set it to a computer player. When you create a game put computer players in open slots.
     
  8. MilesTro

    MilesTro
    Joined:
    Mar 13, 2012
    Messages:
    18
    How do you do that?
     
  9. shinji

    shinji
    Joined:
    Jul 25, 2011
    Messages:
    884
    When you play Warcraft 3 fill the empty slots with "computer" players.
     
  10. Tank-Commander

    Tank-Commander

    Spell Reviewer

    Joined:
    May 26, 2009
    Messages:
    1,498
    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)
     
  11. shinji

    shinji
    Joined:
    Jul 25, 2011
    Messages:
    884

    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".
     
  12. Tank-Commander

    Tank-Commander

    Spell Reviewer

    Joined:
    May 26, 2009
    Messages:
    1,498
    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?
     
  13. shinji

    shinji
    Joined:
    Jul 25, 2011
    Messages:
    884
    I think so. I couldn't improve it better.... They know where you are...
     
  14. Tank-Commander

    Tank-Commander

    Spell Reviewer

    Joined:
    May 26, 2009
    Messages:
    1,498
    Well you could do a search (when finding targets) that the target must be within 1800 (max daylight visibility range of units) of one of the units from the group and that should prevent them targetting things which they don't "see"
     
  15. shinji

    shinji
    Joined:
    Jul 25, 2011
    Messages:
    884
    If I do that they will never move until any unit gets close to them. AIs are always like this. Even in melee. They know where you are.
     
  16. Tank-Commander

    Tank-Commander

    Spell Reviewer

    Joined:
    May 26, 2009
    Messages:
    1,498
    Well, it was my understanding that AIs always know where your main buildings are, but not your others - i.e. you can slip units behind them and hide buildings if you want to, or atleast that's what I believed
     
  17. shinji

    shinji
    Joined:
    Jul 25, 2011
    Messages:
    884
    I just couldn't make this system better....
     
  18. MilesTro

    MilesTro
    Joined:
    Mar 13, 2012
    Messages:
    18
    In my battle map, they are suppose to attack random targets. It is basically a free for all deathmatch.
     
  19. shinji

    shinji
    Joined:
    Jul 25, 2011
    Messages:
    884
    Updated. I fixed things as Maker said. I think it's a lot better now.
     
  20. MilesTro

    MilesTro
    Joined:
    Mar 13, 2012
    Messages:
    18
    Do I have to download your system again to check it out?