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

Spawner & Attack-moving

Status
Not open for further replies.
Level 2
Joined
Mar 16, 2019
Messages
12
Hi, I have this problem where the enemy waves don't attack-move as far as I want them to. They need to pass by 2 bases to get to the target that will defeat the player if they fail to protect it. Unfortunately, they only go so far as the first base. If they kill everything, half of them go back to their spawn region and the other half do as they are ordered to. I am not very good with triggers, so if I could get a proper visual demonstration of what I need to do to fix this problem that would be greatly appreciated.

These are the triggers I use to make it happen:

  • Wave1
    • Events
      • Time - Elapsed game time is 10.00 seconds
    • Conditions
    • Actions
      • Game - Display to (All players) the text: |cffdf0101Level - 1...
      • Unit - Create 30 Ghoul for Player 9 (Gray) at (Center of UndeadSpawn1 <gen>) facing (Position of Arcane Observatory 0003 <gen>)
      • Unit - Create 30 Zombie for Player 9 (Gray) at (Center of UndeadSpawn2 <gen>) facing (Position of Arcane Observatory 0003 <gen>)
      • Unit Group - Pick every unit in (Units in UndeadSpawn1 <gen>) and do (Unit Group - Order (Units in UndeadSpawn1 <gen>) to Attack-Move To (Position of Arcane Observatory 0003 <gen>))
      • Unit Group - Pick every unit in (Units in UndeadSpawn2 <gen>) and do (Unit Group - Order (Units in UndeadSpawn2 <gen>) to Attack-Move To (Position of Arcane Observatory 0003 <gen>))
  • Onslaught
    • Events
      • Unit - A unit enters Onslaught <gen>
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Triggering unit)) Equal to Player 9 (Gray)
        • Then - Actions
          • Unit - Order (Triggering unit) to Attack-Move To (Random point in Dalaran <gen>)
        • Else - Actions
          • Do nothing
 
Level 2
Joined
Mar 16, 2019
Messages
12
use
  • AI - Ignore SomeUnits's guard position
Before attack-move, it only needs to be done once, but no problem if it is done more times

The enemies no longer go back to their spawn once a base is destroyed. Unfortunately they still don't continue marching forward and just stay there. I tried both methods I could think of but, again, I have little triggering experience.

  • Onslaught
    • Events
      • Unit - A unit enters Onslaught <gen>
    • Conditions
    • Actions
      • AI - Ignore (Triggering unit)'s guard position
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Triggering unit)) Equal to Player 9 (Gray)
        • Then - Actions
          • Unit - Order (Triggering unit) to Attack-Move To (Center of Dalaran <gen>)
        • Else - Actions
  • Onslaught
    • Events
      • Unit - A unit enters Onslaught <gen>
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Triggering unit)) Equal to Player 9 (Gray)
        • Then - Actions
          • AI - Ignore (Triggering unit)'s guard position
          • Unit - Order (Triggering unit) to Attack-Move To (Center of Dalaran <gen>)
        • Else - Actions
 
Level 2
Joined
Mar 16, 2019
Messages
12
Both methods don't make the units go forward besides to Dalaran region... you need to order them to go forward when they reach Dalaran region. Use the 2nd trigger.

I'm not sure I understand. If what you want me to do is make a second trigger for when they enter a new base region, then I tried and it didn't work.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
The best solution is a more complex AI like system that orders the units towards a specific target. All spawns are kept track in a unit group and every so often you order the entire unit group towards the nearest base which still exists. Once one base falls, you can order them to attack move to the next base. When one of the units dies remove them from the unit group, as removed units are not automatically removed from unit groups so can be considered a leak.

For determining which base to attack you can use an array operating as a sort of list with lowest index being the first base to attack and highest being the last (the defeat target). A base could be a rect which you check for defending structures (base units) in it and if none exist then check the next base and so on. The final base is the defeat objective so at this point the units can be ordered to attack it directly. The point units are ordered to attack is the position of one (first, last, does not need to be random) of the base structures inside the rect, so as to prevent the units getting stuck somewhere in the rect awaiting a building to die that they are not attacking. This attack movement update is issues every 15 or 30 seconds and when new units spawn.
 
Level 2
Joined
Mar 16, 2019
Messages
12
The best solution is a more complex AI like system that orders the units towards a specific target. All spawns are kept track in a unit group and every so often you order the entire unit group towards the nearest base which still exists. Once one base falls, you can order them to attack move to the next base. When one of the units dies remove them from the unit group, as removed units are not automatically removed from unit groups so can be considered a leak.

For determining which base to attack you can use an array operating as a sort of list with lowest index being the first base to attack and highest being the last (the defeat target). A base could be a rect which you check for defending structures (base units) in it and if none exist then check the next base and so on. The final base is the defeat objective so at this point the units can be ordered to attack it directly. The point units are ordered to attack is the position of one (first, last, does not need to be random) of the base structures inside the rect, so as to prevent the units getting stuck somewhere in the rect awaiting a building to die that they are not attacking. This attack movement update is issues every 15 or 30 seconds and when new units spawn.

While I appreciate your help. Your method is way more complex than what the other guy was suggesting and I have no clue how to do any of that.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Your method is way more complex than what the other guy was suggesting and I have no clue how to do any of that.
Wrda did not suggest any method other than the required disable guard position which will not fix the problem of the units losing orders such as after being stunned or taunted.

I explained how to do it in the reply.
 
Status
Not open for further replies.
Top