I'm trying to setup a global function in the map editor, to be used by 4 different triggers.
The Unit_Pauser is the function I am trying to make accessible by all 4 triggers, but the map editor is being a pain in the ass.
I've resorted to giving each trigger their own unit pauser, which is something I did not want to do.
"Expected a function name" is the error thrown
My second problem, is the very same code
This was my original attempt to make this more efficient than what the GUI editor gave me. But it threw some errors.
The error given was "Expected a reserved type or handle type"
for the line "local rect placement"
Any help is appreciated
The Unit_Pauser is the function I am trying to make accessible by all 4 triggers, but the map editor is being a pain in the ass.
I've resorted to giving each trigger their own unit pauser, which is something I did not want to do.
JASS:
function Trig_Night_Elf_Unit_Selection_Conditions takes nothing returns boolean
return GetUnitTypeId(GetAttacker()) == 'ewsp'
endfunction
function Unit_Pauser4 takes nothing returns nothing
call PauseUnitBJ( true, GetEnumUnit() )
endfunction
function Trig_Night_Elf_Unit_Selection_Actions takes nothing returns nothing
local unit attacker = GetAttacker()
local unit attacked = GetTriggerUnit()
if(udg_Selects[3]) then
call CreateNUnitsAtLoc( 10, GetUnitTypeId(attacked), GetOwningPlayer(attacker), GetRectCenter(gg_rct_Nelf_Show), bj_UNIT_FACING )
call ForGroupBJ(GetUnitsInRectAll(gg_rct_Nelf_Show), function Unit_Pauser4)
else
call CreateNUnitsAtLoc( 10, GetUnitTypeId(attacked), GetOwningPlayer(attacker), GetRectCenter(gg_rct_Nelf_Hidden), bj_UNIT_FACING )
call ForGroupBJ(GetUnitsInRectAll(gg_rct_Nelf_Hidden), function Unit_Pauser4)
endif
set udg_UnitsLeft[3] = ( udg_UnitsLeft[3] + 10 )
set udg_Selects[3] = not( udg_Selects[3] )
call KillUnit( attacked )
call KillUnit( attacker )
set attacker = null
set attacked = null
endfunction
"Expected a function name" is the error thrown
My second problem, is the very same code
This was my original attempt to make this more efficient than what the GUI editor gave me. But it threw some errors.
JASS:
local unit attacker = GetAttacker()
local unit attacked = GetTriggerUnit()
local rect placement //local region placement was also tried, same error
if(udg_Selects[3]) then
placement = gg_rct_Nelf_Hidden
else
placement = gg_rct_Nelf_Show
endif
call CreateNUnitsAtLoc( 10, GetUnitTypeId(attacked), GetOwningPlayer(attacker), GetRectCenter(placement), bj_UNIT_FACING )
call ForGroupBJ(GetUnitsInRectAll(placement), function Unit_Pauser4)
set udg_UnitsLeft[3] = ( udg_UnitsLeft[3] + 10 )
set udg_Selects[3] = not( udg_Selects[3] )
call KillUnit( attacked )
call KillUnit( attacker )
set attacker = null
set attacked = null
endfunction
The error given was "Expected a reserved type or handle type"
for the line "local rect placement"
Any help is appreciated