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

Melee AI for custom race

Status
Not open for further replies.
Level 10
Joined
Jun 6, 2007
Messages
392
Hello! I've been trying to make my first ai. It's for a custom race (elves). For some reason it doesn't seem to work, workers begin harvesting but they don't build anything, and the player doesn't train new workers. This is how my building tab looks in the ai editor:

Code:
Town Hall            1     0/12     Any     None
Worker               1     1/12     Any     None
Worker               2     2/12     Any     None
Worker               3     3/12     Any     None
Worker               4     4/12     Any     None
Worker               5     5/12     Any     None
Training Grounds     1      -       Any     None
...

I have imported the ai and I create the starting units and start the ai with this trigger:

  • Player Group - Pick every player in (All players) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Race of (Picked player)) Equal to Human
        • Then - Actions
          • Unit - Create 1 Town Hall for (Picked player) at ((Picked player) start location) facing Default building facing degrees
          • Unit - Create 5 Worker for (Picked player) at ((Picked player) start location) facing Default building facing degrees
          • AI - Start melee AI script for (Picked player): war3mapImported\custom ai human.ai
        • Else - Actions
Also, in the beginning there's a message that I will be revealed to enemies, as if I didn't have a town hall. I think that might be related to this problem. The classification of the custom town hall is town hall, and I've added it to the list of town halls in the gameplay constants. I'd appreciate if anyone could help me to get this ai to work.
 
You have to remove this trigger :
  • Melee - Set Victory/Defeat Condition
That trigger will make everything become a problem if you owns a custom race

You have to base the town hall based on the real human town hall [since you overrides human, so why not replace them instead?]

Also, seems this is a strange issue.
Let me check the tuts section

EDIT : found one http://www.hiveworkshop.com/forums/jass-ai-scripts-tutorials-280/ai-editor-29314/
 
Level 10
Joined
Jun 6, 2007
Messages
392
Thanks! Now the reveal message doesn't appear anymore, but ai still doesn't build. I read those tutorials and I should be doing everything right according to them. Btw, I'm using newgen, maybe that has something to do with it?
 
Status
Not open for further replies.
Top