#1
Jass Script Problem
Ok im not quite sure how to use the actions "call toforce" and set function parameters. Im pretty sure im making some stupid mistake, but as im fairly inexperienced in jass, i would appreciate any help. the error im getting in the quoted lines are "expected '"function random_hero takes rect selection returns
nothing
local player p = GetEnumPlayer()
local unit r = GroupPickRandomUnit(GetUnitsInRectOfPlayer(selection, Player(PLAYER_NEUTRAL_PASSIVE)))
if ( udg_Hero_Picking_Status[GetConvertedPlayerId(p)] == false ) then
set udg_Hero_Picking_Status[GetConvertedPlayerId(p)] = true
call SetUnitPositionLoc( r, GetPlayerStartLocationLoc(p) )
call SetUnitOwner( r, p, true )
call PanCameraToTimedLocForPlayer( p, GetUnitLoc(r), 0.50 )
set r = null
set p = null
else
endif
endfunction
function Trig_Hero_Selection_End_FuncRemoveUnit takes nothing returns nothing
call RemoveUnit( GetEnumUnit() )
endfunction
function Trig_Hero_Selection_End_Actions takes nothing returns nothing
call TriggerSleepAction( 1.00 )
call DestroyTimerDialogBJ( GetLastCreatedTimerDialogBJ() )
call ForForce( udg_Alliance, function random_hero (gg_rct_Allied_Region_Selection))
call ForForce( udg_Undead, function random_hero (gg_rct_Undead_Region_Selection))
call ForGroup( GetUnitsInRectAll(gg_rct_Allied_Region_Selection), function Trig_Hero_Selection_End_FuncRemoveUnit )
call ForGroup( GetUnitsInRectAll(gg_rct_Undead_Region_Selection), function Trig_Hero_Selection_End_FuncRemoveUnit )
call DestroyTrigger( gg_trg_Hero_Selection_1)
call DestroyTrigger( gg_trg_Hero_Selection_2)
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Hero_Selection_End takes nothing returns nothing
set gg_trg_Hero_Selection_End = CreateTrigger( )
call TriggerRegisterTimerExpireEventBJ( gg_trg_Hero_Selection_End, udg_Hero_Selection_Timer )
call TriggerAddAction( gg_trg_Hero_Selection_End, function Trig_Hero_Selection_End_Actions )
endfunction