• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

My AI is in a very annoying loop. -.-

Status
Not open for further replies.
Level 13
Joined
Oct 16, 2010
Messages
731
Right. I'm making a medieval map. However rather than mining gold or harvesting lumber you just build a mine and get gold every few seconds.

I'm now happy with the units within the map but am trying to make an AI. My AI currently only seems to like buying infantry units like footmen forever whilst buying houses to sustain them. This being great'n'all I need them to actually bother with buying other military structures and stuff. And hopefully end up using some kind of strategy.

The main problem here is they technically would need another mine, however they never save up to get another mine as the mine costs 1200 gold and the footman costs 230 gold. So yer. Any help? I've posted ALL of the triggers for my AI below and attached the map for you to have a look at the AI in progress. Any help will be rewarded with rep as I really want this AI to work... (I was thinking of making different styles of the AI like defensive but I won't do that now).

  • AI Build
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players controlled by a Computer player) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of living Mine units owned by (Picked player)) Not equal to 0
            • Then - Actions
              • -------- Build Armory, Academy, Arcane Sanctum --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in (Units owned by (Picked player) matching (((Matching unit) is A structure) Equal to True))) Greater than or equal to ((Number of units in (Units owned by (Picked player) of type Armory)) x 60)
                • Then - Actions
                  • Unit - Order (Random unit from (Units owned by (Picked player) of type Peasant)) to build a Armory at ((Position of (Random unit from (Units owned by (Picked player) matching (((Matching unit) is A structure) Equal to True)))) offset by (Random real number between 500.00 and 1000.00) towards (Random real number between 0.00 and 359.99) degrees)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Number of units in (Units owned by (Picked player) of type Academy)) Less than or equal to 0
                      • (Current research level of Age 2 for (Picked player)) Greater than or equal to 2
                    • Then - Actions
                      • Unit - Order (Random unit from (Units owned by (Picked player) of type Peasant)) to build a Armory at ((Position of (Random unit from (Units owned by (Picked player) matching (((Matching unit) is A structure) Equal to True)))) offset by (Random real number between 500.00 and 1000.00) towards (Random real number between 0.00 and 359.99) degrees)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Number of units in (Units owned by (Picked player) of type Arcane Sanctum)) Less than or equal to 0
                          • (Current research level of Age 2 for (Picked player)) Greater than or equal to 2
                        • Then - Actions
                          • Unit - Order (Random unit from (Units owned by (Picked player) of type Peasant)) to build a Arcane Sanctum at ((Position of (Random unit from (Units owned by (Picked player) matching (((Matching unit) is A structure) Equal to True)))) offset by (Random real number between 500.00 and 1000.00) towards (Random real number between 0.00 and 359.99) degrees)
                        • Else - Actions
              • -------- Build Barracks, Archery, Stables, Workshop or Church --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked player) Food cap) Greater than or equal to ((Number of units in (Units owned by (Picked player) of type Barracks)) x 40)
                • Then - Actions
                  • Unit - Order (Random unit from (Units owned by (Picked player) of type Peasant)) to build a Barracks at ((Position of (Random unit from (Units owned by (Picked player) matching (((Matching unit) is A structure) Equal to True)))) offset by (Random real number between 500.00 and 1000.00) towards (Random real number between 0.00 and 359.99) degrees)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Current research level of Age 2 for (Picked player)) Greater than or equal to 1
                      • ((Picked player) Food cap) Greater than or equal to ((Number of units in (Units owned by (Picked player) of type Archery)) x 50)
                    • Then - Actions
                      • Unit - Order (Random unit from (Units owned by (Picked player) of type Peasant)) to build a Archery at ((Position of (Random unit from (Units owned by (Picked player) matching (((Matching unit) is A structure) Equal to True)))) offset by (Random real number between 500.00 and 1000.00) towards (Random real number between 0.00 and 359.99) degrees)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Current research level of Age 2 for (Picked player)) Greater than or equal to 1
                          • ((Picked player) Food cap) Greater than or equal to ((Number of units in (Units owned by (Picked player) of type Stables)) x 50)
                        • Then - Actions
                          • Unit - Order (Random unit from (Units owned by (Picked player) of type Peasant)) to build a Stables at ((Position of (Random unit from (Units owned by (Picked player) matching (((Matching unit) is A structure) Equal to True)))) offset by (Random real number between 500.00 and 1000.00) towards (Random real number between 0.00 and 359.99) degrees)
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Current research level of Age 2 for (Picked player)) Greater than or equal to 2
                              • ((Picked player) Food cap) Greater than or equal to ((Number of units in (Units owned by (Picked player) of type Workshop)) x 75)
                            • Then - Actions
                              • Unit - Order (Random unit from (Units owned by (Picked player) of type Peasant)) to build a Workshop at ((Position of (Random unit from (Units owned by (Picked player) matching (((Matching unit) is A structure) Equal to True)))) offset by (Random real number between 500.00 and 1000.00) towards (Random real number between 0.00 and 359.99) degrees)
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Current research level of Age 2 for (Picked player)) Greater than or equal to 2
                                  • ((Picked player) Food cap) Greater than or equal to ((Number of units in (Units owned by (Picked player) of type Workshop)) x 100)
                                • Then - Actions
                                  • Unit - Order (Random unit from (Units owned by (Picked player) of type Peasant)) to build a Church at ((Position of (Random unit from (Units owned by (Picked player) matching (((Matching unit) is A structure) Equal to True)))) offset by (Random real number between 500.00 and 1000.00) towards (Random real number between 0.00 and 359.99) degrees)
                                • Else - Actions
              • -------- Build Watch Tower or Guard Tower --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Current research level of Age 2 for (Picked player)) Less than 3
                  • (Number of units in (Units owned by (Picked player) matching (((Picked unit) is A structure) Equal to True))) Greater than or equal to ((Number of units in (Units owned by (Picked player) of type Watch Tower)) x 20)
                • Then - Actions
                  • Unit - Order (Random unit from (Units owned by (Picked player) of type Villager)) to build a Watch Tower at ((Position of (Random unit from (Units owned by (Picked player) matching (((Matching unit) is A structure) Equal to True)))) offset by (Random real number between 500.00 and 1000.00) towards (Random real number between 0.00 and 359.99) degrees)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Current research level of Age 2 for (Picked player)) Greater than or equal to 3
                      • (Number of units in (Units owned by (Picked player) matching (((Picked unit) is A structure) Equal to True))) Greater than or equal to ((Number of units in (Units owned by (Picked player) of type Guard Tower)) x 20)
                    • Then - Actions
                      • Unit - Order (Random unit from (Units owned by (Picked player) of type Villager)) to build a Watch Tower at ((Position of (Random unit from (Units owned by (Picked player) matching (((Matching unit) is A structure) Equal to True)))) offset by (Random real number between 500.00 and 1000.00) towards (Random real number between 0.00 and 359.99) degrees)
                    • Else - Actions
              • -------- Farm --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (((Picked player) Food used) + 6) Greater than or equal to ((Picked player) Food cap)
                • Then - Actions
                  • Unit - Order (Random unit from (Units owned by (Picked player) of type Villager)) to build a House at ((Position of (Random unit from (Units owned by (Picked player) matching (((Matching unit) is A structure) Equal to True)))) offset by (Random real number between 500.00 and 1000.00) towards (Random real number between 0.00 and 359.99) degrees)
                • Else - Actions
              • -------- Build Plantation --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Current research level of Crop Rotation for (Picked player)) Equal to 0
                  • ((Number of units in (Units owned by (Picked player) of type Plantation)) x 15) Less than or equal to ((Picked player) Food used)
                • Then - Actions
                  • Unit - Order (Random unit from (Units owned by (Picked player) of type Villager)) to build a Plantation at ((Position of (Random unit from (Units owned by (Picked player) matching (((Matching unit) is A structure) Equal to True)))) offset by (Random real number between 500.00 and 1000.00) towards (Random real number between 0.00 and 359.99) degrees)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Current research level of Crop Rotation for (Picked player)) Equal to 1
                      • ((Number of units in (Units owned by (Picked player) of type Plantation)) x 23) Less than or equal to ((Picked player) Food used)
                    • Then - Actions
                      • Unit - Order (Random unit from (Units owned by (Picked player) of type Villager)) to build a Plantation at ((Position of (Random unit from (Units owned by (Picked player) matching (((Matching unit) is A structure) Equal to True)))) offset by (Random real number between 500.00 and 1000.00) towards (Random real number between 0.00 and 359.99) degrees)
                    • Else - Actions
              • -------- Build Mine --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Current research level of Gold Shafts for (Picked player)) Equal to 0
                  • ((Number of units in (Units owned by (Picked player) of type Mine)) x 30) Less than or equal to ((Picked player) Food used)
                • Then - Actions
                  • Unit - Order (Random unit from (Units owned by (Picked player) of type Villager)) to build a Mine at ((Position of (Random unit from (Units owned by (Picked player) matching (((Matching unit) is A structure) Equal to True)))) offset by (Random real number between 500.00 and 1000.00) towards (Random real number between 0.00 and 359.99) degrees)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Current research level of Gold Shafts for (Picked player)) Equal to 1
                      • ((Number of units in (Units owned by (Picked player) of type Mine)) x 40) Less than or equal to ((Picked player) Food used)
                    • Then - Actions
                      • Unit - Order (Random unit from (Units owned by (Picked player) of type Villager)) to build a Mine at ((Position of (Random unit from (Units owned by (Picked player) matching (((Matching unit) is A structure) Equal to True)))) offset by (Random real number between 500.00 and 1000.00) towards (Random real number between 0.00 and 359.99) degrees)
                    • Else - Actions
            • Else - Actions
              • Unit - Order (Random unit from (Units owned by (Picked player) of type Villager)) to build a Mine at ((Position of (Random unit from (Units owned by (Picked player) matching (((Matching unit) is A structure) Equal to True)))) offset by (Random real number between 500.00 and 1000.00) towards (Random real number between 0.00 and 359.99) degrees)
  • AI Build Backup
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • ((Owner of (Constructed structure)) controller) Equal to Computer
    • Actions
      • Wait 1.00 seconds
      • Trigger - Run AI Build <gen> (checking conditions)
  • AI Train
    • Events
      • Time - Every 15.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players controlled by a Computer player) and do (Actions)
        • Loop - Actions
          • -------- Train Monk --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) Food used) Less than or equal to ((Picked player) Food cap)
              • ((Picked player) Food used) Greater than or equal to ((Number of units in (Units owned by (Picked player) of type Monk)) x 10)
            • Then - Actions
              • Unit - Order (Random unit from (Units owned by (Picked player) of type Church)) to train/upgrade to a Monk
            • Else - Actions
          • -------- Train Balista, Catapult or Cannon --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in (Units owned by (Picked player) of type Mine)) Greater than or equal to 3
              • (Current research level of Chemistry for (Picked player)) Equal to 0
              • (Current research level of Age 2 for (Picked player)) Greater than or equal to 2
              • (Random integer number between 1 and 2) Equal to 1
              • ((Picked player) Food used) Less than or equal to ((Picked player) Food cap)
            • Then - Actions
              • Unit - Order (Random unit from (Units owned by (Picked player) of type Workshop)) to train/upgrade to a Ballista
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in (Units owned by (Picked player) of type Mine)) Greater than or equal to 3
                  • (Current research level of Chemistry for (Picked player)) Equal to 0
                  • (Current research level of Age 2 for (Picked player)) Greater than or equal to 2
                  • ((Picked player) Food used) Less than or equal to ((Picked player) Food cap)
                • Then - Actions
                  • Unit - Order (Random unit from (Units owned by (Picked player) of type Workshop)) to train/upgrade to a Catapult
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Number of units in (Units owned by (Picked player) of type Mine)) Greater than or equal to 5
                      • (Current research level of Chemistry for (Picked player)) Equal to 1
                      • (Current research level of Age 2 for (Picked player)) Equal to 3
                      • ((Picked player) Food used) Less than or equal to ((Picked player) Food cap)
                    • Then - Actions
                      • Unit - Order (Random unit from (Units owned by (Picked player) of type Workshop)) to train/upgrade to a Cannon
                    • Else - Actions
          • -------- Train Light Cavalry, Mounted Skirmisher or Knight. --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in (Units owned by (Picked player) of type Mine)) Greater than or equal to 2
              • (Current research level of Squires for (Picked player)) Equal to 0
              • (Current research level of Age 2 for (Picked player)) Greater than or equal to 1
              • (Random integer number between 1 and 2) Equal to 1
              • ((Picked player) Food used) Less than or equal to ((Picked player) Food cap)
            • Then - Actions
              • Unit - Order (Random unit from (Units owned by (Picked player) of type Stables)) to train/upgrade to a Light Cavalry
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in (Units owned by (Picked player) of type Mine)) Greater than or equal to 2
                  • (Current research level of Squires for (Picked player)) Equal to 0
                  • (Current research level of Age 2 for (Picked player)) Greater than or equal to 1
                  • ((Picked player) Food used) Less than or equal to ((Picked player) Food cap)
                • Then - Actions
                  • Unit - Order (Random unit from (Units owned by (Picked player) of type Stables)) to train/upgrade to a Mounted Skirmisher
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Number of units in (Units owned by (Picked player) of type Mine)) Greater than or equal to 4
                      • (Current research level of Age 2 for (Picked player)) Greater than or equal to 3
                      • (Current research level of Squires for (Picked player)) Equal to 1
                      • ((Picked player) Food used) Less than or equal to ((Picked player) Food cap)
                    • Then - Actions
                      • Unit - Order (Random unit from (Units owned by (Picked player) of type Stables)) to train/upgrade to a Heavy Cavalry
                    • Else - Actions
          • -------- Train Archer, Skirmisher or Crossbowman --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in (Units owned by (Picked player) of type Mine)) Greater than or equal to 2
              • (Current research level of Age 2 for (Picked player)) Equal to 1
              • ((Picked player) Food used) Less than or equal to ((Picked player) Food cap)
            • Then - Actions
              • Unit - Order (Random unit from (Units owned by (Picked player) of type Archery)) to train/upgrade to a Archer
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in (Units owned by (Picked player) of type Mine)) Greater than or equal to 2
                  • (Current research level of Age 2 for (Picked player)) Equal to 1
                  • ((Picked player) Food used) Less than or equal to ((Picked player) Food cap)
                • Then - Actions
                  • Unit - Order (Random unit from (Units owned by (Picked player) of type Archery)) to train/upgrade to a Skirmisher
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Number of units in (Units owned by (Picked player) of type Mine)) Greater than or equal to 4
                      • (Current research level of Age 2 for (Picked player)) Equal to 2
                      • ((Picked player) Food used) Less than or equal to ((Picked player) Food cap)
                    • Then - Actions
                      • Unit - Order (Random unit from (Units owned by (Picked player) of type Archery)) to train/upgrade to a Crossbowman
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Number of units in (Units owned by (Picked player) of type Mine)) Greater than or equal to 4
                          • (Current research level of Age 2 for (Picked player)) Greater than or equal to 3
                          • (Current research level of Fire Arrows for (Picked player)) Equal to 0
                          • ((Picked player) Food used) Less than or equal to ((Picked player) Food cap)
                        • Then - Actions
                          • Unit - Order (Random unit from (Units owned by (Picked player) of type Archery)) to train/upgrade to a Crossbowman
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Number of units in (Units owned by (Picked player) of type Mine)) Greater than or equal to 4
                              • (Current research level of Age 2 for (Picked player)) Greater than or equal to 3
                              • (Current research level of Fire Arrows for (Picked player)) Equal to 1
                              • (Random integer number between 1 and 2) Equal to 1
                              • ((Picked player) Food used) Less than or equal to ((Picked player) Food cap)
                            • Then - Actions
                              • Unit - Order (Random unit from (Units owned by (Picked player) of type Archery)) to train/upgrade to a Crossbowman
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Current research level of Age 2 for (Picked player)) Greater than or equal to 3
                                  • (Current research level of Fire Arrows for (Picked player)) Equal to 1
                                  • ((Picked player) Food used) Less than or equal to ((Picked player) Food cap)
                                • Then - Actions
                                  • Unit - Order (Random unit from (Units owned by (Picked player) of type Archery)) to train/upgrade to a Archer
                                • Else - Actions
          • -------- Train Man-at-Arms, Footman, Spearman, Swordsman or Templar --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current research level of Age 2 for (Picked player)) Equal to 0
              • ((Picked player) Food used) Less than or equal to ((Picked player) Food cap)
            • Then - Actions
              • Unit - Order (Random unit from (Units owned by (Picked player) of type Barracks)) to train/upgrade to a Man-at-Arms
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in (Units owned by (Picked player) of type Mine)) Greater than or equal to 2
                  • (Current research level of Age 2 for (Picked player)) Equal to 1
                  • (Random integer number between 1 and 2) Equal to 1
                  • ((Picked player) Food used) Less than or equal to ((Picked player) Food cap)
                • Then - Actions
                  • Unit - Order (Random unit from (Units owned by (Picked player) of type Barracks)) to train/upgrade to a Footman
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Number of units in (Units owned by (Picked player) of type Mine)) Greater than or equal to 2
                      • (Current research level of Age 2 for (Picked player)) Equal to 1
                      • ((Picked player) Food used) Less than or equal to ((Picked player) Food cap)
                    • Then - Actions
                      • Unit - Order (Random unit from (Units owned by (Picked player) of type Barracks)) to train/upgrade to a Footman
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Number of units in (Units owned by (Picked player) of type Mine)) Greater than or equal to 3
                          • (Current research level of Age 2 for (Picked player)) Greater than or equal to 2
                          • (Current research level of Arenas for (Picked player)) Equal to 0
                          • ((Picked player) Food used) Less than or equal to ((Picked player) Food cap)
                        • Then - Actions
                          • Unit - Order (Random unit from (Units owned by (Picked player) of type Barracks)) to train/upgrade to a Swordsman
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Number of units in (Units owned by (Picked player) of type Mine)) Greater than or equal to 4
                              • (Current research level of Age 2 for (Picked player)) Equal to 3
                              • (Current research level of Arenas for (Picked player)) Equal to 1
                              • ((Picked player) Food used) Less than or equal to ((Picked player) Food cap)
                            • Then - Actions
                              • Unit - Order (Random unit from (Units owned by (Picked player) of type Barracks)) to train/upgrade to a Templar
                            • Else - Actions
          • -------- Train Villager or Peasant --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in (Units owned by (Picked player) matching (((Matching unit) is A structure) Equal to True))) Greater than or equal to ((Number of units in (Units owned by (Picked player) of type Villager)) x 10)
            • Then - Actions
              • Unit - Order (Random unit from (Units owned by (Picked player) of type Town Center)) to train/upgrade to a Villager
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in (Units owned by (Picked player) matching (((Matching unit) is A structure) Equal to True))) Greater than or equal to ((Number of units in (Units owned by (Picked player) of type Peasant)) x 10)
                • Then - Actions
                  • Unit - Order (Random unit from (Units owned by (Picked player) of type Town Center)) to train/upgrade to a Peasant
                • Else - Actions
  • AI Train Backup
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • ((Owner of (Trained unit)) controller) Equal to Computer
    • Actions
      • Wait 1.00 seconds
      • Trigger - Run AI Train <gen> (checking conditions)
  • AI Upgrade
    • Events
      • Time - Every 15.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players controlled by a Computer player) and do (Actions)
        • Loop - Actions
          • -------- Random Upgrades --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current research level of Town Scouts for (Picked player)) Not equal to 3
            • Then - Actions
              • Unit - Order (Random unit from (Units owned by (Picked player) of type Town Center)) to research Town Scouts
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current research level of Leather Soles for (Picked player)) Not equal to 1
              • (Number of units in (Units owned by (Picked player) matching (((Matching unit) is A peon-type unit) Equal to True))) Greater than or equal to 4
            • Then - Actions
              • Unit - Order (Random unit from (Units owned by (Picked player) of type Town Center)) to research Leather Soles
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current research level of Balistics for (Picked player)) Not equal to 1
              • (Current research level of Chemistry for (Picked player)) Equal to 1
            • Then - Actions
              • Unit - Order (Random unit from (Units owned by (Picked player) of type Arcane Sanctum)) to research Balistics
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current research level of Masonary for (Picked player)) Not equal to 2
              • (Current research level of Age 2 for (Picked player)) Greater than or equal to 2
            • Then - Actions
              • Unit - Order (Random unit from (Units owned by (Picked player) of type Academy)) to research Masonary
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current research level of Tracking for (Picked player)) Not equal to 1
              • (Current research level of Age 2 for (Picked player)) Equal to 3
            • Then - Actions
              • Unit - Order (Random unit from (Units owned by (Picked player) of type Academy)) to research Tracking
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current research level of Long Bows for (Picked player)) Not equal to 1
            • Then - Actions
              • Unit - Order (Random unit from (Units owned by (Picked player) of type Archery)) to research Long Bows
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current research level of Fire Arrows for (Picked player)) Not equal to 1
              • (Current research level of Age 2 for (Picked player)) Equal to 3
            • Then - Actions
              • Unit - Order (Random unit from (Units owned by (Picked player) of type Archery)) to research Fire Arrows
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in (Units owned by (Picked player) of type Stables)) Greater than or equal to 1
              • (Current research level of Horseshoes for (Picked player)) Not equal to 1
            • Then - Actions
              • Unit - Order (Random unit from (Units owned by (Picked player) of type Stables)) to research Horseshoes
            • Else - Actions
          • -------- Monk Upgrades --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current research level of Age 2 for (Picked player)) Greater than or equal to 2
              • (Current research level of Redemption for (Picked player)) Not equal to 2
              • (Current research level of Redemption for (Picked player)) Less than or equal to (Current research level of Fervor for (Picked player))
            • Then - Actions
              • Unit - Order (Random unit from (Units owned by (Picked player) of type Church)) to research Redemption
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Current research level of Age 2 for (Picked player)) Greater than or equal to 2
                  • (Current research level of Fervor for (Picked player)) Not equal to 2
                  • (Current research level of Fervor for (Picked player)) Less than or equal to (Current research level of Redemption for (Picked player))
                • Then - Actions
                  • Unit - Order (Random unit from (Units owned by (Picked player) of type Church)) to research Fervor
                • Else - Actions
          • -------- Unit Unlocking Upgrades --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current research level of Age 2 for (Picked player)) Equal to 3
            • Then - Actions
              • Unit - Order (Random unit from (Units owned by (Picked player) of type Barracks)) to research Arenas
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current research level of Age 2 for (Picked player)) Greater than or equal to 2
            • Then - Actions
              • Unit - Order (Random unit from (Units owned by (Picked player) of type Stables)) to research Squires
            • Else - Actions
          • -------- Attack and Defence Upgrades --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current research level of Forging for (Picked player)) Less than 3
              • (Current research level of Forging for (Picked player)) Less than or equal to (Current research level of Fletching for (Picked player))
              • (Current research level of Forging for (Picked player)) Less than or equal to (Current research level of Scale Mail Armor for (Picked player))
              • (Current research level of Forging for (Picked player)) Less than or equal to (Current research level of Padded Armor for (Picked player))
            • Then - Actions
              • Unit - Order (Random unit from (Units owned by (Picked player) of type Armory)) to research Forging
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Current research level of Fletching for (Picked player)) Less than 3
                  • (Current research level of Fletching for (Picked player)) Less than or equal to (Current research level of Forging for (Picked player))
                  • (Current research level of Fletching for (Picked player)) Less than or equal to (Current research level of Scale Mail Armor for (Picked player))
                  • (Current research level of Fletching for (Picked player)) Less than or equal to (Current research level of Padded Armor for (Picked player))
                • Then - Actions
                  • Unit - Order (Random unit from (Units owned by (Picked player) of type Armory)) to research Fletching
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Current research level of Scale Mail Armor for (Picked player)) Less than 3
                      • (Current research level of Scale Mail Armor for (Picked player)) Less than or equal to (Current research level of Forging for (Picked player))
                      • (Current research level of Scale Mail Armor for (Picked player)) Less than or equal to (Current research level of Fletching for (Picked player))
                      • (Current research level of Scale Mail Armor for (Picked player)) Less than or equal to (Current research level of Padded Armor for (Picked player))
                    • Then - Actions
                      • Unit - Order (Random unit from (Units owned by (Picked player) of type Armory)) to research Scale Mail Armor
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Current research level of Padded Armor for (Picked player)) Less than 3
                          • (Current research level of Padded Armor for (Picked player)) Less than or equal to (Current research level of Forging for (Picked player))
                          • (Current research level of Padded Armor for (Picked player)) Less than or equal to (Current research level of Fletching for (Picked player))
                          • (Current research level of Padded Armor for (Picked player)) Less than or equal to (Current research level of Scale Mail Armor for (Picked player))
                        • Then - Actions
                          • Unit - Order (Random unit from (Units owned by (Picked player) of type Armory)) to research Padded Armor
                        • Else - Actions
          • -------- Resource Upgrades --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current research level of Age 2 for (Picked player)) Equal to 3
              • (Current research level of Gold Shafts for (Picked player)) Equal to 0
            • Then - Actions
              • Unit - Order (Random unit from (Units owned by (Picked player) of type Mine)) to research Gold Shafts
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current research level of Age 2 for (Picked player)) Equal to 3
              • (Current research level of Crop Rotation for (Picked player)) Equal to 0
            • Then - Actions
              • Unit - Order (Random unit from (Units owned by (Picked player) of type Plantation)) to research Crop Rotation
            • Else - Actions
          • -------- Age Up --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current research level of Age 2 for (Picked player)) Not equal to 3
            • Then - Actions
              • Unit - Order (Random unit from (Units owned by (Picked player) of type Town Center)) to research Age 2
            • Else - Actions
  • AI Upgrade Backup
    • Events
      • Unit - A unit Finishes an upgrade
    • Conditions
      • ((Owner of (Researching unit)) controller) Equal to Computer
    • Actions
      • Wait 1.00 seconds
      • Trigger - Run AI Upgrade <gen> (checking conditions)
  • AI Attack
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players controlled by a Computer player) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in (Units owned by (Picked player) matching ((((Matching unit) is A structure) Not equal to True) and (((Matching unit) is A peon-type unit) Not equal to True)))) Greater than or equal to (((Picked player) Food cap) - (((Picked player) Food used) / 5))
            • Then - Actions
              • Game - Display to (All players) the text: (nerf + (Name of (Picked player)))
              • Unit Group - Pick every unit in (Units owned by (Picked player) matching ((((Matching unit) is A structure) Not equal to True) and (((Matching unit) is A peon-type unit) Not equal to True))) and do (Actions)
                • Loop - Actions
                  • Unit - Order (Picked unit) to Attack-Move To (Position of (Random unit from (Units owned by (Random player from (All enemies of (Picked player))) matching (((Matching unit) is A structure) Equal to True))))
            • Else - Actions
  • AI Run
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Owner of (Attacking unit)) controller) Equal to Computer
      • (Percentage life of (Attacking unit)) Less than or equal to 20.00
    • Actions
      • Unit - Order (Attacking unit) to Move To ((Owner of (Attacking unit)) start location)
  • AI Revive Hero
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Owner of (Dying unit)) controller) Equal to Computer
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Wait 5.00 seconds
      • Unit - Order (Random unit from (Units owned by (Picked player) of type Town Center)) to Revive Hero (Dying unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of living Force Commander units owned by (Picked player)) Equal to 0
        • Then - Actions
          • Trigger - Run (This trigger) (checking conditions)
        • Else - Actions
  • AI Defend Town
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Owner of (Attacked unit)) controller) Equal to Computer
      • ((Attacked unit) is A structure) Equal to True
    • Actions
      • Unit Group - Order (Units owned by (Picked player) matching ((((Matching unit) is A structure) Not equal to True) and (((Matching unit) is A peon-type unit) Not equal to True))) to Attack-Move To (Position of (Attacking unit))
  • AI Learn Spells
    • Events
      • Time - Every 15.00 seconds of game time
      • Unit - A unit Gains a level
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players controlled by a Computer player) and do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in (Units owned by (Picked player) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is alive) Equal to True
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Resurrection for (Picked unit)) Not equal to 3
                    • Then - Actions
                      • Hero - Learn skill for (Picked unit): Resurrection
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Healing Wave for (Picked unit)) Not equal to 9
                    • Then - Actions
                      • Hero - Learn skill for (Picked unit): Healing Wave
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Critical Strike for (Picked unit)) Not equal to 9
                    • Then - Actions
                      • Hero - Learn skill for (Picked unit): Critical Strike
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Blessing for (Picked unit)) Not equal to 9
                    • Then - Actions
                      • Hero - Learn skill for (Picked unit): Blessing
                    • Else - Actions
                • Else - Actions
 
Last edited:
Status
Not open for further replies.
Top