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

[Trigger] Smart Unit Attacking System

Status
Not open for further replies.
Level 4
Joined
Aug 6, 2014
Messages
87
Hey, I'm having a mode for my map called "survival" and actually it works sometimes with the units.. Not always.

I want that the units go to a specific unit of a random selected player with attack move, if they get to the "base" of the player they mostly get stuck not attacking the "wall" they're supposed to attack, they're melee units and supposed to break the wall, then go for the unit they're moving to the position to. They mostly spend their time chilling in a corner and trying to attack the towers/ranged units but they can't.

These are my actual triggers:
(I've put a 1 index in there, (player number of owner of unit), so I can test it with myself for now, the attacking.)

  • creep attack
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • Set random_save = (Random integer number between 1 and 10)
      • Cinematic - Ping minimap for (All players) at (Position of survivalist[1]) for 1.00 seconds, using a Warning ping of color (100.00%, 100.00%, 100.00%)
      • Unit Group - Pick every unit in (Units owned by Player 12 (Brown)) and do (Actions)
      • Loop - Actions
        • Unit - Order (Picked unit) to Attack-Move To (Position of survivalist[1])
 
Level 9
Joined
May 21, 2014
Messages
580
It sounds exactly as a problem with my map.

I have a few tips for you. There is an AI in Warcraft III that you cannot remove, unless you set the enemies to Neutral Hostile.
The AI does what you have stated; they like attacking units THAT ARE A THREAT. They will not attack units that are not a threat. If there is no way to get to the ranged units (and I mean NO WAY) they will attack the walls, but they still pause.

The problem of setting the player to Neutral Hostile has its setbacks too.
Because Warcraft III has a limitation that has already been discussed with me, where too many enemy units are owned by a single Computer player, your enemy units will hand and do a stop dance. The solution is to make many Computer player slots and distribute the enemies to each computer player.
 
Level 4
Joined
Aug 6, 2014
Messages
87
blancfaye7 I don't really understand what you mean, and I can't use Neutral Hostile, it's already in use.

What just exactly happens:
They attack move to the unit > If the path to the unit is blocked, they just get on stuck on a natural cliff somewhere, if hes near that spot ofc, and don't really move up the way to the wall and attack it.
 
Level 9
Joined
May 21, 2014
Messages
580
You need to do some advanced triggering stuff to override the AI, for I had faced such a problem before. How many computer slots are there in the map? How many players? How many enemy units spawn every second?

Because these are also a huge factor, this must be addressed before programming the AI and solve the stopping of units.
 
Level 4
Joined
Aug 6, 2014
Messages
87
Technically players would be able to run through the wall with wind walk.. Doesn't seem so well at all.. I mean, that's just a good but kind of cheap fix for the problem. That dude who opened the thread was looking for a system as it is in Fortress Survival, and somehow they got it working, so we'd have to be able to do that as well.

Methods I've tried:

Give perma invisibility around the map - failed (creeps try to attack other buildings they can't reach, even if the buildings don't attack)
Perma invisbility around wall spots - failed (nothing changed)


What could actually work, cuz I see that in fortress survival as well, somehow a range check if units of a specfiic classification (e.g. ancients) are nearby, then attack those picked nearby units.

I've seen it often enough in fortress survival, if creeps destroy a wall they won't just necessarily go focus the tower, nah, they most likely kill nearby walls first.
I've tried that somehow already but found no way to trigger that, someone got an idea?
 
Level 13
Joined
Oct 16, 2010
Messages
731
I'm a little confused here.. are the walls units or buildings? Also what is their armor type? Through a lot of gameplay I've noticed that AI will ignore Fortified units unless they are the only enemies left.

One of the ways I've avoided this was to give "walls" an attack and give them a different armor type (like heavy).
 
Status
Not open for further replies.
Top