Hashtables and Timers Question

Zealot

Member
Reaction score
11
So i have a trigger that does this.
Trigger:
  • Countdown Timer - Start (Load (Integer A) of 1 in Tree_Hash) as a One-shot timer that will expire in 20.00 seconds

And another trigger that does this.

Trigger:
  • Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) + ((Elapsed time for (Load (Integer A) of 1 in Tree_Hash)) x 5.00))

But It doesn't work, am I using the hashtable wrong?
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
I assume you are.
You never showed us where you save anything in the hashtable, only how you are loading it.

So unless you have some other trigger where you actuall put something into the hashtable then yes, you are doing it wrong.
 

Zealot

Member
Reaction score
11
Trigger:
  • Hashtable - Create a hashtable

Trigger:
  • Set Tree_Hash = (Last created hashtable)


What is missing?
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
Let us see. You are:
  1. Creating a hashtable
  2. Attempting to load something from the hashtable
Yeah, seems like there is still something missing: Actually saving something to the hashtable.
 

Zealot

Member
Reaction score
11
Don't be smug, I'm not very knowledgeable about hashtables, how can I make it save a timer or what do I have to do?
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
How about this line of code:
Trigger:
  • Hashtable - Save Handle OfSomeTimer as A of B in SomeHashTable
 

Zealot

Member
Reaction score
11
How about this line of code:
Trigger:
  • Hashtable - Save Handle OfSomeTimer as A of B in SomeHashTable

Ok, but one more thing.

I have this, so it goes once for each player on the map, do hashtables leak?

Trigger:
  • For each (Integer A) from 1 to 4, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Target unit of ability being cast)) Equal to (Player((Integer A)))
        • Then - Actions
          • Hashtable - Save Handle OfSleep_Timer as (Integer A) of 1 in Tree_Hash
          • Countdown Timer - Start (Load (Integer A) of 1 in Tree_Hash) as a One-shot timer that will expire in 25.00 seconds
        • Else - Actions
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top