[Spell] About Locust Swarm 2: Issue & Request

Level 8
Joined
Oct 6, 2022
Messages
185
From these past few months, i just saw an issue regarding to this Locust Swarm units. Some was able to follow the Triggering Unit and some just circling around to their own position and never follow the Triggering Unit until it reaches the end of duration and dies. I've lessen the number of locust until it reaches into 5 but the issue is still there. And the locust aren't that fast enough to reach the Triggering Unit at the end of the duration if the Triggering Unit is moving. How do i solve this issue?


My main reason why ask/request for help is i would like thes locust to be good and is somewhat connected to this topic few day ago[Making unit transparent without hiding FX] but different. I've found the Locust Swarm really good the ability I'm creating, "The Triggering Unit becomes 100% transparent and summons 20 locust around it and follows the Triggering Unit, by the end of duration it returns to triggering unit, each Locust returns to the unit is equal of making the Triggering Unit lose its % of Transparency until it reaches to 0%".

Though this request is somewhat impossible to do so, i hope you guys could help me.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
I'm not too sure what your issue is with the Locust Swarm ability. It should be working as intended.

For the transparency changing, that's pretty simple, here's an example that will work for 1 Hero per Player (MPI):
  • Locust Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Locust Swarm
    • Actions
      • Set VariableSet Locust_PN = (Player number of (Triggering player))
      • Set VariableSet Locust_Hero[Locust_PN] = (Triggering unit)
      • Set VariableSet Locust_Count[Locust_PN] = 0
      • Set VariableSet Locust_Transparency = 0.00
      • Animation - Change Locust_Hero[Locust_PN]'s vertex coloring to (100.00%, 100.00%, 100.00%) with Locust_Transparency% transparency
      • Trigger - Turn on Locust Spawn <gen>
      • Trigger - Turn on Locust Dies <gen>
  • Locust Spawn
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Locust
    • Actions
      • Set VariableSet Locust_PN = (Player number of (Owner of (Triggering unit)))
      • Set VariableSet Locust_Count[Locust_PN] = (Locust_Count[Locust_PN] + 1)
      • Set VariableSet Locust_Transparency = (5.00 x (Real(Locust_Count[Locust_PN])))
      • Animation - Change Locust_Hero[Locust_PN]'s vertex coloring to (100.00%, 100.00%, 100.00%) with Locust_Transparency% transparency
  • Locust Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Locust
    • Actions
      • Set VariableSet Locust_PN = (Player number of (Owner of (Triggering unit)))
      • Set VariableSet Locust_Count[Locust_PN] = (Locust_Count[Locust_PN] - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Locust_Count[Locust_PN] Greater than 0
        • Then - Actions
          • Set VariableSet Locust_Transparency = (5.00 x (Real(Locust_Count[Locust_PN])))
        • Else - Actions
          • Set VariableSet Locust_Transparency = 0.00
      • Animation - Change Locust_Hero[Locust_PN]'s vertex coloring to (100.00%, 100.00%, 100.00%) with Locust_Transparency% transparency
Locust Spawn and Locust Dies should be Initially OFF. That way they remain disabled until someone actually uses the ability (optimization).
 

Attachments

  • Locust Swarm Transparency 1.w3m
    18.4 KB · Views: 3
Last edited:
Level 8
Joined
Oct 6, 2022
Messages
185
I'm not too sure what your issue is with the Locust Swarm ability. It should be working as intended.

For the transparency changing, that's pretty simple, here's an example that will work for 1 Hero per Player (MPI):
  • Locust Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Locust Swarm
    • Actions
      • Set VariableSet Locust_PN = (Player number of (Triggering player))
      • Set VariableSet Locust_Hero[Locust_PN] = (Triggering unit)
      • Set VariableSet Locust_Count[Locust_PN] = 0
      • Set VariableSet Locust_Transparency = 0.00
      • Animation - Change Locust_Hero[Locust_PN]'s vertex coloring to (100.00%, 100.00%, 100.00%) with Locust_Transparency% transparency
      • Trigger - Turn on Locust Spawn <gen>
      • Trigger - Turn on Locust Dies <gen>
  • Locust Spawn
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Locust
    • Actions
      • Set VariableSet Locust_PN = (Player number of (Owner of (Triggering unit)))
      • Set VariableSet Locust_Count[Locust_PN] = (Locust_Count[Locust_PN] + 1)
      • Set VariableSet Locust_Transparency = (5.00 x (Real(Locust_Count[Locust_PN])))
      • Animation - Change Locust_Hero[Locust_PN]'s vertex coloring to (100.00%, 100.00%, 100.00%) with Locust_Transparency% transparency
  • Locust Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Locust
    • Actions
      • Set VariableSet Locust_PN = (Player number of (Owner of (Triggering unit)))
      • Set VariableSet Locust_Count[Locust_PN] = (Locust_Count[Locust_PN] - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Locust_Count[Locust_PN] Greater than 0
        • Then - Actions
          • Set VariableSet Locust_Transparency = (5.00 x (Real(Locust_Count[Locust_PN])))
        • Else - Actions
          • Set VariableSet Locust_Transparency = 0.00
      • Animation - Change Locust_Hero[Locust_PN]'s vertex coloring to (100.00%, 100.00%, 100.00%) with Locust_Transparency% transparency
Locust Spawn and Locust Dies should be Initially OFF. That way they remain disabled until someone actually uses the ability (optimization).
Thank you Uncle, may i know how do i adjust the speed of the locusts? I did with trigger and it didn't work, same goes to the object editor. Does it have to do with the "Follow Unit" of Locust behavior" or there must be other way?
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
Thank you Uncle, may i know how do i adjust the speed of the locusts? I did with trigger and it didn't work, same goes to the object editor.
This is incorrect. I literally just opened the editor and tested to make sure I'm not crazy. Locusts have a default speed of 400. Raising it to the maximum of 522 they move noticeably faster, and lowering it 1 makes them move extremely slowly. As the unit movespeed fields states: any value of movespeed outside the normal allowed range will be clamped to be within that range, so they clearly aren't moving at exactly 1 but it's quite slow still.

If you are using something like MoveSpeedX in your map to exceed the 522 movespeed maximum, then... of course the locusts can't catch up when they're capped at 522. FWIW locusts always lag behind the unit they're attached too; that's just how the ability always works. You may also have altered some fields that affect the locusts' movement and ranges, which you can read about in detail in the Wc3 Ability Insight Document.
 
Level 8
Joined
Oct 6, 2022
Messages
185
This is incorrect. I literally just opened the editor and tested to make sure I'm not crazy. Locusts have a default speed of 400. Raising it to the maximum of 522 they move noticeably faster, and lowering it 1 makes them move extremely slowly. As the unit movespeed fields states: any value of movespeed outside the normal allowed range will be clamped to be within that range, so they clearly aren't moving at exactly 1 but it's quite slow still.

If you are using something like MoveSpeedX in your map to exceed the 522 movespeed maximum, then... of course the locusts can't catch up when they're capped at 522. FWIW locusts always lag behind the unit they're attached too; that's just how the ability always works. You may also have altered some fields that affect the locusts' movement and ranges, which you can read about in detail in the Wc3 Ability Insight Document.
I looked at the Locust and yeah, you're right. I don't know how to solve this issue about this locust especially about the "All mobile units that do not return to the caster after a while will instantly kill themselves. (Akaiharuki)" I've saw from the doc you've provided. At this point i don't know what should i do to make an alternative locust in trigger which it has faster movement speed and all return to the caster.
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
Unfortunately all of these issues seem to be hard-coded limitations that you cannot avoid when using the ability. There are some absurd approaches like changing the scale of everything on your map to be smaller so all units can have slower movespeed (but it still looks the same) which would make the maximum difference between locust speed and unit speed (means they are more likely to make it back to the caster before dying). But I don't think that's recommended.

If you want it to behave exactly as you desire you'll have to make the ability yourself with triggers from scratch. Another sort of hybrid approach would actually be to use model-less locusts for the actual spell effects (like damage and healing), and then use some triggers to create and animate your own visual cloud of locusts that behave properly (but they are just for looks and don't damage/heal anything).

Perhaps there is another solution, but I don't see it.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
I still don't fully understand what you want.

I understand:
1) You want faster locusts, breaking the 522 ms limit.
2) You want the caster to be transparent while the locusts are active.

But what is this problem about the Locusts not returning? Never seen that before. They will return when the Duration of the spell ends and will die when you cast it again (if they're somehow still alive at that moment).

Triggering Locust Swarm wouldn't be too difficult, but there will likely be some noticeable differences. It's hard to replicate the math/logic when you can't see the source code.
 
Level 8
Joined
Oct 6, 2022
Messages
185
I still don't fully understand what you want.

I understand:
1) You want faster locusts, breaking the 522 ms limit.
2) You want the caster to be transparent while the locusts are active.

But what is this problem about the Locusts not returning? Never seen that before. They will return when the Duration of the spell ends and will die when you cast it again (if they're somehow still alive at that moment).
A certain locust unit that is not returning from the caster is almost rare to notice because it takes multiple attempts until you'll see this issue, you'll see either 1-3 locust unit(s) doing this kind of behavior. As what Pyrogasm have send which is this [ Wc3 Ability Insight Document ], i saw the behavior from locust ability called "All mobile units that do not return to the caster after a while will instantly kill themselves. (Akaiharuki)" Which is the once I've saw from in game.

You can test it out(you can change it the model into a model you'll able to see faster) to see this behavior of locusts.

Triggering Locust Swarm wouldn't be too difficult, but there will likely be some noticeable differences. It's hard to replicate the math/logic when you can't see the source code.
"Wandering around Move in every direction of 300 position of the Triggering Unit then follows the Triggering Unit if it the Triggering Unit moved" would be nice to happen, but i understand that it's to difficult to do it.
 
Top