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

AI help for my map

Status
Not open for further replies.
In this map map I made I am really embarrassed to make an AI, considering that the heroes can be bought. If anyone have the time to try making some AI that chooses a random hero for each computer and them send them to battle I'll be very grateful. If anyone is interested can PM me and we'll cooperate. The map is this.
 
Last edited:
First.. Create a Unit-type Variable Array then set each hero for each array
Create a Boolean Variable Array for each hero.
Create an integer on how many heroes you have.
Then Loop it.

  • Init
    • Events
      • Map Initialization
    • Conditions
    • Actions
      • Set Hero[1] = Paladin
      • Set Hero[2] = Archmage
      • Set Hero[3] = Jaina
      • Set Hero[4] = Mountain King
      • ------------------------------
      • Set Hero_Max = 4
  • RandomPick
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • For each (Hero_Loop) from 1 to 10, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player(Hero_Loop)) controller) Equal to Computer
            • Then - Actions
              • Hero_Random = (Random integer number between 1 and Hero_Max)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Hero_Check[Hero_Random] Equal to False
                • Then - Actions
                  • Set Hero_Point = ((Player(Hero_Loop)) start location )
                  • Set Hero_Check = True
                  • Unit - Create 1 Hero[Hero_Random] for ((Player(Hero_Loop)) at Hero_Point facing Default building facing degrees
                  • Custom script: call RemoveLocation (udg_Hero_Point)
                • Else - Actions
                  • Hero_Random = (Random integer number between 1 and Hero_Max)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Hero_Check[Hero_Random] Equal to False
                    • Then - Actions
                      • Set Hero_Point = ((Player(Hero_Loop)) start location )
                      • Set Hero_Check = True
                      • Unit - Create 1 Hero[Hero_Random] for ((Player(Hero_Loop)) at Hero_Point facing Default building facing degrees
                      • Custom script: call RemoveLocation (udg_Hero_Point)
                    • Else - Actions
              • Else - Actions
            • Else - Actions
 
Last edited:
Status
Not open for further replies.
Top