How can i detect the Unit that is Upgrading or The Type of the Upgrade?

0zaru

Learning vJASS ;)
Reaction score
60
Well the title says it all How can i detect the Unit That is upgrading (A tower upgrading to another thing) and the do actions ? Or the unit type of the unit being upgraded? Is it possible?
 

Tinki3

Special Member
Reaction score
418
It is possible, yes.
I use the "Begins an upgrade" event to detect the unit.
Though, when trying to display what unit is actually upgrading, it displayed the name of the
upgraded/currently-been-upgraded-to unit..

For example, I tried adding in a condition to a trigger that checked to see if
the type of upgrading tower was a Scout Tower, and with an action that
displayed what unit it "currently" is which you'd first think is the original - the Scout.
Though, it didn't display anything, because the upgrading unit instantly turned
into the type of unit the upgrade produces.

In this case, the Scout turned into a Guard, so it would display "Guard Tower",
if I removed that condition.

This is how you'd want to do things:
Just add into the triggers conds all the types of towers the original can upgrade-to:
Code:
Example
    Events
        Unit - A unit Begins an upgrade
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Unit-type of (Triggering unit)) Equal to Guard Tower
                (Unit-type of (Triggering unit)) Equal to Cannon Tower
                (Unit-type of (Triggering unit)) Equal to Arcane Tower
    Actions
        Game - Display to (All players) the text: (Name of (Triggering unit))
Here, the original Scout Tower can upgrade to any one of those in the conds,
so what ever is been upgraded-to, will be displayed in the actions.
 

0zaru

Learning vJASS ;)
Reaction score
60
Thanks for the answer but i manage how to detect it before :)
I used that but with Specifict and then destroy the trigger (a local trigger in jass)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top