• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Replacement of units from AI

Status
Not open for further replies.
Level 4
Joined
Aug 7, 2010
Messages
77
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
Joined
Mar 6, 2006
Messages
9,243
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.

http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/hashtables-mui-133407/
 
Status
Not open for further replies.
Top