- Joined
- Mar 10, 2009
- Messages
- 5,016
Hello, I'm learning hastables, please could someone tell me if this is the correct setup/basics of a hashtable?...
I've tested it and it worked as a MUI spell...
One problem, if the unit cast it twice or more to the same unit, then it wont destroy the previous effect, so what went wrong?...
NOTE: dont mind the GAme Display coz its my way of testing things
I've tested it and it worked as a MUI spell...
One problem, if the unit cast it twice or more to the same unit, then it wont destroy the previous effect, so what went wrong?...
NOTE: dont mind the GAme Display coz its my way of testing things
-
ER
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Bloodlust (Neutral Hostile 1)
-
-
Actions
-
Game - Display to (All players) the text: TRIGGER ON
-
Trigger - Turn on Timer <gen>
-
Set HTInt = 5
-
Special Effect - Create a special effect attached to the overhead of (Target unit of ability being cast) using abilities\weapons\DemolisherMissile\DemolisherMissile.mdl
-
Hashtable - Save Handle Of(Last created special effect) as (Key Sfx) of (Key (Target unit of ability being cast)) in HT
-
Hashtable - Save HTInt as (Key Timer) of (Key (Target unit of ability being cast)) in HT
-
Unit Group - Add (Target unit of ability being cast) to Ugrp
-
-
-
Timer
-
Events
-
Time - Every 1.00 seconds of game time
-
-
Conditions
-
Actions
-
Unit Group - Pick every unit in Ugrp and do (Actions)
-
Loop - Actions
-
Set HTInt = (Load (Key Timer) of (Key (Picked unit)) from HT)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
HTInt Greater than 0
-
-
Then - Actions
-
Hashtable - Save (HTInt - 1) as (Key Timer) of (Key (Picked unit)) in HT
-
Game - Display to (All players) the text: (String(HTInt))
-
-
Else - Actions
-
Special Effect - Destroy (Load (Key Sfx) of (Key (Picked unit)) in HT)
-
Unit Group - Remove (Picked unit) from Ugrp
-
Hashtable - Clear all child hashtables of child (Key (Picked unit)) in HT
-
-
-
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Ugrp is empty) Equal to True
-
-
Then - Actions
-
Game - Display to (All players) the text: TRIGGER OFF
-
Trigger - Turn off (This trigger)
-
-
Else - Actions
-
-
-