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

Giving Unique ID to multiple summoned units?

Status
Not open for further replies.
Level 4
Joined
Jan 18, 2019
Messages
71
I am nearing the part in my project where a portion of my units will summon other units. They don’t summon just one, but can summon many from the same spell. The question I have is this:

Is there a way in which I can ID these units, or add them to a UG once they have been summoned? I want to be able to give them order comamands and buffs, etc..

Thanks much. I’ve searched, but I haven’t found a clear answer to my question in the archives.
 
Level 12
Joined
Nov 3, 2013
Messages
989
What do you mean exactly?

You can detect when a unit is summoned and you can add the unit to some unitgroup, array, or hashtable.

  • Untitled Trigger 001
    • Events
      • Unit - A unit Spawns a summoned unit
    • Conditions
    • Actions
      • Unit Group - Add (Summoned unit) to unitGroup
To be able to know from which ability the units were summoned you can make use of the unit type and/or check whether the summoning unit's level of said ability is level 1 or higher.

  • Untitled Trigger 001
    • Events
      • Unit - A unit Spawns a summoned unit
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Summon Water Elemental for (Triggering unit)) Greater than or equal to 1
          • Or - Any (Conditions) are true
            • Conditions
              • (Unit-type of (Summoned unit)) Equal to Water Elemental (Level 1)
              • (Unit-type of (Summoned unit)) Equal to Water Elemental (Level 2)
              • (Unit-type of (Summoned unit)) Equal to Water Elemental (Level 3)
        • Then - Actions
          • Unit Group - Add (Summoned unit) to waterElementals
        • Else - Actions
Besides that you'd have to explain yourself some more if there's something in particular that you need help with.
 
Level 4
Joined
Jan 18, 2019
Messages
71
thanks for the reply and the triggers.

I see that those work for a single summon spawn, but can A unique ID be given to more than a single spawn if the ability, like far seer’s wolves, summons more than one unit at a time?
 
Level 7
Joined
May 14, 2019
Messages
255
Set up a trigger which uniquely identifies summoned unit 1 as variable 1 and summoned unit 2 as variable 2

I thought I had to do something similar to this because I wanted unit created from dark portal to be removed after 60 seconds, but I found that you could just give them an expiration timer
 
Status
Not open for further replies.
Top