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

[General] AI refuse to work

Status
Not open for further replies.

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
Basically I wanted to make an AI for a campaign of mine. I used the normal AI editor and got a .wai file which I imported and ran with triggers.

The player is the correct race (orc) and is of the type computer.
The .wai file work fine when testing in melee games from the AI editor and as well in a clean test map. However when I add it into my campaign it does nothing.

Someone knows what's up?
 
Level 23
Joined
Apr 12, 2014
Messages
1,846
Does they have enough resources? How many repeat waves?

Edit: I think you it should like this:
[trigger=Trigger]
Events
Map initialization
Conditions
Actions
AI - Start melee AI script for Player 4 (Purple): war3mapImported\PurpleChapterFour.ai
[/trigger]

AI - Start melee AI not Start campaign AI.

I am using it and it works fine.
 

Shar Dundred

Community Moderator
Level 72
Joined
May 6, 2009
Messages
5,872
You shouldn't run an AI within the Map Initialization itself - actually, most actions shouldn't have the Initialization event. You should create a new trigger for the AIs and add the "Trigger - Run Trigger" action to it to start the new trigger that runs the AI. Also, use "Run melee AI", as Sclammerz said. Trust me and try it.

If it still doesn't work, I guess the AI is broken or doesn't like the map or something special that has been placed on the map. AI Editor AIs have the tendency to just not function without any reason. Recreating them from scratch is the only option then.
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
Nope. Tried the following, didn't make any difference.

  • test
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Visibility - Disable fog of war
      • Visibility - Disable black mask
      • AI - Start campaign AI script for Player 6 (Orange): CampOrcAIMission1.wai
      • AI - Start melee AI script for Player 6 (Orange): CampOrcAIMission1.wai
The AI is not corrupted either, I stated many times. The AI works fine in my test map which I have attached.
 

Attachments

  • AI MAP.w3m
    23.9 KB · Views: 61

Shar Dundred

Community Moderator
Level 72
Joined
May 6, 2009
Messages
5,872
  • test
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Visibility - Disable fog of war
      • Visibility - Disable black mask
      • AI - Start campaign AI script for Player 6 (Orange): CampOrcAIMission1.wai
      • AI - Start melee AI script for Player 6 (Orange): CampOrcAIMission1.wai

What the-

You don't run the .wai, you gotta run the .ai that appears when importing the .wai!
 
Level 23
Joined
Apr 12, 2014
Messages
1,846
I just test the test map the reason why it won't work because of 2 things.

1. You run .wai, you must run the .ai and not with AI - Campaign it must be with AI -Melee. Here this is my trigger and it work fine.
attachment.php


2. There is no .ai imported so I did open your AI to the AI Editor and check it and it was OK and I use save as and save it then I deleted your imported AI in the map and imported your AI again and two files must be there the .ai and the .wai it should be like this.
attachment.php


I tested it and it works fine. I uploaded your test map. Check it.
 

Attachments

  • AI01.PNG
    AI01.PNG
    495.4 KB · Views: 358
  • AI02.PNG
    AI02.PNG
    377.6 KB · Views: 415
  • AI MAP.w3m
    27.9 KB · Views: 99
Level 21
Joined
Jul 27, 2008
Messages
14,361
Ok allow me to clear things up:
1) AI works on regular Map;

2) The moment Map is in Campaign Ai refuses to work. I used AI - Melee, AI - Campaign and even basic Blizzard Melee AI. I tried Map Initialization and Time Elapse event and neither work.

3) I actually know WHY AI won't work. It is because when you start campaign map something very strange happens. Player 1 who is set in editor as Human for some reason random, Player Orange is set as Computer but Computer isn't activated at all. AI can't be activated if player slot isn't set to Computer.

The problem is not in the actual AI or .wai/.ai or if trigger turns on campaign or melee AI. Problem is that campaign ignores the Player Slots and refuses to turn on computer player and you can't turn on AI if computer player isn't there.


The only thing I can think of is to make a new campaign and import there campaign maps.
 

Shar Dundred

Community Moderator
Level 72
Joined
May 6, 2009
Messages
5,872

The problem is not in the actual AI or .wai/.ai or if trigger turns on campaign or melee AI. Problem is that campaign ignores the Player Slots and refuses to turn on computer player and you can't turn on AI if computer player isn't there.


The only thing I can think of is to make a new campaign and import there campaign maps.

I see.

You have set to "Fixed Player Settings" in forces from the scenario properties, right? I'm just asking since even simple things like this can be forgotten and precent things from working. This would also explain why Player 1 is set back to random.

If you sent me the campaign, I could look at this matter myself and see if I can find any reason for it.

Edit:

3) I actually know WHY AI won't work. It is because when you start campaign map something very strange happens. Player 1 who is set in editor as Human for some reason random, Player Orange is set as Computer but Computer isn't activated at all. AI can't be activated if player slot isn't set to Computer.

This pretty much sounds like the player settings haven't been set to fixed in the forces tab.
 
Status
Not open for further replies.
Top