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

Please,help me out with AI!

Status
Not open for further replies.
Level 2
Joined
Jan 18, 2014
Messages
5
I would be very grateful,if someone could explain to me,how do I implement only one action loop in my map (only heroes there) for AI heroes,
I want them to pick any items visible,and set the priority of this action higher than simple autoattack on enemy heroes?
Please,help!:thumbs_up:
 
Level 2
Joined
Jan 18, 2014
Messages
5
...

There is currently no AI at all,it is a small arena map,each player has a hero to battle with,right now,AI does not do a thing,and stands still,only autoattacks if there is an enemy in sight.:goblin_cry:
But I am interested in picking up items,and this is not included with the melee AI scripts,as I remember,more accurately,the AI will be confused that there is no buildings to build,and no armies to clash.
I'm a newbie to serious map creation,so pardon me,please!
 
Last edited:
You have to store heroes into unit variables[array] like: Player 1 gets Hero[1], Player 2 gets Hero[2] ... and so on.

Then I guess your loop must look something like this:

Info:
INT = Integer variable (represents the player number in the loop)
You must run this loop periodicly, to always refresh the orders to current situation. Maybe each 0.5 seconds would be fair enough.
  • For each Integer INT from 1 to 12 do actions:
    • If Player[INT] is Computer == TRUE AND Hero[INT] is alive == TRUE
      • Then - Actions:
        • ------------*Your AI-Code*------------
      • Else - Actions:
Sorry but it would be best you write AI-Code yourself (or make a request), because AI is always too map specific.

I just can give you some tips like:

1. You need to check if enemries around (too many --> maybe run away and buy potion)

2. Check current life/mana of hero and then buy/use potions again.

3. Check if there are items around which can be picked up. (if empty slot)

4. Attack weakest unit always, to gain more kills.

5. Using abilities wisely

... and and and

Hope it will help you, Apelli. Good luck with it!
 
Level 21
Joined
Aug 13, 2011
Messages
739
If nothing else, you could do something like this simple item detection. You can edit the range and which units are triggered by it in the Initialization trigger.
 

Attachments

  • Hero Item Sensing.w3x
    9.9 KB · Views: 33
Status
Not open for further replies.
Top