Think of Table as an integer array. However, while a normal integer array can only use indexes 0 - 8191, Table can use any integer (even negatives). If you define the table as local, it acts just like a local integer array. If you define it as global, it acts like a global integer array.

So, under 'normal' circumstances, a local Table, and a single key should do fine?

Would there be any problem with using the same key in separate triggers, if t is local to each?

It doesn't matter if it's a local or global variable. What matters is that whenever you call Table.create() that gives you a new associative array, so if you create two tables in two triggers (or in one, doesn't matter) and set them to two different variables (global or local, doesn't matter) data stored to one or the other won't conflict.

All right I updated it, it is less pure but a little better, something like this requires to cover all gamecache usage else it is not a good idea to implement it along with other gamecaches, the difference is that you can use HandleTable and StringTable to have tables with different key types.

But anyway: I think that you should add a "RealTable" to this, as it is potentially useful to others, let alone myself.

__________________

Quote:

Originally posted by Rising_DuskYour spells are mostly ignored because they are not very cool so we aren't very excited to review/approve them, but you are incredibly persistent and won't give us an excuse to graveyard it. That is generally what results in a resource being ignored for a long time.

Originally posted by Kyrbi0Huh. Almost makes me wish I had a girlfriend, to take advantage of today (wait, no, that's not what I meant... I mean, take advantage of the fact that it is international women's day... gah, never mind).

Quote:

Originally posted by PyrogasmRome may not have been built in a day, but the Romans sure as hell didn't say "look at this great city we built guys!" when they had nothing more than a bit of stone and some cottages.

Originally posted by Rising_DuskYour spells are mostly ignored because they are not very cool so we aren't very excited to review/approve them, but you are incredibly persistent and won't give us an excuse to graveyard it. That is generally what results in a resource being ignored for a long time.

Originally posted by Kyrbi0Huh. Almost makes me wish I had a girlfriend, to take advantage of today (wait, no, that's not what I meant... I mean, take advantage of the fact that it is international women's day... gah, never mind).

Quote:

Originally posted by PyrogasmRome may not have been built in a day, but the Romans sure as hell didn't say "look at this great city we built guys!" when they had nothing more than a bit of stone and some cottages.

I wanted to use it for storing the widths of chars, and storing as an integer and dividing by some constant seemed like a waste of over-head.

I had the exact same situation when converting the subtitle engine of my cinematic system into a stand-alone library, I saw no problem in just storing integers; the gamecache use alone makes division by a constant insignificant, especially if you don't do it for every character but only for the final sum of widths. There is really no need for a real table.