well, i have this inside of my trigger(this trigger is hella longer but this is what doesnt work)
it goes all the way to next to loop but it never fires loop finished even though it should fire it 10 times at this example.
The locals are set differently and also myability is something else but I dont want to spoil it.
So from the Debug messages it looks like the if breaks this piece of code.
The ability has 0 mana cost, 0 cooldown and the dummy unit has has maximum possible mana, I double checked that.
Anyone any help?
edit: found out that the inside the loop also doesnt fire, any way to fix the if because what else can be wrong there, there is nothing between debugmsg and if and only things inside the loop doesnt fire
JASS:
local unit first
local unit ustun
local group g = CreateGroup()
local integer stuncount = 10
local integer stunlevel = whatever
if something then
call GroupEnumUnitsInRange(g, ux, uy, someradius, null)
call BJDebugMsg("enumed")
loop
set first = FirstOfGroup(g)
exitwhen first == null or stuncount == 0
call GroupRemoveUnit(g, first)
call BJDebugMsg("next to loop")
if not IsUnitAlly(first, GetOwningPlayer(ustun)) then // if IsUnitEnemy(first, GetOwningPlayer(ustun) then also didnt work
call BJDebugMsg("inside of loop")
set ustun = CreateUnit(GetOwningPlayer(u), 'hRsu', ux, uy, 0)
call UnitAddAbility(ustun, myability)
call SetUnitAbilityLevel(ustun, myability, stunlevel)
call UnitApplyTimedLife(ustun, 'BTLF', 0.75)
call IssueTargetOrder(ustun, "thunderbolt", first) //also tried call IssueTargetOrderById(ustun, 852095, first) and didnt work
call BJDebugMsg("loop finished")
set ustun = null
endif
set stuncount = stuncount - 1
endloop
endif
it goes all the way to next to loop but it never fires loop finished even though it should fire it 10 times at this example.
The locals are set differently and also myability is something else but I dont want to spoil it.
So from the Debug messages it looks like the if breaks this piece of code.
The ability has 0 mana cost, 0 cooldown and the dummy unit has has maximum possible mana, I double checked that.
Anyone any help?
edit: found out that the inside the loop also doesnt fire, any way to fix the if because what else can be wrong there, there is nothing between debugmsg and if and only things inside the loop doesnt fire