1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  4. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  5. Units have been turned into heroes in our latest Icon Contest! Vote for the best icon set at the Icon Contest #18 Poll!
    Dismiss Notice
  6. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  7. The raddest synthwave tracks were chosen - Check out our Music Contest #12 - Results and congratulate the winners!
    Dismiss Notice
  8. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

A Complete Beginners Guide to Hashtables

Discussion in 'Trigger (GUI) Editor Tutorials' started by Jazztastic, Jun 15, 2011.

  1. Jazztastic

    Jazztastic

    Joined:
    Apr 4, 2011
    Messages:
    895
    Resources:
    7
    Spells:
    6
    Tutorials:
    1
    Resources:
    7
    If you have touched battle.net you can almost definitely use hashtables. On top of that, if you don't have the same version as the pre-1.24v you can't even play LAN together, so just get the idiot to update.

    Both are viable options for spell creating. Dynamic indexing is about 8x faster than hashtables, but I find hashtables to be more readable. Really it depends on the user. You don't have to use hashtables if they aren't appealing to you, but don't make a stupid post on my tutorial just flat out saying never to use them because they're just stupid, they aren't stupid. To edit any spell using hashtables (of which there are many), you will need to understand hashtables. Also some jobs call for the right tools; every simple system I've written have been way, way easier to write in hashtables, for me at least. It's just the way my brain is wired.
     
  2. shadowvzs

    shadowvzs

    Joined:
    Nov 13, 2006
    Messages:
    1,803
    Resources:
    2
    Spells:
    2
    Resources:
    2
    i can save a complect item into harshtable with item handle? example in multiboard inventory i can save my armor to player number/equipment number to itemtable and later load for check if if i have armor or no?
    example if i want load 1 1 from myitem table and its dont was declared then i get error or something false/no item/0?
     
  3. SweetestMan

    SweetestMan

    Joined:
    Apr 29, 2012
    Messages:
    11
    Resources:
    0
    Resources:
    0
    how can you have the "loop-actions" thingy?
     
  4. HammerFist132

    HammerFist132

    Joined:
    Mar 22, 2012
    Messages:
    1,314
    Resources:
    17
    Models:
    11
    Icons:
    2
    Maps:
    2
    Spells:
    2
    Resources:
    17
    Dude what to tell u except thx. I was always confused with hash things xD. This made me everthing clear Thatk's approve it and +rep
     
  5. toanlove371

    toanlove371

    Joined:
    Oct 25, 2011
    Messages:
    12
    Resources:
    0
    Resources:
    0
    good tutorial !
     
  6. Blackair

    Blackair

    Joined:
    Aug 18, 2011
    Messages:
    74
    Resources:
    0
    Resources:
    0
    That was a great tutorial thank you ,almost i understand about hashtables
    but there is a question about the two integers called Key in hashtables can a handle with same key be overwritten ??
     
  7. Troll-Brain

    Troll-Brain

    Joined:
    Apr 27, 2008
    Messages:
    2,372
    Resources:
    1
    JASS:
    1
    Resources:
    1
    https://www.hiveworkshop.com/posts/2148165/

    So yes it will be overwritten if you use 2 handle with the same keys, even if it's 2 different types of handles like an unit and an item.
     
  8. Sunchips

    Sunchips

    Joined:
    Jul 23, 2009
    Messages:
    872
    Resources:
    123
    Models:
    112
    Icons:
    4
    Packs:
    7
    Resources:
    123
    • Events
    • Unit - A unit Starts the effect of an ability
    • Conditions
    • (Ability being cast) Equal to Damage Over Time
    • Actions
    • Set EX_Target = (Target unit of ability being cast)
    • Set EX_Damage = 20.00
    • Set EX_Timer = 5.00
    • Unit Group - Add (Target unit of ability being cast) to EX_Group
    • Hashtable - Save EX_Timer as 1 of (Key (Target unit of ability being cast)) in EX_Hash


    When I try to follow you I can't find out how to use (Key (Target unit of ability being cast)) in EX_Hash
     
  9. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,427
    Resources:
    18
    Icons:
    1
    Spells:
    4
    Tutorials:
    9
    JASS:
    4
    Resources:
    18
  10. Sunchips

    Sunchips

    Joined:
    Jul 23, 2009
    Messages:
    872
    Resources:
    123
    Models:
    112
    Icons:
    4
    Packs:
    7
    Resources:
    123
  11. ExecutorWar

    ExecutorWar

    Joined:
    Nov 11, 2012
    Messages:
    112
    Resources:
    0
    Resources:
    0
    heya! i'm a noob out here. even though i'm not familar with hashtables, i understand some of the lines but i dont know how to make those by myself. Can you suggest me guys where to start in making GUIs?
     
  12. GOGBLITZ

    GOGBLITZ

    Joined:
    Nov 23, 2012
    Messages:
    1
    Resources:
    0
    Resources:
    0
    brain bleeds......
     
  13. Hankxiety

    Hankxiety

    Joined:
    Sep 1, 2018
    Messages:
    13
    Resources:
    0
    Resources:
    0
    Thanks for this. Hashtables were used in a solution to a problem I posted in Triggers & Scripts, so I needed to figure out what they were.

    Your tutorial gave me foundational knowledge, which helped me understand the solution provided and then further manipulate the trigger on my own.

    My thread: [Trigger] - Garrison into neutral building and change ownership
     
  14. CarlosCepinha

    CarlosCepinha

    Joined:
    Mar 1, 2018
    Messages:
    30
    Resources:
    0
    Resources:
    0
    I'm sorry to bother, but when I want to save "value" of "value" of "value" in "hashtable" and I have imported triggers, I see a function like (triggering unit) or (picked unit) that I cannot access when creating my table.

    like save knockbackSpeed of (Key Speed) of (target unit of ability) of Knocktable.

    for quite a while I was reading trying to learn/understand hashtables but everytime I tried to make one it didn't make any sense and only now that I noticed that I cannot find such functions, is it a bug related with JNGP editor or with patch 1.27a? (I Know 1.27b messes up the command card buttons)...
     
  15. Daffa the Mage

    Daffa the Mage

    Map Moderator

    Joined:
    Jan 30, 2013
    Messages:
    7,660
    Resources:
    27
    Packs:
    1
    Maps:
    8
    Spells:
    16
    Tutorials:
    2
    Resources:
    27
    It's down to the logical frame for accessing them actually by using Key(unit). If it's a singular unit, just keep it in a variable, for multiple objects, it goes into the logic flow for the triggers you aim to create. You can refer to Spell Section, some users create spells with hashtables and you might want to take a look on how they did it.

    Here's mine: Divine Judgement 1.2.1