Returns without my permission? :P

elmstfreddie

The Finglonger
Reaction score
203
Okay... I don't know if I'm missing something obvious or not but this is really pissin me off.
JASS:
    loop
        call BJDebugMsg("works2")
        set Locust[index] = CreateUnit(GetOwningPlayer(Owner),LocustId(),GetUnitX(Owner),GetUnitY(Owner),270.00)
        call BJDebugMsg("works3")
        call GroupAddUnit(Locusts,Locust[index])
        exitwhen CountUnitsInGroup(Locusts) >= NumOfLocusts(GetUnitAbilityLevel(Owner,AbilId()))
        set index = index + 1
    endloop
    call BJDebugMsg("first loop over")


It's pretty self explanatory. Anyways, so, you'd expect the game to either mass works2 works3 works2 works3 etc OR to just show them once then to show first loop over. HOWEVER, works2 then works3 show once, and one unit is created, YET, first loop over never shows. So basically it's stuck inside the loop, but won't do more than 1 loop, or it somehow returns without a return message... o_O
I really don't get why this is happening...

If it matters this is the function NumOfLocusts
JASS:
constant function NumOfLocusts takes integer AbilLevel returns integer
    return 5 + (5 * AbilLevel)
endfunction
 

SFilip

Gone but not forgotten
Reaction score
634
Where/how did you define Locusts?
It must be created before trying to add a unit or else the thread will crash causing exactly what you claim is happening.
 

elmstfreddie

The Finglonger
Reaction score
203
Mmm hmm I'm an idiot thanks :p
I'll set it to CreateGroup and watch my trigger still not work, since I like just started it. If it doesn't I'll just post more here ;)

Lol, I posted this on the first post on purpose
Okay... I don't know if I'm missing something obvious or not but this is really pissin me off.

:p
I'm an idiot sometimes.
 
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