• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Getting Locust unit from Locust Swarm

Status
Not open for further replies.
Level 1
Joined
Jul 27, 2016
Messages
2
I want to be able to index each Locust spawned from Locust Swarm to their caster, but I can't figure out a way to get each Locust and their respective caster in the same trigger. I attached the map in case it is too confusing but I'm trying to scale Locust damage to the Crypt Lord's strength. Help?
 

Attachments

  • locustswarm.w3x
    35.2 KB · Views: 46

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,233
Do they proc the summon event? Maybe you can get summoning unit them.

Do they proc the enter region event, the following may still work then? One could try and guess who they belong to by searching for the Crypt Lord nearby their entry point. If a player has many Crypt Lord and cast the ultimate at the same time this might not be accurate, but in most cases will be good enough. One could improve accuracy by adding extra tests such as making sure the Crypt Lord at least has the ultimate and that the ultimate ability has recently been cast.
 
Level 11
Joined
Jun 2, 2004
Messages
849
They will proc neither event, iirc.

You could remove the locust ability from the unit to grab them when they enter the map. Once you're done doing whatever to them, add Locust back with triggers. If you're using GUI, then the Locust ability won't appear on the list, so use the custom script:
Code:
call UnitAddAbilityBJ( 'Aloc', GetTriggerUnit() )

To get the summoning unit... well, I can't think of any completely foolproof methods, but you can search for the closest unit with the locust swarm ability and assume that's the summoner.
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,233
You could remove the locust ability from the unit to grab them when they enter the map. Once you're done doing whatever to them, add Locust back with triggers. If you're using GUI, then the Locust ability won't appear on the list, so use the custom script:
Problem is the units must spawn with Locust or Locus Swarm does not work properly (the swarm mechanics will not work).

Is the Locust Swarm damage source the locust unit or the Crypt Lord? If it is the Crypt Lord you could trigger the damage by getting the Locust units to deal minimum damage and then adding extra from the Crypt Lord.
 
Last edited:
Level 1
Joined
Jul 27, 2016
Messages
2
I tried removing the Locust ability from the unit itself and adding it when they enter the map, but they did not swarm. However, the unit enters region event still worked even when the unit had the Locust ability. My trigger just grabs the nearest Crypt Lord so everything works fine now. ty
 
Status
Not open for further replies.
Top