- Joined
- Apr 27, 2008
- Messages
- 2,455
My question is for the good old game cache usage (not to transfer datas between maps)
I had never really used them but i'm wondering why people always do :
Instead of directly :
For me, it's to avoid datas conflits in the case of a campaign, but if it isn't a campaign that seems 100 % useless.
Ofc that doesn't matter that much, just because it's only one more line, and it's not like you can seriously use game caches dynamically, coz of the hardcoded 256 limit.
For example, this works as expected in a not campaign map (always display "0" and then "1") :
I'm 99 % sure it's only for campaigns, but who knows maybe there are some hocus pocus bug to know.
I had never really used them but i'm wondering why people always do :
JASS:
call FlushGameCache(InitGameCache("myCache"))
set myCache = InitGameCache("myCache")
Instead of directly :
JASS:
set myCache = InitGameCache("myCache")
For me, it's to avoid datas conflits in the case of a campaign, but if it isn't a campaign that seems 100 % useless.
Ofc that doesn't matter that much, just because it's only one more line, and it's not like you can seriously use game caches dynamically, coz of the hardcoded 256 limit.
For example, this works as expected in a not campaign map (always display "0" and then "1") :
JASS:
scope Test initializer init
private function init takes nothing returns nothing
local gamecache gc = InitGameCache("myCache")
call BJDebugMsg(I2S(LoadInteger(gc,"0","0")))
call StoreInteger(gc,"0","0",1)
call BJDebugMsg(I2S(LoadInteger(gc,"0","0")))
endfunction
endscope
I'm 99 % sure it's only for campaigns, but who knows maybe there are some hocus pocus bug to know.