• 🏆 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] HashTables Making This Work

Status
Not open for further replies.
Level 4
Joined
Apr 26, 2008
Messages
67
I just started messing around with Hashtables and I was wondering why this spell DOES NOT work? I've looked over it and changed things to it over and over and I still have no idea why it does not work.

What it's supposed to do: A Hero casts rejuvenation on a target, after 5 seconds the unit that the spell was casted on will instantly heal for an amount.

My Triggers:

  • Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set Hashtable = (Last created hashtable)

Spell Start:

  • HealStart
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Nature's Bloom
    • Actions
      • Hashtable - Save 0.00 as 0 of (Key (Target unit of ability being cast)) in Hashtable
      • Unit Group - Add (Target unit of ability being cast) to Natures_Bloom_Group
Spell Instant Heal After 5 Seconds:

  • Healing
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Natures_Bloom_Group and do (Actions)
        • Loop - Actions
          • Set Natures_Bloom_Wait = (Load 0 of (Key (Picked unit)) from Hashtable)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Natures_Bloom_Wait Less than or equal to 4.00
            • Then - Actions
              • Hashtable - Save (RemainingTime + 1.00) as 0 of (Key (Picked unit)) in Hashtable
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Natures_Bloom_Wait equal to 5.00
                • Then - Actions
                  • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 50000.00)
                • Else - Actions
                  • Unit Group - Remove (Picked unit) from Natures_Bloom_Group
                  • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Hashtable
Any help will be much appreciated! Will +Rep
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Healing
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Natures_Bloom_Group and do (Actions)
        • Loop - Actions
          • Set Natures_Bloom_Wait = (Load 0 of (Key (Picked unit)) from Hashtable)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Natures_Bloom_Wait Less than or equal to 4.00
            • Then - Actions
              • Hashtable - Save (Natures_Bloom_Wait + 1.00) as 0 of (Key (Picked unit)) in Hashtable
            • Else - Actions
              • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 50000.00)
              • Unit Group - Remove (Picked unit) from Natures_Bloom_Group
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Hashtable
              • If Natures_Bloom_Group is empty -> turn off this trigger
Turn on this trigger when a unit begins channeling the spell.
 
Level 4
Joined
Apr 26, 2008
Messages
67
Alrighty, I fixed that one counter thing but...

There is actually 1 more issue. It doesn't heal when Nature_Bloom_Wait reaches 5. Sure I fixed the part to count for Nature_Bloom_Wait, part but it didn't fix the healing. The trigger still does not heal the target.
 
Level 9
Joined
Sep 28, 2004
Messages
365
I am not sure about this. Not at home to test this. But i don't know if "Unit - A unit Begins channeling an ability" will gives a target unit of ability being cast. Try changing it to A unit starts the effect of an ability. Or something to do with that load hashtable where u only load 1 0 instead of 2. Not sure. I will check when i get home.
 
Status
Not open for further replies.
Top