• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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,240
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