- Joined
- Sep 9, 2004
- Messages
- 152
Here is the problem:I maded a trigger that activates a trigger with timer event.I noticed that i can't use the local unit in the main function so i tryed the gamecache.I tryed Darkys way for init gamecache:
but it seems it doesn't work.I made a test trigger:
It seems it does't restore the unit or it neither use it the function.Where i'm wrong?Did i understood Darkys trigger wrong?Can someone solve my problem?
JASS:
function GetBoomerangAxesGamecache takes nothing returns gamecache
return gg_trg_Boomerang_Axes
endfunction
JASS:
function GetTry2GameCache takes nothing returns gamecache
return gg_trg_Try2
return null
endfunction
function Unit takes nothing returns unit
return RestoreUnitLocFacingAngleBJ("Unit","Unit",GetTry2GameCache(),Player(0),GetCameraTargetPositionLoc(),0.00)
endfunction
function T takes nothing returns nothing
local unit u=Unit()
local trigger t=GetTriggeringTrigger()
call AddSpecialEffectLocBJ( PolarProjectionBJ(GetUnitLoc(u),4*I2R(ModuloInteger(GetTriggerEvalCount(t),100)),2*I2R(GetTriggerEvalCount(t))), "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
endfunction
function Trig_Try2_Actions takes nothing returns nothing
local gamecache g=GetTry2GameCache()
local trigger t=CreateTrigger()
local unit u
set u=CreateUnitAtLoc(Player(0),'hfoo',GetCameraTargetPositionLoc(),0.00)
call StoreUnitBJ(u,"Unit","Unit",g)
call KillUnit(u)
call TriggerRegisterTimerEventPeriodic(t,0.05)
call TriggerAddAction(t,function T)
endfunction