Squeekems
TH.net Regular
- Reaction score
- 11
I want to add a simple push-back for Fan of Knives. I add the units that get hit to a unit group called "Slammed_Units." Units in this group will be picked in another trigger that automatically moves them in a certain direction (depending on their custom value)
every .04 seconds. I thought this would work perfect, but it seems that the units are not being pulled from the group.
Apologies for the long post.
every .04 seconds. I thought this would work perfect, but it seems that the units are not being pulled from the group.
Apologies for the long post.
Code:
Fan of Knives
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Fan of Knives
Actions
Set AoE_of_Ability = 200.00
Set Temp_Point = (Position of (Casting unit))
Set Temp_Group = (Units within AoE_of_Ability of Temp_Point matching (((Matching unit) Not equal to (Triggering unit)) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is Mechanical) Equal to False) and ((((Matching unit) is A structure) Equal to
Unit Group - Pick every unit in Temp_Group and do (Actions)
Loop - Actions
Set Temp_Point2 = (Position of (Picked unit))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
(X of Temp_Point2) Less than (X of Temp_Point)
(Y of Temp_Point2) Greater than (Y of Temp_Point)
Then - Actions
Unit - Set the custom value of (Picked unit) to 0
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
(X of Temp_Point2) Equal to (X of Temp_Point)
(Y of Temp_Point2) Greater than (Y of Temp_Point)
Then - Actions
Unit - Set the custom value of (Picked unit) to 1
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
(X of Temp_Point2) Greater than (X of Temp_Point)
(Y of Temp_Point2) Greater than (Y of Temp_Point)
Then - Actions
Unit - Set the custom value of (Picked unit) to 2
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
(X of Temp_Point2) Greater than (X of Temp_Point)
(Y of Temp_Point2) Equal to (Y of Temp_Point)
Then - Actions
Unit - Set the custom value of (Picked unit) to 3
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
(X of Temp_Point2) Greater than (X of Temp_Point)
(Y of Temp_Point2) Less than (Y of Temp_Point)
Then - Actions
Unit - Set the custom value of (Picked unit) to 4
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
(X of Temp_Point2) Equal to (X of Temp_Point)
(Y of Temp_Point2) Less than (Y of Temp_Point)
Then - Actions
Unit - Set the custom value of (Picked unit) to 5
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
(X of Temp_Point2) Less than (X of Temp_Point)
(Y of Temp_Point2) Less than (Y of Temp_Point)
Then - Actions
Unit - Set the custom value of (Picked unit) to 6
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
(X of Temp_Point2) Less than (X of Temp_Point)
(Y of Temp_Point2) Equal to (Y of Temp_Point)
Then - Actions
Unit - Set the custom value of (Picked unit) to 7
Else - Actions
Custom script: call RemoveLocation(udg_Temp_Point2)
Unit Group - Add (Picked unit) to Slammed_Units
Wait 0.40 seconds
Unit Group - Pick every unit in Temp_Group and do (Actions)
Loop - Actions
Unit Group - Remove (Picked unit) from Slammed_Units
Custom script: call DestroyGroup(udg_Temp_Group)
Custom script: call RemoveLocation(udg_Temp_Point)