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

[AI] Trigger and Ai help needed

Status
Not open for further replies.
Level 3
Joined
Jun 23, 2007
Messages
10
Well here is my problem.I want to make the computer when i host (computer,easy,normal,insane)select a hero in rect with a wisp moving in (its a custom hero selection with rect).When they choose it i want them to shop,to use spells and to move trought the map.Please help me:sad:
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
They should automatically use most spells.

You do not need to physically make them move into a region. Just give them a random hero bypassing the hero select. As for moving, you can do that by a perodic trigger that issues a move order when not in combat or when certain condtions are met. Shopping is harder and probably needs a whole system.
 
Level 4
Joined
Jul 24, 2008
Messages
108
I would follow super goods advice and just give them a hero. AI is pretty tricky because there are so many things that can happen. Its possible to make a pretty unintelligent AI using GUI, but JASS is going to be the way to go. Here is a pretty good tutorial on how to make a basic AI that will run around and attack nearby units and pick up items and run back to town to heal.

WC3Jass.com :: View script - Creating simple AIs for Hero Arena-type maps

I havn't actaully done it myself, but it looked good and i had it bookmarked incase i wanted to do it in the future
 
Level 4
Joined
Jul 24, 2008
Messages
108
To convert to custom text, you select the trigger, and go edit--> convert to custom text.

If you want to do it in the GUI, its going to be really clunky.
Bascially you want to have a periodic time trigger that executes every few seconds. Play around with this condition to see if your guy doesn't have any orders.

  • (Issued order) Equal to (Order(stop))
then bascially, have a bunch of if/than/else statements that tell him what to do, make sure you have skip remaining actions in every single then statement at the end of it.

So
if your guy has under 20% health
then
order him to go back to base
skip remaining actions
else
nothing

If there is a unit within 1000 of your unit
then
order your guy to attack that unit
skip remaining actions
else nothing

just an example right there poorly written, but you get the point.
 
Status
Not open for further replies.
Top