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

Units In Waves

Status
Not open for further replies.
Level 4
Joined
Jan 3, 2012
Messages
60
Hey guys!

How do i trigger this: Im making a TD where the towers will become alive in the waves and stading still between the waves. So, i made 2 of each unit, one building and one unit. When the wave starts i want the buildings to be units and when it ends i want the units to be buildings again. When the units are becomming buildings again i want them to be at the same spot as the building was and not at the spot they were that moment. Plus i want all the dead units to resurrect and be buildings again. And one more thing each building has a unit that matches it, so it have to be a specific unit that replaces each building

Sorry for the very bad explanation, but this was really hard to explain...
 
Level 31
Joined
Jun 27, 2008
Messages
2,556
You will need a lot of variables. Set Points to the positions of buildings, hide buildings, create/move units into that point. When buildings again, move units into buildings position, hide unit and unhide building. Create new unit if unit dies.

Of course there are more efficient ways I suppose.
 
Level 17
Joined
Jul 17, 2011
Messages
1,864
when a unit finishes construction add it to a unit group and save its location to another array

at the beggining of the wave pick every unit in the group you first added it to and replace the unit with something else for example

if picked unit is footman
replace with knight.

then add an event which detects if there are no more creeps from the wave
if there are no more creeps in the map remove all the units you replaced and create each unit from the group at the saved location you saved in the array

repeat for each wave
 
Level 4
Joined
Jan 3, 2012
Messages
60
Thanks! But i still dont fully understand what i have to do. Could someone please make a trigger and post it here?
 
Status
Not open for further replies.
Top