• 🏆 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!

Making Custom map GUI AI [ Toturial ]

Custom map AI Toturial
Introduction
Well you want to create an AI for your map? Maybe you want to make an AI for footy? Or for your TD? Or cinematic? Or any other non melee map? You will get help here! ( I hope :grin: )
What you need
You need the World Editor (WE) and your brain!
Starting off
At all beginning, run the World Editor an open your map. Then run the Trigger Editor and do as following:

Then, how would it be to make an cathegory called AI? Yes we do it!
After that, we wanna have start trigger so we notice all players that will use our custom trigger AI. For that we need an Variable. On Trigger Editor you can press Control and B for for getting to the variables.
Create a new one ( for example called AI_SlotIsPlayedByAI) with type boolream and array the maximimal player number you have in your map!

After that, we add an event ( Time - Elapsed Game Time equal to 0.00 seconds )

Now we want to set the variable so the value is stored into our variable.

Because we want to to this for each player we do as followed:
  • For Loop Index A from 1 to 12 do ( Multiple actions )
For picking each player at map start and make something with him!

  • If then else do (multiple actions)
    • If Actions
    • Player Slot Status - Player[IndexA] Slot status equal to is playing
    • Player Controller - Player[IndexA] is a controller is a computer
    • Then Actions
    • Set AI_SlotIsPlayedByAI[IndexA]=true
Now we check if the players we already picked are playing and save it into the variable if the controller is computer so we can use it later.

So the whole triggers looks like that now:

  • Events: Time - Elapsed Game Time equal to 0.00 seconds
  • Conditions:
  • Actions:
  • For Loop Index A from 1 to 12 do ( Multiple actions )
    • If then else do (multiple actions)
      • If Actions
      • Player Slot Status - Player[IndexA] Slot status equal to is playing
      • Player Controller - Player[IndexA] is a controller is a computer
      • Then Actions
      • Set AI_SlotIsPlayedByAI[IndexA]=true
Now we saved at map start each player who is playing.

Your map genre

Now its up to you what you do.

(More stuff is coming soon!!)

Here are some basic informations about making an AI with following genres:

TD
If you chose to have an TD then check if player bot gold is over or equal any tower you can build. If you are clever enough, simply create an timer. If timer expires, then you check if player gold is bigger or equal an tower he can create at any time. Set build location to random point around his start place and check if the unit builds (for making sure he will do that).

Footman Wars
Here you will do much looping triggers, I would say make one trigger for moving the units ( Time - Every X seconds of the game ) and one for moving the heroes. If you want to have an advanced one, create triggers for teching and so on! =)

Tag-Maps
First of all, its up to you if you can create those AI's or not!
I would say build a timer here aswell and for the hunters make attack point equal to position of a random unit on map which is belonged to an enemy.

Campaigns
Ye this is not always easy, try to find the right events. I would say with changing from cinematic into normal mode will also activate your AI triggers. If you wanna have only basic AI, use normal AI editor for melee AI. If you want to make something interesting diffrent and enjoyable try making an AI with GUI triggers.

Have fun with making maps!
~~~~~~~~
Anachron
 
Top