1 Syntax Error for removing a group

R 3 T R O

New Member
Reaction score
12
JASS:
function F22Strike takes nothing returns nothing
    local integer i = 1
    local group missiles
    local unit u
    local real x = GetUnitX(udg_Boss)
    local real y = GetUnitY(udg_Boss)
    local real dx = GetUnitX(udg_F22Raptor[1]) - x
    local real dy = GetUnitY(udg_F22Raptor[1]) - y
    local real dx2 = GetUnitX(udg_F22Raptor[2]) - x
    local real dy2 = GetUnitY(udg_F22Raptor[2]) - y
    local real angle = bj_RADTODEG * Atan2(y - GetUnitY(udg_F22Raptor[1]), x - GetUnitX(udg_F22Raptor[1]))
    local real x2 = x + 800.0*Cos(angle*bj_DEGTORAD)
    local real y2 = y + 800.0*Sin(angle*bj_DEGTORAD)
    call IssuePointOrder(udg_F22Raptor[1],"move",x2,y2)
    call IssuePointOrder(udg_F22Raptor[2],"move",x2+60.0,y2+60.0)
    call IssuePointOrder(udg_F22Raptor[3],"move",x2-60.0,y2-60.0)
    if GetWidgetLife(udg_Boss)<2500.0 then
        call DestroyTrigger(GetTriggeringTrigger())
        call GeneralText(8.0, "|cfff3ad00F-22 Pilot|r : Target neutralized. Aborting mission." )
        call SetUnitFlyHeight(udg_F22Raptor[1], 1200.0, 200.0)
        call SetUnitFlyHeight(udg_F22Raptor[2], 1200.0, 200.0)
        call SetUnitFlyHeight(udg_F22Raptor[3], 1200.0, 200.0)
        call PolledWait(2.)
        call RemoveUnit(udg_F22Raptor[1])
        call RemoveUnit(udg_F22Raptor[2])
        call RemoveUnit(udg_F22Raptor[3])
    elseif (dx*dx+dy*dy<=4000000.0) or (dx2*dx2+dy2*dy2<=4000000.0) then //2000 radius
        call DestroyTrigger(GetTriggeringTrigger())
        set udg_AirstrikeTarget = GetUnitLoc(udg_Boss)
        call GeneralText(8.0, "|cfff3ad00F-22 Pilot|r : Missiles fired. He's all yours." )
        set missiles = CreateGroup()
        loop
            exitwhen i>3
            set u = CreateUnit( Player(9), &#039;h00C&#039;, GetUnitX(udg_F22Raptor<i>)+8.0, GetUnitY(udg_F22Raptor<i>)+8.0 ,0 )
            call IssuePointOrder(u,&quot;attackground&quot;,x,y)
            call GroupAddUnit(missiles,u)
            set u = CreateUnit( Player(9), &#039;h00C&#039;, GetUnitX(udg_F22Raptor<i>)-8.0, GetUnitY(udg_F22Raptor<i>)-8.0 ,0 )
            call IssuePointOrder(u,&quot;attackground&quot;,x,y)
            call GroupAddUnit(missiles,u)
            if GetRandomInt(0,1)==1 then
                call TriggerSleepAction(0.)
            endif
            set i=i+1
        endloop
        set u = null
        call SetUnitFlyHeight(udg_F22Raptor[1],1000.0,200.0)
        call SetUnitFlyHeight(udg_F22Raptor[2],800.0,200.0)
        call SetUnitFlyHeight(udg_F22Raptor[3],1200.0,200.0)
        call SetUnitMoveSpeed(udg_Boss,GetUnitDefaultMoveSpeed(udg_Boss))
        call PolledWait(1.)
        call RemoveLocation(udg_AirstrikeTarget)
        call ForGroup(missiles,function RemoveUnitAll)
        call DestroyGroup(missiles)
        set missiles = null
        call PolledWait(0.5)
        call RemoveUnit(udg_F22Raptor[1])
        call RemoveUnit(udg_F22Raptor[2])
        call RemoveUnit(udg_F22Raptor[3])
    endif
endfunction

function F22MissionConditions takes nothing returns boolean
    local unit u = GetTriggerUnit()
    local real hp = GetWidgetLife(u)
    return (GetUnitTypeId(u)==&#039;N006&#039;)
endfunction

function F22Mission takes nothing returns nothing
    local integer i = 1
    local trigger t = CreateTrigger()
    call DestroyTrigger(GetTriggeringTrigger())
    call PolledWait(2.)
    call GeneralText(5.0, &quot;|cfff3ad00Battalion|r : Birds are inbound. Hang on, Marines.&quot; )
    set bj_forLoopAIndex = 1
    set bj_forLoopAIndexEnd = 3
    loop
        exitwhen bj_forLoopAIndex &gt; bj_forLoopAIndexEnd
        call CreateNUnitsAtLoc( 1, &#039;h00B&#039;, Player(0), GetRandomLocInRect(gg_rct_Region_000), bj_UNIT_FACING )
        set udg_F22Raptor[GetForLoopIndexA()] = GetLastCreatedUnit()
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
    call PolledWait(2.)
    call TriggerAddAction(t, function F22Strike)
    call TriggerRegisterTimerEvent(t,0.2,true)
    set t = null
    call PolledWait(4.)
    call SetUnitMoveSpeed(udg_Boss,GetUnitDefaultMoveSpeed(udg_Boss)*0.6)
endfunction

//===========================================================================
function InitTrig_F22_Formation takes nothing returns nothing
    set gg_trg_F22_Formation = CreateTrigger()
    call TriggerAddCondition( gg_trg_F22_Formation, Condition( function F22MissionConditions ) )
    call TriggerAddAction( gg_trg_F22_Formation, function F22Mission )
endfunction</i></i></i></i>


I get the error for this line.
JASS:
call ForGroup(missiles,function RemoveUnitAll)


So the missles keep shooting and they dont get removed.

P.S I've got the udg_boss already set to a unit and ive already taken care of the event
 

ZakkWylde-

New Member
Reaction score
14
A bit unrelated (possibly), but could you post your [ljass]function RemoveUnitAll [/ljass]?
 

R 3 T R O

New Member
Reaction score
12
There isn't any.

That is all there is in the map just that one trigger. Its an Air strike spell that a close friend made a while back.

I tried to use it today and it does everything i want except i need to remove that line in order to play it.

But when i remove that line. the missle effect doesnt stop and i need to gone.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top