Playmaker Forum
PlayMaker Feedback => Action Requests => Topic started by: westingtyler on November 19, 2018, 07:19:42 PM
-
Hash Table Get By Index (Not Key)
Has Table Get only allows by Key it seems, but I want to get them by a specific Int Index.
-
Hi,
hashtable doesn't work with indexes by design ( it doesn't maintain indexing at all), so for hashtable you must use key.
in your case, the key could be an string of an int, that's fine.
Bye,
Jean
-
is that why when I go into play mode, all the hashed things gets scrambled and is no longer alphabetized?
-
Hi,
yep :)
Bye,
Jean
-
Is there an action to "Sort Hash Table alphabetically"? If not, I'd like to request that action. It would be very helpful for the Get Next in Hash action thing.
It would also be great to have an action to add all the keys of a hash table, to an fsm string array. would that be possible?
Also, an editor script, like under Tools, or something, that would sort the hash entries alphabetically would be super helpful in editor mode.
Also, how many keys can a Hash have before performance problems? is 500 keys too much?
-
Hi,
The only way to sort hash is to extract the keys into an arraylist or FsmArray, then sort that array and iterate through that list instead of the hashtable, this way you can enforce order.
Edit mode hashtable sorting would be great yes, I agree.
you can go crazy with volume, I ran tests with hundreds or thousands entries and it's fine, both for arraylist and hashtable, of course it depends what you do with it, it you plan on iterate through each, then that's a no go... or you have to make it asynchronous with a progress bar, etc etc, which is possible.
Bye,
Jean