• 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 Picking Script

Status
Not open for further replies.
Level 3
Joined
Mar 26, 2011
Messages
44
Hi I just want to know how to make a computer ai to pick random from my heroes in my tavern so my custom heroes can be tested? how to make trigger like that or can anyone post a sample trigger? Thanks!
 
Level 37
Joined
Mar 6, 2006
Messages
9,243

  • Untitled Trigger 046
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set untypes[1] = Archmage
      • Set untypes[2] = Mountain King
      • Set untypes[3] = Blood Mage
      • Set untypes[4] = Paladin
      • Set max = 4
      • loop Integer A from 1 to max
      • Neutral Building - Add untypes[integer A] to Tavern 0003 <gen> with 1 in stock and a max stock of 1
  • Untitled Trigger 047
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • max Not equal to 0
        • Then - Actions
          • Set i = (Random integer number between 1 and max)
          • Unit - Create 1 untypes[i] for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
          • Neutral Building - Remove untypes[i] from Tavern 0003 <gen>
          • Set untypes[i] = untypes[max]
          • Set max = (max - 1)
        • Else - Actions

The tavern needs Sell Units ability for adding/removing unit types with triggers.
 
Status
Not open for further replies.
Top