Hello everybody, I'm new to Jass (I'll admit that upfront), and I've run into a bit of a problem when coding my TD. I'm looking for a way to modify max health of some spawned units, and figured that I could use SetUnitState to do it, but I'm getting the error "Expected a name" when I attempt to enable the trigger containing the code. Here's the code... see anything wrong?
JASS:
function Trig_Unit_Create_Func003002 takes nothing returns nothing
call SetUnitLifeBJ( GetEnumUnit(), udg_MonsterLife )
call SetUnitState( GetEnumUnit(), UNIT_STATE_MAX_LIFE, udg_MonsterHealth)
endfunction
function Trig_Unit_Create_Func005002 takes nothing returns nothing
call SetUnitLifeBJ( GetEnumUnit(), udg_MonsterLife )
call SetUnitState( GetEnumUnit(), UNIT_STATE_MAX_LIFE, udg_MonsterHealth)
endfunction
function Trig_Unit_Create_Func007002 takes nothing returns nothing
call SetUnitLifeBJ( GetEnumUnit(), udg_MonsterLife )
call SetUnitState( GetEnumUnit(), UNIT_STATE_MAX_LIFE, udg_MonsterHealth)
endfunction
function Trig_Unit_Create_Func009002 takes nothing returns nothing
call SetUnitLifeBJ( GetEnumUnit(), udg_MonsterLife )
call SetUnitState( GetEnumUnit(), UNIT_STATE_MAX_LIFE, udg_MonsterHealth)
endfunction
function Trig_Unit_Create_Func011002 takes nothing returns nothing
call SetUnitLifeBJ( GetEnumUnit(), udg_MonsterLife )
call SetUnitState( GetEnumUnit(), UNIT_STATE_MAX_LIFE, udg_MonsterHealth)
endfunction
function Trig_Unit_Create_Func013002 takes nothing returns nothing
call SetUnitLifeBJ( GetEnumUnit(), udg_MonsterLife )
call SetUnitState( GetEnumUnit(), UNIT_STATE_MAX_LIFE, udg_MonsterHealth)
endfunction
//-------------------------------------------------------------
function Trig_Unit_Create_Actions takes nothing returns nothing
call CreateNUnitsAtLoc( 10, udg_MonsterType, Player(7), GetRectCenter(gg_rct_Spawn_1), bj_UNIT_FACING )
call ForGroupBJ( GetUnitsInRectOfPlayer(gg_rct_Spawn_1, Player(7)), function Trig_Unit_Create_Func003002 )
call CreateNUnitsAtLoc( 10, udg_MonsterType, Player(8), GetRectCenter(gg_rct_Spawn_2), bj_UNIT_FACING )
call ForGroupBJ( GetUnitsInRectOfPlayer(gg_rct_Spawn_2, Player(8)), function Trig_Unit_Create_Func005002 )
call CreateNUnitsAtLoc( 10, udg_MonsterType, Player(9), GetRectCenter(gg_rct_Spawn_3), bj_UNIT_FACING )
call ForGroupBJ( GetUnitsInRectOfPlayer(gg_rct_Spawn_3, Player(9)), function Trig_Unit_Create_Func007002 )
call CreateNUnitsAtLoc( 10, udg_MonsterType, Player(10), GetRectCenter(gg_rct_Spawn_3), bj_UNIT_FACING )
call ForGroupBJ( GetUnitsInRectOfPlayer(gg_rct_Spawn_4, Player(10)), function Trig_Unit_Create_Func009002 )
call CreateNUnitsAtLoc( 10, udg_MonsterType, Player(11), GetRectCenter(gg_rct_Spawn_3), bj_UNIT_FACING )
call ForGroupBJ( GetUnitsInRectOfPlayer(gg_rct_Spawn_5, Player(11)), function Trig_Unit_Create_Func011002 )
call CreateNUnitsAtLoc( 10, udg_MonsterType, Player(12), GetRectCenter(gg_rct_Spawn_3), bj_UNIT_FACING )
call ForGroupBJ( GetUnitsInRectOfPlayer(gg_rct_Spawn_6, Player(12)), function Trig_Unit_Create_Func013002 )
endfunction
//===========================================================================
function InitTrig_Unit_Create takes nothing returns nothing
set gg_trg_Unit_Create = CreateTrigger( )
call TriggerRegisterTimerExpireEventBJ( gg_trg_Unit_Create, udg_WaveTimer )
call TriggerAddAction( gg_trg_Unit_Create, function Trig_Unit_Create_Actions )
endfunction