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

Status
Not open for further replies.
Level 6
Joined
May 9, 2011
Messages
228
How to make AI Gui Trigger System??

anyone knows how to make an AI system
dont worry i will give +rep for those who make this trigger
 
Last edited:
Level 6
Joined
May 9, 2011
Messages
228
what are you using bro...vjass or gui
if vjass make it configurable so i can change what ever i want...
if gui more better
thanks
 
Level 8
Joined
Dec 9, 2005
Messages
523
You have to trigger the AI Heroes to learn the actual spell when they gain level. Most "normal" spells (ones that are native to the WC itself) should be used automatically when the AI is set to attack.
I know this because my AOS map features AI Heroes and they are a huge pain in the ass to deal with because they spam spells.
 
Level 9
Joined
Apr 23, 2010
Messages
312
Making the AI hero learn a spell is pretty easy, it's just going to be a long code in GUI (not sure how long in jass or vjass). I'll try to make you one and post it here once it's finished.

Edit: Here is a simple way to make your AI choose an ability...
[hidden="AI Learn Spell" Trigger]
  • AI Learn Spell
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • ((Owner of (Triggering unit)) controller) Equal to Computer
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Paladin
        • Then - Actions
          • If ((Hero level of (Triggering unit)) Equal to 6) then do (Hero - Learn skill for (Triggering unit): Human Paladin - Resurrection) else do (Do nothing)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of (Triggering unit)) Greater than or equal to 2
            • Then - Actions
              • Set Random_Int = (Random integer number between 1 and 3)
              • If (Random_Int Equal to 1) then do (Hero - Learn skill for (Triggering unit): Human Paladin - Holy Light) else do (If (Random_Int Equal to 2) then do (Hero - Learn skill for (Triggering unit): Human Paladin - Divine Shield) else do (Hero - Learn skill for (Triggering unit): Human Paladin - Devotion Aura))
            • Else - Actions
        • Else - Actions
[/hidden]

Random_Int is a (non-array) integer variable. You will have to add more to make it useable for all heroes, this is just for one (the Paladin), all you have to do to make it for another hero is copy and paste the whole If/Then/Else, change the hero to whatever hero you want, then change all the abilities to the ones of that hero. You could even make it more complex by making the AI max out an ability as soon as it can if you wanted to.

Hope this help's a bit.
 
Status
Not open for further replies.
Top