• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Hashtable: load Unit ID doesnt work

Status
Not open for further replies.
Level 3
Joined
Dec 17, 2017
Messages
39
he guys! somehow my trigger doesnt work and i cant figure out why..
i try to make an ability that pulls the target to the caster:
the third message doesnt show up at all so i guess theres something going wrong with the loading saving of the targets unit ID but im kinda stuck there..
would be so cool if somebody could help me with that!

  • Pull1
    • Ereignisse
      • Einheit - A unit Beginnt, eine Fähigkeit zu kanalisieren
    • Bedingungen
      • (Ability being cast) Gleich Pull Naga
    • Aktionen
      • Spiel - Display to (All players) the text: casted
      • Hashtabelle - Save (Key (Target unit of ability being cast)) as HT_pullTarget1 of (Key (Triggering unit)) in theHashtable01
      • Set TmpUnit1 = (Load HT_pullTarget1 of (Key (Triggering unit)) in theHashtable01)
      • Einheit - Pause ein TmpUnit1
      • Spiel - Display to (All players) the text: (String((Name of (Target unit of ability being cast))) as Kleinschreibung)
      • Spiel - Display to (All players) the text: (String((Name of TmpUnit1)) as Kleinschreibung)
      • Wait 0.20 game-time seconds
      • Set real1 = 1.00
      • Set TmpUnit1 = (Load HT_pullTarget1 of (Key (Triggering unit)) in theHashtable01)
      • Set point1 = (Position of (Triggering unit))
      • Set point2 = (Position of TmpUnit1)
      • Set point3 = (Point(((X of point2) + (real1 x (((X of point1) - (X of point2)) / 10.00))), ((Y of point2) + (real1 x (((Y of point1) - (Y of point2)) / 10.00)))))
      • Einheit - Move TmpUnit1 instantly to point3
      • Custom script: call RemoveLocation (udg_point1)
      • Custom script: call RemoveLocation (udg_point2)
      • Custom script: call RemoveLocation (udg_point3)
      • Wait 0.20 game-time seconds
      • ...
      • Hashtabelle - Clear all child hashtables of child (Key (Triggering unit)) in theHashtable01
 
Level 3
Joined
Dec 17, 2017
Messages
39
That's not you storing something into HT_pullTarget1. That's you saving something into the hashtable.

ah got it, sry! HT_pullTarget1 is an integer and just represents the index in the hastable the target unit is stored. it is declared in another trigger: the trigger in which i create the hashtable and declare all of those index-integers.

actually i found another way to make my abilty work, i used unit groups for it and periodic events. but still: why cant i load the target unit from the hashtable? shouldnt it work that way? it bothers me cause im using similar functions to remove dummy-casters from the game to avoid memory-leaks etc..
 
Status
Not open for further replies.
Top