- Joined
- Aug 27, 2004
- Messages
- 471
Ok, i am geeting FED UP with wc3's jass compiler.
I have some nice, well written, easy to understand jass blowback trigger, that fires whenever a footmen attacks:
I get 3 errors:
line 26 - Invalid type for specified operator.
line 35 - Expected a name
line 37 - Expected a name
I am so tired, did i miss something obvious? So confused... What is wrong gaahhhh! HELP ME AHHH .
Tanks for your help in advanced, modeler .
I have some nice, well written, easy to understand jass blowback trigger, that fires whenever a footmen attacks:
JASS:
function c_001 takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'hfoo' ) ) then
return false
endif
return true
endfunction
function k_001 takes unit target, real bbspeed, unit cast returns nothing
local location castpo = GetUnitLoc(cast)
local location targetpo = GetUnitLoc(target)
call SetUnitPositionLoc(target, PolarProjectionBJ(castpo, DistanceBetweenPoints(castpo, targetpo+10), AngleBetweenPoints(castpo, targetpo)))
call RemoveLocation(castpo)
call RemoveLocation(targetpo)
endfunction
function s_001 takes nothing returns nothing
local timer t1
local unit cast
local unit target
set cast = GetAbilityUnit()
set target = GetSpellTargetUnit()
set t1 = CreateTimer(t, 0.03, true, function k_001(target, 6.00, cast)
call TriggerSleepAction(0.30)
call DestroyTimer(t1)
set cast = null
set target = null
set t1 = null
endfunction
function InitTrig_trigger takes nothing returns nothing
local trigger t
set t= CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(t, Condition(function c_001))
call TriggerAddAction(t, function s_001)
endfunction
I get 3 errors:
line 26 - Invalid type for specified operator.
line 35 - Expected a name
line 37 - Expected a name
I am so tired, did i miss something obvious? So confused... What is wrong gaahhhh! HELP ME AHHH .
Tanks for your help in advanced, modeler .