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:
function GetBoomerangAxesGamecache takes nothing returns gamecache
return gg_trg_Boomerang_Axes
endfunction
but it seems it doesn't work.I made a test trigger:
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
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?
Vicky... isn't this a question for the JASS section? Perhaps you should try there as well. Some experts in JASS do not look here. I cannot help because... Heh, YOU taught me JASS.
yes it is for experts to JASS but this scritp is gonna fly over my trigger editor and PUFF here is my second spell!Get it?And now i just want to find the reason!But anyway i'll submit the topic in JASS too. But maybe The_Raven will move it to JASS forums i hope!
Tell me the way then!I won't try any of vexorians GetHandleHandle or SetHandleHandle functions!But i bet he done those with gamecaches.And he hides them in his Caster System!What a fox.is this the code?:
function Unit takes handle h returns unit
return h
endfunction
I found out that the problem was in my trigger and i didn't created the gamecache!In otherwords i forgot to set gg_trg_Try2 to an gamecache.Thx anyway arscine!For telling me the easyer way for storing the unit!