- Joined
- Mar 1, 2013
- Messages
- 555
Hey guys, I'm working with triggers for about a month and things are going well but I still don't understand hash tables that well. I googled a tutrial on hive and tried do use it for a custom spell. This is what my spell looks like:
-
Black hole spell
-

Events
-


Unit - A unit Starts the effect of an ability
-
-

Conditions
-


(Ability being cast) Equal to Black hole
-
-

Actions
-


Hashtable - Create a hashtable
-


Set VoidHash = (Last created hashtable)
-


Unit - Create 1 Black Hole for (Owner of (Casting unit)) at (Position of (Target unit of ability being cast)) facing Default building facing degrees
-


Unit - Order (Last created unit) to Neutral - Devour (Target unit of ability being cast)
-


Hashtable - Save 5.00 as 0 of (Key (Last created unit)) in VoidHash
-
-
-
Black hole loop
-

Events
-


Time - Every 1.00 seconds of game time
-
-

Conditions
-

Actions
-


Unit Group - Pick every unit in VoidGroup and do (Actions)
-



Loop - Actions
-




Set Void_remaining = (Load 0 of (Key (Picked unit)) from VoidHash)
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






Void_remaining Greater than 0
-
-





Then - Actions
-






Hashtable - Save (Void_remaining - 1) as 0 of (Key (Picked unit)) in VoidHash
-
-





Else - Actions
-






Unit Group - Remove (Picked unit) from VoidGroup
-






Unit - Remove (Picked unit) from the game
-






Hashtable - Clear all child hashtables of child (Key (Picked unit)) in VoidHash
-
-
-
-
-
-




