HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Global gamecache ruining the spell?

05-25-2007, 06:34 AM#1
IKilledKenny
Hello, I have a quick question, why when using KaTTaNa's local handle system this works:

Collapse JASS:
function LocalVars takes nothing returns gamecache
    return InitGameCache("jasslocalvars.w3v")
endfunction

while this doesn't and ruins the whole spell:

Collapse JASS:
function LocalVars takes nothing returns gamecache
    return udg_FearGameCache
endfunction

It is the only thing that I changed that caused this not to work why??

Thanks
05-25-2007, 06:36 AM#2
grim001
You need to create a gamecache in that global var on map init
05-25-2007, 06:51 AM#3
IKilledKenny
I created a variable in the variable editor called like that... Should I do anything else? I thought create the variable was enough?
05-25-2007, 07:00 AM#4
Jazradel
You actually need to create the variable. Something like:
set udg_FearGameCache = InitGameCache("jasslocalvars.w3v")
Should do it.
05-25-2007, 07:02 AM#5
IKilledKenny
Like this?

Collapse JASS:
function LocalVars takes nothing returns gamecache
   set udg_FearGameCache = InitGameCache("jasslocalvars.w3v")
    return udg_FearGameCache
endfunction
05-25-2007, 08:32 AM#6
Anitarf
No, you should do it in an initialization function, not every time you call LocalVars.
05-25-2007, 10:20 AM#7
Silvenon
Yeah, make a trigger that fires on map initialization and put set udg_FearGameCache = InitGameCache("jasslocalvars.w3v") in it