ok so i came back from the dark age and started using hashtables. obviously im no master at so i ran into a problem ive been at all day. im completely stumped! heres the simple bullet system again, all the dummy units move as they should but as soon as one either A. reaches its final distance or B. hits a target, ALL the dummy bullets stop. I based my triggering heavily on the example i recieved earlier and the hashtable tuturial here at the hive.
-
Events
-
Unit - A unit Is attacked
-
-
Conditions
-
(Unit-type of (Attacking unit)) Equal to Stalker
-
-
Actions
-
Set Temp_Unit[1] = (Attacking unit)
-
Set Temp_Unit[2] = (Attacked unit)
-
Set TempPoint[1] = (Position of Temp_Unit[1])
-
Set TempPoint[2] = (Position of Temp_Unit[2])
-
Unit - Create 1 Arrow for (Owner of (Attacking unit)) at TempPoint[1] facing TempPoint[2]
-
Set Archer_Distance = (400.00 x 0.04)
-
Set Archer_Time = 2.00
-
Hashtable - Save Archer_Distance as 0 of (Key (Last created unit)) in Hashtables[1]
-
Hashtable - Save Archer_Time as 1 of (Key (Last created unit)) in Hashtables[1]
-
Unit Group - Add (Last created unit) to Archer_Group[1]
-
Custom script: call RemoveLocation (udg_TempPoint[1])
-
Custom script: call RemoveLocation (udg_TempPoint[2])
-
-
Archers Move
-
Events
-
Time - Every 0.04 seconds of game time
-
-
Conditions
-
Actions
-
Unit Group - Pick every unit in Archer_Group[1] and do (Actions)
-
Loop - Actions
-
Set Archer_Distance = (Load 0 of (Key (Picked unit)) from Hashtables[1])
-
Set Archer_Time = (Load 1 of (Key (Picked unit)) from Hashtables[1])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Archer_Time Greater than 0.00
-
-
Then - Actions
-
Set TempPoint[1] = (Position of (Picked unit))
-
Unit - Move (Picked unit) instantly to (TempPoint[1] offset by Archer_Distance towards (Facing of (Picked unit)) degrees)
-
Set Temp_Unit[1] = (Picked unit)
-
Set Archer_Group[2] = (Units within 45.00 of TempPoint[1] matching ((((Matching unit) is A Hero) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Picked unit))) Equal to True)))
-
Unit Group - Pick every unit in Archer_Group[2] and do (Actions)
-
Loop - Actions
-
Unit - Cause Temp_Unit[1] to damage (Picked unit), dealing 20.00 damage of attack type Spells and damage type Normal
-
Trigger - Run Archers End <gen> (ignoring conditions)
-
-
-
Hashtable - Save (Archer_Time - 0.04) as 1 of (Key (Picked unit)) in Hashtables[1]
-
Custom script: call RemoveLocation (udg_TempPoint[1])
-
-
Else - Actions
-
Trigger - Run Archers End <gen> (ignoring conditions)
-
-
-
-
-
-
-
Archers End
-
Events
-
Conditions
-
Actions
-
Unit Group - Pick every unit in Archer_Group[1] and do (Actions)
-
Loop - Actions
-
Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Hashtables[1]
-
Unit Group - Remove (Picked unit) from Archer_Group[1]
-
Unit - Kill (Picked unit)
-
-
-
-