HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

game cache

11-04-2007, 10:01 PM#1
MaD[Lion]
i wanna link unit to trigger with game cache, so i did. but then there are no GetStoredUnit ... Only restore unit, but wont this restore native create a new unit? if so then tats lame...
11-04-2007, 10:05 PM#2
Vexorian
StoreUnit stores... the unit. Not a pointer to the unit.
11-04-2007, 10:06 PM#3
cohadar
When will you people learn that gamecache sux balls.

The ONLY place you should be using gamecache is to make save/load code.
11-04-2007, 10:11 PM#4
Vexorian
I still can't think of a better string hashing alternative.
11-04-2007, 10:16 PM#5
cohadar
What is string hashing?
Or to express myself better: why would anyone need that?
11-04-2007, 10:57 PM#6
inkken
Quote:
Originally Posted by MaD[Lion]
i wanna link unit to trigger with game cache, so i did. but then there are no GetStoredUnit ... Only restore unit, but wont this restore native create a new unit? if so then tats lame...

You'll have to make the GetStoredUnit function yourself...
Here is the one i use:

Collapse JASS:
function I2U takes integer i returns unit
return i
return 0
endfunction

Just remember when storing the unit... store it as an integer using H2I (<unit>). This function should go in the map header.

---
Here is a simple example:
Expand JASS:

Not a very good example to display the powerful capabilities of the gamecache. The gamecache capabilities becomes apparent, if not valuable, for ForGroup, ForForce, boolexpr, code, and countless other instances - since those function has to take nothing.

I like the gamecache since i can assign a name for a handle. I can also store multiple different handle into the a single cache i.e. a unit, a timer, a unitstate.
11-05-2007, 12:36 AM#7
MaD[Lion]
well game cache sux then :P cus i dont wanna use I2H, tat is just not safe. So i will use array to check instead.
i blame Anitarf for telling me to use GC, cus he said i dont need I2H for this kind of linking... but seems like i do.

Damn time wasted :P
Vex u got msn? i need u to be the law book of jass when i have question. I promise i wont disturb u alot
11-05-2007, 06:30 AM#8
cohadar
Quote:
Originally Posted by MaD[Lion]
Vex u got msn? i need u to be the law book of jass when i have question. I promise i wont disturb u alot

be scared Vex, be scared....
11-05-2007, 03:42 PM#9
Captain Griffen
You don't need I2H. Ever. If you do, find another way.

EDIT: Even using GC. GC ain't too bad for attaching structs to stuff.
11-05-2007, 05:30 PM#10
MaD[Lion]
ye attaching struct solved it. How dumb i must be to not think of that :P
All problems solved then :)
rep to anitarf :P
11-06-2007, 02:50 AM#11
Vexorian
Quote:
Originally Posted by MaD[Lion]
well game cache sux then :P cus i dont wanna use I2H, tat is just not safe. So i will use array to check instead.
i blame Anitarf for telling me to use GC, cus he said i dont need I2H for this kind of linking... but seems like i do.

Damn time wasted :P
Vex u got msn? i need u to be the law book of jass when i have question. I promise i wont disturb u alot
The only times "vexorian" and MSN appear in the same sentence also include a "does not have" inside of it.
11-06-2007, 07:42 AM#12
cohadar
Quote:
Originally Posted by MaD[Lion]
ye attaching struct solved it. How dumb i must be to not think of that :P
All problems solved then :)
rep to anitarf :P

...and if you used ABC you would not have to be dumb because you would be attaching structs by default :P
11-06-2007, 08:19 AM#13
Toink
Your hate for gamecache is ridiculous. I'm starting to think you just say those things to make yourself look like a pro. Sure being slow is kind of bad, but why the hell would anyone need things to be done faster than the speed of light. If it lags, then get an effing new pc. If you're worried about there only being up to 30 bouncing balls for a good pc, then that's because the game itself wasn't made for those shit. This is an RTS not an FPS.

It's like trying to make a house with clay.
11-06-2007, 08:45 AM#14
cohadar
LoooL being faster is the least important on the list of reasons ABC is better than gamecache.
Try and read the ABC thread mmkaaay.

And if ABC is making a house with clay,
gamecache is making a house with horseshit.
11-06-2007, 08:48 PM#15
TheDamien
There is no faster alternative to gamecache when it comes to mapping strings to values.

Quote:
Originally Posted by cohadar
LoooL being faster is the least important on the list of reasons ABC is better than gamecache.

What are the other advantages? It seems to me speed is the only reason someone would go for ABC instead of gamecache.