T
Tooters
Guest
So I am trying to make a loop, but it won't let me minus from a variable. Here is my code:
When I do this in JassCraft, it works fine, but when i uploaded it to my map and tried to save it, it said this syntax error: Line 562: Invalid argument type(rect). Please help. Thx
Code:
function combineArea1 takes integer playerOwner, integer combinee, integer howMany, integer newUnit returns nothing
local group J
local integer counter
call ForGroupBJ( GetUnitsInRectAll( gg_rct_Area_1_Combine ), function combineArea1 )
if IsUnitIdType( combinee, ConvertUnitType( GetUnitTypeId( GetEnumUnit() ) ) ) then
call GroupAddUnit( J, GetEnumUnit() )
set counter = CountUnitsInGroup( J )
if counter >= howMany then
loop
exitwhen ( howMany == 0 )
call GroupRemoveUnit( J, GroupPickRandomUnit( J ) )
call RemoveUnit( GetEnumUnit() )
set howMany = howMany - 1
endloop
call CreateUnitAtLoc( Player(playerOwner-1), newUnit, gg_rct_Area_1_Combine, 0.00 )
endif
endif
endfunction
When I do this in JassCraft, it works fine, but when i uploaded it to my map and tried to save it, it said this syntax error: Line 562: Invalid argument type(rect). Please help. Thx