• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 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!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

Replacement of units from AI

Not open for further replies.
Level 4
Aug 7, 2010
Guys, if you all had play campaign, during the situation where you invade enemy bases, there will be units guarding the enemy base. If the guard units are being killed, normally enemy will train back the unit using barrack and the newly trained will move to the original guarding place again. So my question is, how do i set this type of triggers such that when unit A had fallen and barrack B will immediately build back the unit and let the newly trained unit move to the guarding place?

edited* i was trying to use this
Event- When footman X dies
Condition - none
Action- Order barrack to train a footman at the place of dying units

But however, this can only work once since the newly trained unit isnt footman X anymore. I want the cycle to go on and on. Any form of help will be greatly appreciated!
Level 37
Mar 6, 2006
With hastables. Initialize each pre-palced unit, save the handle of the training building for each guard. Save the location of the unit for the building.

Then create a trigger with Unit Dies event. Load the training building and order it to train the correct unit. When the buildning finishes training, order the trained unit to move to the stored location. Save the training building's handle for the trained unit.

Not open for further replies.