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

AI attack problems

Status
Not open for further replies.
Level 5
Joined
Jul 14, 2014
Messages
115
[Solved] AI attack problems

I'm creating an AI for a risk map in the AI editor. So far I've been doing pretty good until I found this problem: the AI just really likes to attack creeps on the map even though I removed all of the attacks from the ''attacking'' tab. And the AI will attack any creep unit on the map but he won't attack the creep cities (they are supposed to be attacked as this is a risk map). How do I fix this?
 
Last edited:
Level 12
Joined
May 22, 2015
Messages
1,051
Not sure what the difference between "creeps" and "creep cities" is. Also, are "creeps" the neutral hostile team, with their camps set up throughout the map in neutral areas? Or are they like the Dota "creeps" where they are just the dumb units that are just always there to farm?
 
Level 5
Joined
Jul 14, 2014
Messages
115
Not sure what the difference between "creeps" and "creep cities" is. Also, are "creeps" the neutral hostile team, with their camps set up throughout the map in neutral areas? Or are they like the Dota "creeps" where they are just the dumb units that are just always there to farm?

By "creep cities" I mean certain buildings that have to be captured (lowered down to a amount of hp). The creeps that stand around the cities are on the neutral - hostile team and the cities themselves are neutral - naga. I tried changing the "race" option of the cities to "creep" but that changed nothing as they were placed in the neutral - passive category. If by dumb "dota" creeps you mean if they have a respawn then no.
 
By "creep cities" I mean certain buildings that have to be captured (lowered down to a amount of hp). The creeps that stand around the cities are on the neutral - hostile team and the cities themselves are neutral - naga. I tried changing the "race" option of the cities to "creep" but that changed nothing as they were placed in the neutral - passive category. If by dumb "dota" creeps you mean if they have a respawn then no.

"Creep" the race means nothing when it comes to who attacks who. That is done with "teams" also referred to as "forces." Neutral Hostile attacks all teams (Players 1-12) but will not attack neutral passive. All of this can be set with triggers. I don't know why you would try AI Editor for something as complex as risk. It will need to have some triggers anyway. You can set alliances by trigger. So make team x treat team y as an ally (or enemy if you want). If you want your AI not to attack "creeps" then you should make them treat them as neutral passive. To change this, double-click on a unit that is already placed on you map and change the player to neutral passive. Where a unit appears in the editor has nothing to do with how it acts in game.
 
Level 5
Joined
Jul 14, 2014
Messages
115
"Creep" the race means nothing when it comes to who attacks who. That is done with "teams" also referred to as "forces." Neutral Hostile attacks all teams (Players 1-12) but will not attack neutral passive. All of this can be set with triggers. I don't know why you would try AI Editor for something as complex as risk. It will need to have some triggers anyway. You can set alliances by trigger. So make team x treat team y as an ally (or enemy if you want). If you want your AI not to attack "creeps" then you should make them treat them as neutral passive. To change this, double-click on a unit that is already placed on you map and change the player to neutral passive. Where a unit appears in the editor has nothing to do with how it acts in game.

I use the AI editor because I have barely the slightest idea of how to make an AI with triggers. But I will try to make the AI aggressive to neutral - naga, as it seems only attack the neutral - aggressive units.

EDIT: Ok, I tried adding this:
  • Player - Make Player 1 (Red) treat Neutral Extra as an Enemy
  • Player - Make Player 1 (Red) treat Neutral Victim as an Enemy
  • Player - Make Player 1 (Red) treat Neutral Passive as an Enemy
player 1 is the AI in my case. Still the AI attacks only regular units but not the buidlings. And you didn't answer my question. Why does the AI attack even when I removed all of the attacks from the "attacking" tab?
 
Last edited:
I use the AI editor because I have barely the slightest idea of how to make an AI with triggers. But I will try to make the AI aggressive to neutral - naga, as it seems only attack the neutral - aggressive units.

EDIT: Ok, I tried adding this:
  • Player - Make Player 1 (Red) treat Neutral Extra as an Enemy
  • Player - Make Player 1 (Red) treat Neutral Victim as an Enemy
  • Player - Make Player 1 (Red) treat Neutral Passive as an Enemy
player 1 is the AI in my case. Still the AI attacks only regular units but not the buidlings. And you didn't answer my question. Why does the AI attack even when I removed all of the attacks from the "attacking" tab?

It shouldn't. Also, you didn't use the right players in the trigger you posted. Neutral - Naga is not a player. It is a race.

You obviously did not set the attack correctly. If you set "attacks enabled" to "none" then the unit will not attack anything. If you removed all targets from the "targets allowed" then maybe you still have both attacks enabled or maybe that allows a unit to attack everything. I have never tried that. Either way you are doing this wrong. To solve it follow these instructions:

1. find the "player" you want Player 1 to be dealing with in a certain way. For example neutral hostile. I suggestion you make the team/player neutral hostile. This talk of Naga just shows how confused you are. Naga is not a player, it is a race. Players can be a certain race, but that does not make them the same. Races are Human, Orc, etc. Players are 1, 2, 3, ..., Neutral hostile, neutral passive, etc. Once you know what "player" you are dealing with then ...

2. Player - Make Player 1 (Red) treat Neutral Hostile as an Enemy. If you want them to attack everything owned by player neutral hostile. "Treat as neutral passive" if you want them to ignore all units owned by that player.

Did you set it to run melee scripts at initialization?
 
Level 5
Joined
Jul 14, 2014
Messages
115
It shouldn't. Also, you didn't use the right players in the trigger you posted. Neutral - Naga is not a player. It is a race.

You obviously did not set the attack correctly. If you set "attacks enabled" to "none" then the unit will not attack anything. If you removed all targets from the "targets allowed" then maybe you still have both attacks enabled or maybe that allows a unit to attack everything. I have never tried that. Either way you are doing this wrong. To solve it follow these instructions:

1. find the "player" you want Player 1 to be dealing with in a certain way. For example neutral hostile. I suggestion you make the team/player neutral hostile. This talk of Naga just shows how confused you are. Naga is not a player, it is a race. Players can be a certain race, but that does not make them the same. Races are Human, Orc, etc. Players are 1, 2, 3, ..., Neutral hostile, neutral passive, etc. Once you know what "player" you are dealing with then ...

2. Player - Make Player 1 (Red) treat Neutral Hostile as an Enemy. If you want them to attack everything owned by player neutral hostile. "Treat as neutral passive" if you want them to ignore all units owned by that player.

Did you set it to run melee scripts at initialization?

No I deleted melee scripts. How do I see who these buildings belong to then?
 
Status
Not open for further replies.
Top