HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

JASS game cache?

05-06-2007, 12:45 AM#1
waaaks
im having trouble on making advance JASS spells, because im stuck at basic JASS, thats why i want to know how game cache works, and used in spells

i really dont understand using game cache in JASS, and if i can find one tutorial about using game cache on JASS, then ill never slepp, lol

can anyone give me an example on using game cache on spells?

+rep for any help
05-06-2007, 01:09 AM#2
MaD[Lion]
i will try keep it simple
Game cache is a way to save/store data, but instead of array which you already know , every game cache has 2 levels/dimensions of index instead of 1.
Dimension or level means the amount of index you can have for it.
example with array:
set variable[0] = something
array has 1 index because it only alows array[0],array[1],array[2]... ect
you can only change 1 index.
But for gamecache:
call StoreReal(gamecache,"1","2",12.52)
here you see im storing value 12.52 into variable gamecache with 2 dimensions. To make it look like array it will be like this (this is not valid, just an example):
gamecache["1"]["2"]=12.52
you may ask why i put "1" and "2", well because gamecache use string instead of integer for indexes.
this way you can for example make level setup like this:
Collapse JASS:
call StoreInteger(gamecache,"level1","UnitType",'hpea')
call StoreInteger(gamecache,"level1","Amount",12)
call StoreBoolean(gamecache,"level1","Boss",false)
//---
call StoreInteger(gamecache,"level2","UnitType",'hfoo')
call StoreInteger(gamecache,"level2","Amount",10)
call StoreBoolean(gamecache,"level2","Boss",false)
//ect...

This is not relevant with spells, but the idea is because with game cache you can link different things with eachother. And linking is what makes it so powerful.
example:
Collapse JASS:
local unit Father = CreateUnit(....) //just lazy to write all parameters
local group Children = CreateGroup()
call StoreInteger(gamecache,"Link children to their father",I2S(Unit2Integer(Father)),I2S(Group2Integer(Children)))
this way we can get the unit group called Children by knowing the unit Father.
Group2Integer is just converstion from group to integer, it is not in warcraft 3 but you can make it easily.
Same with Unit2Integer.

And since we know the childrens, we can example make a Unit with children ability, where he spawns other units and these units should be added to this group called Children. This way we can control different children group for different father unit.

also one last thing: you must create a game cache first, before you can use game cache.
u can create it by using this native/function:
local gamecache gc = InitGameCache("anything")
05-06-2007, 01:55 AM#3
Ammorth
Take a look at CSCache (Within the caster system found in the resource section). It has all the automated functions ready for use, but requires JASS New Gen Pack (also found in the resource section).
05-06-2007, 03:08 AM#4
MaD[Lion]
jass new gen pack allow things that isnt alloed in normal pack. But if you use jass new gen pack, then i suggest you use structs, they are alot faster than gamecache.
Struct are simply arrays, but many arrays so it will allow linking like game cache.
05-06-2007, 04:43 AM#5
waaaks
but the problem is, if i open JASS new gen pack editor, an error message appear saying be sure your wc3 has a link to ur wc3 CD

how about the game cache engine?
is that good enough?

sorry guys but i cant +rep you, cause i need to spread more reps before i can +rep u, maybe next time if i can +rep you then ill give it...

thanks a lot...
05-06-2007, 04:58 AM#6
MaD[Lion]
no worries about rep, i nearly never rep anyone or get rep :P
Thing is just im not used to click on rep button :D

Also the game cache system in Vexorian's Spell System is very useful. Or you can just use his spell system to make any kind of spells :P

But if you want to learn game cache. Then there are tutorials in tutorial section i think. Else my short tutorial above also says some important things about game cache.
05-06-2007, 09:23 AM#7
waaaks
well i cant implement CScache system from vex because my JASS new gen pack is bugged, like when i opened JASS new gen pack then an error message appears

i really like caster system, because some functions are short but effective
but still cant implement it

is there any other way to solve this even without JASS new gen pack?

or maybe ill stick to handle vars system?
05-06-2007, 09:55 AM#8
Av3n
Maybe is your Wc3 cracked?

-Av3n
05-06-2007, 06:38 PM#9
MaD[Lion]
you are not asking to solve a problem, but ure asking how to use game cache, i already told u how
05-07-2007, 04:00 AM#10
Av3n
Quote:
Originally Posted by waaaks
well i cant implement CScache system from vex because my JASS new gen pack is bugged, like when i opened JASS new gen pack then an error message appears

i really like caster system, because some functions are short but effective
but still cant implement it

is there any other way to solve this even without JASS new gen pack?

or maybe ill stick to handle vars system?

Wait sorry i was referring to this lion

-Av3n