Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Trigger] Smart Unit Attacking System

Discussion in 'Triggers & Scripts' started by Freyky, Jun 22, 2016.

  1. Freyky

    Freyky

    Joined:
    Aug 6, 2014
    Messages:
    87
    Resources:
    0
    Resources:
    0
    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])
     
  2. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,174
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    Is the wall static of can it be built for example? If it is static then you could lay down regions next to the wall and use "A unit enters a region" event.
     
  3. blancfaye7

    blancfaye7

    Joined:
    May 21, 2014
    Messages:
    560
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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.
     
  4. Freyky

    Freyky

    Joined:
    Aug 6, 2014
    Messages:
    87
    Resources:
    0
    Resources:
    0
    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.
     
  5. blancfaye7

    blancfaye7

    Joined:
    May 21, 2014
    Messages:
    560
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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.
     
  6. Rheiko

    Rheiko

    Joined:
    Aug 27, 2013
    Messages:
    2,926
    Resources:
    7
    Icons:
    2
    Spells:
    3
    Tutorials:
    2
    Resources:
    7
    This could probably work for you. - Method
    I'm only suggesting the method, the triggering itself needs some more work if you are really going to use it.
    Still, it's pretty useful. Hope it helps.
     
  7. Freyky

    Freyky

    Joined:
    Aug 6, 2014
    Messages:
    87
    Resources:
    0
    Resources:
    0
    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?
     
  8. Karzama

    Karzama

    Joined:
    Oct 16, 2010
    Messages:
    602
    Resources:
    0
    Resources:
    0
    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).
     
  9. TheLordOfChaos201

    TheLordOfChaos201

    Joined:
    Jul 2, 2011
    Messages:
    1,739
    Resources:
    0
    Resources:
    0
    give the walls the ability taunt...

    use a trigger,

    when unit comes in range of wall
    give wall taunt and make wall use taunt
    delete taunt.

    I hope that helps