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

Auto Upgrade after research completion trigger

Status
Not open for further replies.
Level 3
Joined
Jul 6, 2014
Messages
23
I've seen it used in other maps, and I think I've seen it on the forums, but I cannot remember where it's located. I'm trying to add a trigger that will automatically upgrade a unit when the required research is completed. If anyone can direct me to the trigger, it would be very much appreciated.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
You could try with actor events under the unit's actor data. That way you can change the unit model without needing to change the unit type. Nothing stops you giving the same unit actor multiple units but equally well you could give the same unit multiple actors as long as only 1 is ever created at a time.

To change the unit data type used you can use the morph ability. Just do not give it a command card button and make sure it has a requirement to prevent hackers from using it until the upgrade completes. Do keep in mind that buff behaviours and modifiable unit properties are highly flexible so there really is not a needed to change the base unit type.
 
Level 21
Joined
Nov 4, 2013
Messages
2,017
Why don't you do this? Make a variable of type unit group called, for example, OldUnits then do this:

  • Events
    • Unit - (The Researching Structure) Finishes research
  • Conditions
    • (Researched tech-type) Equal to (Your research)
  • Actions
    • Set OldUnits = (Units owned by (Owner of (Researching Unit)) of type (Old Unit Type)
    • Unit Group - Pick every unit in OldUnits and do (Unit - Replace (Picked unit) with a (Upgrade Unit) using The old unit's relative life and mana)
    • Custom script: call DestroyGroup(udg_OldUnits)
 
Status
Not open for further replies.
Top