HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Parameters in action functions?

09-19-2004, 04:49 PM#1
-={tWiStÄr}=-
Code:
function t_actions takes unit whichUnit returns nothing
	call SetTextTagPosUnit(GetLastCreatedTextTag(), whichUnit, 0)
endfunction
function tagdebug takes unit whichUnit returns nothing
	local trigger t = CreateTrigger()
	call CreateTextTagLocBJ("hi", GetUnitLoc(whichUnit), 0, 10, 0, 0, 0, 0)
	call TriggerRegisterTimerEventPeriodic(t, 1)
	call TriggerAddAction(t, function t_actions(whichUnit))
endfunction
thats a function in my header because i wanna be able to make a texttag follow a given unit to make sure it is stored under the var (i think CreateTextTagUnitBJ may do this, but thats not working)
but my question is about
call TriggerAddAction(t, function t_actions(whichUnit))
for the second function (t_actions) to function it requires which unit to move the texttag to. but, it doesnt like me passing parameters into the actions. is there a way to do this without using globals?
edit: oh yeah, and if this whole thing is a total waste of time, still tell me how the parameter thing works for future knowledge
09-19-2004, 05:20 PM#2
curi
I believe u need a global or gamecache. but u can use a blizzard.j global and then set it back to what it was, if you like (for better portability).