GroupEnumUnitsInRange(OfLoc)

the Immortal

I know, I know...
Reaction score
51
I was making a spell using the "GroupEnumUnitsInRange". the result = 0 units even if I try to pick every unit on the map. (They have collision size > 0 and are random Neutral Hostile Units). I tried the same with "GroupEnumUnitsInRangeOfLoc" and again nothing happens. Here's the shortened version of the spell containing only the needed part (even this part itself doesn't work)
Code:
constant function IN_Effect takes nothing returns string
    return "Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl"
endfunction

function IN_Conds takes nothing returns boolean
    return GetSpellAbilityId() == 'ANcl'
endfunction

function IN_Acts takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local location p = GetUnitLoc(u)
    local group g = null
    call DestroyEffect(AddSpecialEffect(INEffect(), GetLocationX(p), GetLocationY(p)))      //debug only
    call GroupEnumUnitsInRangeOfLoc(g, p, 100000, null)
    call BJDebugMsg(I2S(CountUnitsInGroup(g)) + " in the group")
    call RemoveLocation(p)
    call DestroyGroup(g)
    set u = null
endfunction

function InitTrig_IN takes nothing returns nothing
    set gg_trg_IN = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ( gg_trg_IN, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition(gg_trg_IN, Condition(function IN_Conds))
    call TriggerAddAction(gg_trg_IN, function IN_Acts)
endfunction
I cast the spell, the SFX is here and there's the message - "0 units in the group"
Any suggestions why it doesn't work? Or I am using it incorrectly? (or just tell me the stupid mistake I've probably made)
 

emjlr3

Change can be a good thing
Reaction score
395
exactly, how you can you add units to a group that does not exist?
 
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