1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  3. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  4. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  5. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  6. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  7. The results are out! Check them out.
    Dismiss Notice
  8. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  9. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  10. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[GUI] AI System v2.2.4

Submitted by shinji
This bundle is marked as approved. It works and satisfies the submission rules.
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)

Reviews
Moderator
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...
  1. Reviewed by Maker, AI System v2.2.4, 5th May 2012

    Approved
    The system works, but it could be a lot more efficient and could provide more intelligent heroes.


    Old reviews

    Reviewed by Maker, AI System v2.1.2, 8th Apr 2012

    Required changes
    • Add importing instructions into the map file including how to customize the skill build for heroes
      You also must mention that the initial size of the arrays must be 12
    Suggested changes
    • Instead of picking all items in the map, pick items inside a custom region. Center the region on the hero
    • The system causes FPS drop in the test map, but not as much as before.
      The every 2 seconds trigger is quite heavy still
    • Rename Initialization to AI Initilaization
    • Remove the vision and shared units actions from the initialization trigger
      Use different init trigger for that, one that doesn't belong to the system
    • Save picke unit into a variable in AI Every 2 sec to avoid repeated function calls
    • Remove unneeded variables
    • AI taget unit might be null when you order units to attack move to a position of that unit
      The units won't move anywhere, you could skip giving the order altogether
    • Use a variable for injured state value, set it at map initilaization
      You could also use variables for other values like item pick range
    • AI hero cast doesn't need Starts the effect of an ability event


    Reviewed by Maker, [GUI] AI System v1.2.5, 2nd Apr 2012

    Required changes
    • Don't set map spesific actions in your system's triggers
    • AI hero ability learn initialization is not done correctly
      Don't use BJ functions
      Save things for unit type id's
      It also leaks unit groups
    • The system causes FPS drop every 3 seconds in the test map
    • Don't pick all units in the map for every player every 3 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Owner of (Picked unit)) Equal to (Player((Integer A)))
              • ((Triggering unit) is A structure) Equal to False
              • ...
        • Then - Actions
        • Else - Actions

      ->
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Picked unit)) Equal to (Player((Integer A)))
          • ((Triggering unit) is A structure) Equal to False
          • ...
        • Then - Actions
        • Else - Actions
    • Learn to use player number to avoid integer loops.
      AI Remove Dead Unit trigger for example is very unefficient
    • AI Change Target trigger signals to me that the system is not MUI
    • In AI Attack you should check that the random unit is not null
    • AI Hero Learn Skill test trigger is very unefficient. I recommend using a hashtable and saving stuff with unit type id
    • I think AI Hero Cast trigger should have Begins casting an ability event
    • AI AI Pick Item trigger could use a group that has heroes only so you don't have to
      filter through tons on non hero units


    18th Feb 2012
    Bribe: Please seperate map-specific things into another section, for example you mingled the game message with your actual code, which is not a great idea.

    I recommend instead of using "pick units matching conditions", to pick the units overall and then use an if/then/else (multiple actions) block to filter them out. For example, you could change the group actions in "AI Set Units" to this:

    • Set TempGroup = (Units owned by (Player((Integer A))))
    • Unit Group - Pick every unit in TempGroup and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Picked unit) is A structure) Equal to false
            • ((Picked unit) is dead) Equal to false
            • ((Picked unit) is in AIInjuredHeroes[(Integer A)]) Equal to false
            • ((Picked unit) is in AIUnits[(Integer A)]) Equal to false
            • ((Picked unit) is in CastingAIUnits) Equal to false
          • Then - Actions
            • Unit Group - Add (Picked unit) to AIUnits[(Integer A)]
          • Else - Actions


    This makes it easier to configure and results in better code compression and CPU performance.
     
  2. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,006
    Resources:
    26
    Maps:
    1
    Spells:
    8
    Tutorials:
    7
    JASS:
    10
    Resources:
    26
    Trigger
    • AI Hero Learn Skill
      • Events
        • Unit - A unit Gains a level
      • Conditions
        • ((Owner of (Triggering unit)) controller) Equal to Computer
      • Actions
        • Hero - Learn skill for (Triggering unit): Human Archmage - Mass Teleport
        • Hero - Learn skill for (Triggering unit): Human Archmage - Blizzard
        • Hero - Learn skill for (Triggering unit): Human Archmage - Summon Water Elemental
        • Hero - Learn skill for (Triggering unit): Human Archmage - Brilliance Aura
        • Hero - Learn skill for (Triggering unit): Human Mountain King - Avatar
        • Hero - Learn skill for (Triggering unit): Human Mountain King - Storm Bolt
        • Hero - Learn skill for (Triggering unit): Human Mountain King - Thunder Clap
        • Hero - Learn skill for (Triggering unit): Human Mountain King - Bash
        • Hero - Learn skill for (Triggering unit): Human Paladin - Resurrection
        • Hero - Learn skill for (Triggering unit): Human Paladin - Holy Light
        • Hero - Learn skill for (Triggering unit): Human Paladin - Divine Shield
        • Hero - Learn skill for (Triggering unit): Human Paladin - Devotion Aura
        • Hero - Learn skill for (Triggering unit): Human Blood Mage - Phoenix
        • Hero - Learn skill for (Triggering unit): Human Blood Mage - Flame Strike
        • Hero - Learn skill for (Triggering unit): Human Blood Mage - Banish
        • Hero - Learn skill for (Triggering unit): Human Blood Mage - Siphon Mana
        • Hero - Learn skill for (Triggering unit): Orc Blademaster - Bladestorm
        • Hero - Learn skill for (Triggering unit): Orc Blademaster - Wind Walk
        • Hero - Learn skill for (Triggering unit): Orc Blademaster - Mirror Image
        • Hero - Learn skill for (Triggering unit): Orc Blademaster - Critical Strike
        • Hero - Learn skill for (Triggering unit): Orc Far Seer - Earthquake
        • Hero - Learn skill for (Triggering unit): Orc Far Seer - Chain Lightning
        • Hero - Learn skill for (Triggering unit): Orc Far Seer - Far Sight
        • Hero - Learn skill for (Triggering unit): Orc Far Seer - Feral Spirit
        • Hero - Learn skill for (Triggering unit): Orc Shadow Hunter - Big Bad Voodoo
        • Hero - Learn skill for (Triggering unit): Orc Shadow Hunter - Healing Wave
        • Hero - Learn skill for (Triggering unit): Orc Shadow Hunter - Hex
        • Hero - Learn skill for (Triggering unit): Orc Shadow Hunter - Serpent Ward
        • Hero - Learn skill for (Triggering unit): Orc Tauren Chieftain - Reincarnation
        • Hero - Learn skill for (Triggering unit): Orc Tauren Chieftain - Shockwave
        • Hero - Learn skill for (Triggering unit): Orc Tauren Chieftain - War Stomp
        • Hero - Learn skill for (Triggering unit): Orc Tauren Chieftain - Endurance Aura
        • Hero - Learn skill for (Triggering unit): Undead Crypt Lord - Locust Swarm
        • Hero - Learn skill for (Triggering unit): Undead Crypt Lord - Impale
        • Hero - Learn skill for (Triggering unit): Undead Crypt Lord - Spiked Carapace
        • Hero - Learn skill for (Triggering unit): Undead Crypt Lord - Carrion Beetles
        • Hero - Learn skill for (Triggering unit): Undead Death Knight - Animate Dead
        • Hero - Learn skill for (Triggering unit): Undead Death Knight - Death Coil
        • Hero - Learn skill for (Triggering unit): Undead Death Knight - Death Pact
        • Hero - Learn skill for (Triggering unit): Undead Death Knight - Unholy Aura
        • Hero - Learn skill for (Triggering unit): Undead Dreadlord - Inferno
        • Hero - Learn skill for (Triggering unit): Undead Dreadlord - Carrion Swarm
        • Hero - Learn skill for (Triggering unit): Undead Dreadlord - Sleep
        • Hero - Learn skill for (Triggering unit): Undead Dreadlord - Vampiric Aura
        • Hero - Learn skill for (Triggering unit): Undead Lich - Death And Decay
        • Hero - Learn skill for (Triggering unit): Undead Lich - Frost Nova
        • Hero - Learn skill for (Triggering unit): Undead Lich - Frost Armor
        • Hero - Learn skill for (Triggering unit): Undead Lich - Dark Ritual
        • Hero - Learn skill for (Triggering unit): Night Elf Demon Hunter - Metamorphosis
        • Hero - Learn skill for (Triggering unit): Night Elf Demon Hunter - Mana Burn
        • Hero - Learn skill for (Triggering unit): Night Elf Demon Hunter - Immolation
        • Hero - Learn skill for (Triggering unit): Night Elf Demon Hunter - Evasion
        • Hero - Learn skill for (Triggering unit): Night Elf Keeper Of The Grove - Tranquility
        • Hero - Learn skill for (Triggering unit): Night Elf Keeper Of The Grove - Entangling Roots
        • Hero - Learn skill for (Triggering unit): Night Elf Keeper Of The Grove - Force Of Nature
        • Hero - Learn skill for (Triggering unit): Night Elf Keeper Of The Grove - Thorns Aura
        • Hero - Learn skill for (Triggering unit): Night Elf Priestess Of The Moon - Starfall
        • Hero - Learn skill for (Triggering unit): Night Elf Priestess Of The Moon - Scout
        • Hero - Learn skill for (Triggering unit): Night Elf Priestess Of The Moon - Searing Arrows
        • Hero - Learn skill for (Triggering unit): Night Elf Priestess Of The Moon - Trueshot Aura
        • Hero - Learn skill for (Triggering unit): Night Elf Warden - Vengeance
        • Hero - Learn skill for (Triggering unit): Night Elf Warden - Fan Of Knives
        • Hero - Learn skill for (Triggering unit): Night Elf Warden - Blink
        • Hero - Learn skill for (Triggering unit): Night Elf Warden - Shadow Strike


    I see what you did there.
    Seriously, this is a really bad idea :/
    You should store the abilities in a hashtable for a unit in order with one of the keys being the level:

    Key1: Hero Id
    Key2: Level
    Value: Ability Id
     
  3. shinji

    shinji

    Joined:
    Jul 25, 2011
    Messages:
    893
    Resources:
    1
    Spells:
    1
    Resources:
    1
    I'll fix that. Thank you for the correction.

    EDIT : When I try to save an ability to a hashtable WE crashed. What wrong???
     
  4. Quilnez

    Quilnez

    Joined:
    Oct 12, 2011
    Messages:
    3,258
    Resources:
    37
    Icons:
    2
    Tools:
    1
    Maps:
    7
    Spells:
    21
    Tutorials:
    2
    JASS:
    4
    Resources:
    37
    Where is the trigger for AI to use their abilities?
    Does the AI automatically use their abilities?
    When I create a custom ability, will the AI learns that ability automatically?
     
  5. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,006
    Resources:
    26
    Maps:
    1
    Spells:
    8
    Tutorials:
    7
    JASS:
    10
    Resources:
    26
    World Editor crashes for a lot of reasons :/
    How about you save the ability using integers. (Abilities ARE integers)
     
  6. shinji

    shinji

    Joined:
    Jul 25, 2011
    Messages:
    893
    Resources:
    1
    Spells:
    1
    Resources:
    1
    You can make AI cast spells automaticlly by changing the order string in the object editor. You need to add your custom abilities to the trigger to make AI heroes learn them. (Read "how to import") You can ask more if you don't know what I mean.

    Ok. I'll try that.

    EDIT :
    • Set HeroSkills[1] = Mass Teleport
    • Set HeroSkills[2] = Blizzard
    • Set HeroSkills[3] = Summon Water Elemental
    • Set HeroSkills[4] = Brilliance Aura


    I have to do this for all abilities????
     
  7. Quilnez

    Quilnez

    Joined:
    Oct 12, 2011
    Messages:
    3,258
    Resources:
    37
    Icons:
    2
    Tools:
    1
    Maps:
    7
    Spells:
    21
    Tutorials:
    2
    JASS:
    4
    Resources:
    37
    Ahaha... I just wish you make every one can easily use your system.. And I suggest you to make trigger for AI to uses their ability.. I think the AI is useless if they can't uses their abilities..
     
  8. shinji

    shinji

    Joined:
    Jul 25, 2011
    Messages:
    893
    Resources:
    1
    Spells:
    1
    Resources:
    1
    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.
    Picture
    [​IMG]

    Change it to someting you want.
     
  9. Quilnez

    Quilnez

    Joined:
    Oct 12, 2011
    Messages:
    3,258
    Resources:
    37
    Icons:
    2
    Tools:
    1
    Maps:
    7
    Spells:
    21
    Tutorials:
    2
    JASS:
    4
    Resources:
    37
    Where's the order string? there is no any order string at your system.. -_-
    Do you mean I have to add them all (order) manually? Okay... Got it!
     
  10. shinji

    shinji

    Joined:
    Jul 25, 2011
    Messages:
    893
    Resources:
    1
    Spells:
    1
    Resources:
    1
    This is the order string.
     
  11. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,006
    Resources:
    26
    Maps:
    1
    Spells:
    8
    Tutorials:
    7
    JASS:
    10
    Resources:
    26
    To convert an ability to an integer, in custom script, do this:

    Trigger
    • Custom script: set udg_MyInteger = udg_MyAbility
     
  12. shinji

    shinji

    Joined:
    Jul 25, 2011
    Messages:
    893
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Oh. Thank you. I'll do that.

    EDIT : I think it changes nothing even I did that.... Maybe it will be only 2 lines but it is still just doing the same thing. It will be different if I can use hash tables.\
    • Hashtable - Save (Ablility) as 1 of (key(Hero)) in (Last created hashtable)
     
    Last edited: Feb 15, 2012
  13. shinji

    shinji

    Joined:
    Jul 25, 2011
    Messages:
    893
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Looks like I have to make my AI to learn to flee big forces and defend bases. I think I can do that in GUI. :goblin_good_job:
    If it is impossible in GUI it is impossible in JASS too.

    EDIT : Updated. Now it's much better now. AI defends their base and flees strong forces.
     
    Last edited: Feb 15, 2012
  14. bowser499

    bowser499

    Joined:
    Jul 20, 2009
    Messages:
    782
    Resources:
    7
    Tools:
    1
    Maps:
    3
    Spells:
    3
    Resources:
    7
    This is false.
    If it is impossible in Jass it is impossible in GUI too.
     
  15. shinji

    shinji

    Joined:
    Jul 25, 2011
    Messages:
    893
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Yes that's what I ment. If it is possible in JASS it's possible in GUI.
     
  16. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    8,051
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    But often really hard or ugly in GUI, often requiring tons of custom script code.
     
  17. shinji

    shinji

    Joined:
    Jul 25, 2011
    Messages:
    893
    Resources:
    1
    Spells:
    1
    Resources:
    1
    I agree mine is kind of ugly... But it works fine.
     
  18. mckill2009

    mckill2009

    Joined:
    Mar 10, 2009
    Messages:
    4,696
    Resources:
    34
    Maps:
    5
    Spells:
    27
    JASS:
    2
    Resources:
    34
    Review for AI Retreat only: too lazy for others :)
    - IsAttacked is really abusive, it sometimes causes map to crash, I suggest to change it to a per second loop, and add the AI to a RetreatGroup...
    - Store the attacked/attacking unit into a variable...
    - If the Event is 'attacked', the Actions should be TriggeringPlayer/TriggeringUnit (thats for the attacked unit)...
    - Why are you filtering both the attacked and attacking unit and its allies?, shoudlnt it be the attacked unit calls for help?...
    - Tip: One location variable for the whole map is enough (except if you have offsets, 3 is maximum), since its removed once its done using...
    - 1200.00 and 3500.00 and a-like should be configurables at initializetion...
    - 'AITargetUnit' is really not needed coz you're changing it everytime in another trigger...
     
  19. snowman990

    snowman990

    Joined:
    Aug 23, 2010
    Messages:
    586
    Resources:
    1
    Skins:
    1
    Resources:
    1
    This thing is nice, but sometime the AI doesn't use their abilities to kill enemy units, like lich, he doesn't use his frost nova , only frost armor o_O