| 04-05-2006, 11:48 PM | #1 |
how do you use game cache?, i heard it can store locals. |
| 04-06-2006, 12:06 AM | #2 |
I wouldn't say that "gamecache can store locals". Rather, gamecache can store pretty much any values you want to. It is a way to dynamically store and retreive variables. You can for example tell the gamecache to store an integer named "some_integer" and then later retreive it. If you make a global variable of type gamecache named "cache" then you can do the following (in jass, but the same functions exist for gui): //Store a value call StoreInteger(udg_cache, "some_category", "some_label", 100) //Retreive it set some_integer = GetStoredInteger(udg_cache, "some_category", "some_label") There is a lot of powerful things you can do with this kind of variable storage. It is for example possible to convert any object into a string so you can basically do: //NOT REAL CODE call StoreInteger(udg_cache, some_timer, "unit", some_unit) This is what is known as handle-vars or more accurately, attachable variables. The exact process of doing this has been explained elsewhere and you should seek it out on this forum if it interests you. Or, just ask any other specific questions, and someone will surely give you a good answer. |
| 04-06-2006, 11:59 AM | #3 |
Just a quick thing to note. For F3 you should research tables(Vex has a massive readme in the CS), this is because the map already has the tables present in the map(the generic damage and the shooting system). |
| 04-10-2006, 02:56 AM | #4 |
What about saving and loading? Saw some natives: SaveGameCacheBJ InitGameCacheBJ Do these save and load caches to disk? If so, can you load a cache that another map has saved? |
| 04-10-2006, 07:13 AM | #5 |
Yes, you can, that's how hero transfers work in blizz campaigns. You can only do it in single player, though. |
| 04-10-2006, 07:07 PM | #7 |
You can't load from gamecache in multiplayer. |
