• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Need help to add locust to a unit array

Status
Not open for further replies.
Level 4
Joined
Nov 13, 2019
Messages
47
Hey, I'm wondering if someone can help me write custom script because my JASS skills are non-existent.

Basically I need to add Locust to an array of units from 1-6

example:
  • For each (Integer A) from 1 to 6, do (Actions)
    • Loop - Actions
    • call UnitAddAbilityBJ( 'Aloc', udg_DefenderUnitStack[Integer A] )
I will later need to remove it the same way.
 
Level 4
Joined
Nov 13, 2019
Messages
47
udg_DefenderUnitStack[bj_forLoopAIndex]
When you have doubts, simply do it without custom script, use with the loop A variable in GUI and convert the trigger to custom text, there you can see how it is done.
Great, thanks for the info. I ended up circumventing it by

  • For each (Integer A) from 1 to 6, do (Actions)
    • Loop - Actions
      • Set VariableSet TempUnit = DefenderUnitStack[(Integer A)]
      • Custom script: call UnitAddAbilityBJ( 'Aloc', udg_TempUnit )
That was well and easy, but it has become apparent that removing locust from a unit isn't as simple as you'd think. Has anyone found any good methods?
I've thought about completely replacing the unit with a copy, but the problem is I need it to keep its buffs and items...
And using a transform ability won't do me any good because I'd have to create one for each unit type
 
Last edited:
Status
Not open for further replies.
Top