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

Replacing a units "upgrades to" unit

Status
Not open for further replies.
Level 9
Joined
Jun 10, 2013
Messages
473
hey is there any way to trigger when an upgrade is researched that a units "upgrades to" unit is replaced with an other "upgrades to" unit for example:

defend upgrade is finished being researched --> Scout towers "upgrades to" unit (which is the guard tower) is replaced with a "spirit tower".

so now the "scout tower" can only upgrade to a "spirit tower" and no longer the "guard tower".
 
Level 14
Joined
Jul 1, 2008
Messages
1,314
I would suggest making two scout towers in the object editor. One can only upgrade to the spirit tower and one to the guard tower.

Upon the event "A unit finishes research" and the Condition "Researched tech-type == Defend", you pick all units owned by the owner of the triggering unit, that are of type scout tower (guard upgrade). Replace them with a scout tower (spirit) (action in generic unit actions).

Please note, that replacing units means, that you have to re-asign any variables that this unit might have been stored to. Also, it could mess up ongoing things, you will have to try if this is suitable for you.
 
Level 13
Joined
Jul 15, 2007
Messages
763
Since it's a Research, when a player finishes a research, you can enable the production of Spirit Towers and disabled the production of Guard Towers via triggers.

At map initialization you disable Spirit Towers for all players assuming all players start with no tech.

If you want to upgrade all pre-existing Guard Towers to Spirit Towers you'll need to listen to Emm-A-.
 
Status
Not open for further replies.
Top