Genyuumaru
New Member
- Reaction score
- 15
I created a function to make a unit follow another unit (the default follow follows the unit 300 units away from it).
I created a trigger "Follow Function" and wrote the function there. It looks like this:
From another trigger I called the function like this:
I get an error "Expected a function name" in this line.
Any help?
Also: How to remove all leaks in situations like this one?
I created a trigger "Follow Function" and wrote the function there. It looks like this:
JASS:
function Follow takes unit u, unit u2 returns nothing
local location point1 = GetUnitLoc(u)
call IssuePointOrderLocBJ( u2, "move", point1)
call SetUnitMoveSpeed( u2, GetUnitMoveSpeed(u)+5)
set u = null
set u2 = null
call RemoveLocation(point1)
endfunction
function InitTrig_Follow_Function takes nothing returns nothing
endfunction
From another trigger I called the function like this:
JASS:
call TimerStart(t, 0.1 , true, function Follow (GetTriggerUnit(),GetLastCreatedUnit()))
I get an error "Expected a function name" in this line.
Any help?
Also: How to remove all leaks in situations like this one?