Hashtables

Setharoth114

New Member
Reaction score
5
Just a quick question: What is a hashtable and what does it do? Could never figure it out. Always reminds me of hashbrowns >.<
 

Ayanami

칼리
Reaction score
288
This is the definition that I searched on the web.

In computer science, a hash table or hash map is a data structure that uses a hash function to efficiently map certain identifiers or keys (e.g., person names) to associated values (e.g., their telephone numbers)...

It's similar in the World Editor. Basically, you can imagine a hashtable like a big table to store values such as real, integer, units, groups, points, strings, etc. Then there are 2 "keys" in a hashtable. "Keys" are like sub groups. The Parent Key is something like a group in a hashtable. A child key is like another group inside the parent key. Thus, you can efficiently store values in a 2D manner rather using a 1D array, which normal variables offer.

Just imagine a basic flow chart. It originally belongs to 1 big section. Then, the parent keys are the next branch. Then, the child keys are the sub branches of the parent key. Here's a rough pictorial example.

hashtable.jpg


Just imagine hashtables this way.
 

Bogrim

y hello thar
Reaction score
154
A hashtable is a way to store data by catalog. Much like you have folders on your computer, a hashtable allows you to create a system for data retrieval. Hashtables access these "folders" through keys (integer values or strings).

Think of the Hashtable as your computer.
Thnk of a key as the name of your folder.
"of 0" is the primary folder.
"as 0" is the subfolder.

Trigger:
  • Hashtable
    • Of 0
      • As 0

An example of values a hashtable might store:
Trigger:
  • Hashtable
    • Of (Key: Unit ID)
      • As Real Value Damage
      • As Integer Value Duration
    • Of (Key: Unit ID)
      • As Real Value Damage
      • As Integer Value Duration


There is a complete tutorial here: http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/hashtables-mui-133407/
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top