Hi There is a couple of examples and tips about usage of HashTable Object.
* Sometimes you asked, how to create dynamic vars or local vars, well there is a way to do that. Right with hashtable object.
The first you need will be an Function object, obviously from where to call your routines and where to put the local vars.
At start of your 'on function' condition, using the 'Checks if exist key' condition but negated, you ensure the new var or 'key' isn't being used, once this checks availability, then create the new var with 'insert key' action, giving name and initial value. Afterwards you may use your local as you desire.
At the end of the function, if you dont like save locals then use the 'delete all keys' action to clear the locals Hashtable.
Picture below shows how looks the event sheet.
<img src="http://dl.dropbox.com/u/74660811/Tutoriales/hashtables/hashtable1.png" border="0">
This is useful when you don't desire to have a lot of globals.
* Other particular usage for hashtables what i recently applied is, when trying to do a techtree system. this is a cheaper techtree system what i designed, using hastable.
Well, first i do need is to clearify my concept about techtree. this is, techtree i could define it as a set of abilities or skills inside the game those player gets access when reached some requirements, lets see the example below:
<img src="http://dl.dropbox.com/u/74660811/Tutoriales/hashtables/techtree_example.png" border="0">
In the picture you may notice my idea of a techtree, in that sense, we could say, experienced skill needs medium skill 1 at level 4 and medium skill 3 at level 2, in order to player gets access to that skill.
Well, we may define for each skill, item or key a 'key' inside the hashtable, in this case i called it 'Playerdata' the hashtable, too i stored a key with the name list of each skills this with access purpose later. We'll need too an extra 'key' for requirements for each skill 'key'
Next, we need a function to call for check the techtree, every time a new skill is granted we need to check for the techtree unlocks, lets see the event sheet to try better understanding.
<img src="http://dl.dropbox.com/u/74660811/Tutoriales/hashtables/techtree_example_eventsheet01.png" border="0">
<img src="http://dl.dropbox.com/u/74660811/Tutoriales/hashtables/techtree_example_eventsheet02.png" border="0">
I espect this be useful... any question post it
EDIT: After some fixing here is the .cap if you want give it a try... get fun.