Ini
Hello again. Always the same issue with triggers like this. I've made many similar triggers like this, but usually I have used only unit position locations.
I have no idea how to cycle the target point of ability being cast from the initial trigger. Thanks for your help in advance.
So the location in the loop trigger leaks, and the units charging get stuck, moving back and forth in a small distance. And when you cast it again the first unit that were using the ability jumps to center of the map. And there are infinite special effects of thunderclap, because the HC_Count on the trigger never returns to 0 so the loop keeps running indefinite.
-
Set VariableSet HC_TargetPoint[HC_Count] = (Target point of ability being cast)
-
For each (Integer HC_LoopInteger) from 1 to HC_Count, do (Actions)
-
Loop - Actions
-
Set VariableSet HC_Caster[HC_LoopInteger] = HC_Caster[HC_LoopInteger]
-
Set VariableSet HC_CasterPoint[HC_LoopInteger] = (Position of HC_Caster[HC_LoopInteger])
-
-------- I want to cycle this correctly --------
-
-------- This trigger probably does not work --------
-
-------- Because this location does not exist --------
-
Set VariableSet HC_TargetPoint[HC_LoopInteger] = HC_TargetPoint[HC_LoopInteger]
-
-------- --- --------
-
Set VariableSet HC_Angle[HC_LoopInteger] = (Angle from HC_CasterPoint[HC_LoopInteger] to HC_TargetPoint[HC_LoopInteger])
-
Set VariableSet HC_Distance[HC_LoopInteger] = (Distance between HC_CasterPoint[HC_LoopInteger] and HC_TargetPoint[HC_LoopInteger])
-
Unit - Move HC_Caster[HC_LoopInteger] instantly to (HC_CasterPoint[HC_LoopInteger] offset by 75.00 towards HC_Angle[HC_LoopInteger] degrees.)
-
Destructible - Pick every destructible within HC_AOE of HC_CasterPoint[HC_LoopInteger] and do (Actions)
-
Loop - Actions
-
Set VariableSet HC_Destructible = (Picked destructible)
-
Unit - Order TreeHarvester[HC_Count] to HarvestHC_Destructible
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Current order of TreeHarvester[HC_Count]) Equal to (Order(harvest))
-
-
Then - Actions
-
Destructible - Kill HC_Destructible
-
-
Else - Actions
-
Unit - Order TreeHarvester[HC_Count] to Stop.
-
-
-
-
-
Custom script: call RemoveLocation (udg_HC_CasterPoint[udg_HC_LoopInteger])
-
Custom script: call RemoveLocation (udg_HC_TargetPoint[udg_HC_LoopInteger])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
HC_Distance[HC_LoopInteger] Less than or equal to 25.00
-
-
Then - Actions
-
-------- The Distance condition is not met, because there is no location --------
-
Special Effect - Create a special effect attached to the origin of HC_Caster[HC_LoopInteger] using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
-
Set VariableSet HC_Spef = (Last created special effect)
-
Special Effect - Destroy HC_Spef
-
Set VariableSet HC_UG[HC_LoopInteger] = (Units within 225.00 of HC_TargetPoint[HC_LoopInteger] matching (((Matching unit) belongs to an enemy of (Owner of HC_Caster[HC_LoopInteger]).) Equal to True).)
-
Unit Group - Pick every unit in HC_UG[HC_LoopInteger] and do (Actions)
-
Loop - Actions
-
Set VariableSet HC_Target[HC_LoopInteger] = (Picked unit)
-
Unit - Cause HC_Caster[HC_LoopInteger] to damage (Picked unit), dealing 100.00 damage of attack type Spells and damage type Normal
-
-
-
Unit - Unpause HC_Caster[HC_LoopInteger]
-
Animation - Reset HC_Caster[HC_LoopInteger]'s animation
-
Animation - Change HC_Caster[HC_LoopInteger]'s animation speed to 100.00% of its original speed
-
Animation - Change HC_Caster[HC_LoopInteger] flying height to 0.00 at 0.00
-
Unit - Turn collision for HC_Caster[HC_LoopInteger] On.
-
-------- Here is where I cycle loopinteger back to normal count --------
-
Set VariableSet HC_Caster[HC_LoopInteger] = HC_Caster[HC_Count]
-
Set VariableSet HC_CasterPoint[HC_LoopInteger] = HC_CasterPoint[HC_Count]
-
Set VariableSet HC_TargetPoint[HC_LoopInteger] = HC_TargetPoint[HC_Count]
-
Set VariableSet HC_Angle[HC_LoopInteger] = HC_Angle[HC_Count]
-
Set VariableSet HC_Distance[HC_LoopInteger] = HC_Distance[HC_Count]
-
Set VariableSet HC_LoopInteger = (HC_LoopInteger - 1)
-
Set VariableSet HC_Count = (HC_Count - 1)
-
-------- Remove Leaks --------
-
Custom script: call RemoveLocation (udg_HC_TargetPoint[udg_HC_LoopInteger])
-
Custom script: call RemoveLocation (udg_HC_CasterPoint[udg_HC_LoopInteger])
-
Custom script: call DestroyGroup (udg_HC_UG[udg_HC_LoopInteger])
-
Unit - Make TreeHarvester[HC_Count] Vulnerable
-
Unit - Kill TreeHarvester[HC_Count]
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
HC_Count Equal to 0
-
-
Then - Actions
-
Trigger - Turn off (This trigger)
-
-
Else - Actions
-
-
-
-
-
Hello again. Always the same issue with triggers like this. I've made many similar triggers like this, but usually I have used only unit position locations.
I have no idea how to cycle the target point of ability being cast from the initial trigger. Thanks for your help in advance.
So the location in the loop trigger leaks, and the units charging get stuck, moving back and forth in a small distance. And when you cast it again the first unit that were using the ability jumps to center of the map. And there are infinite special effects of thunderclap, because the HC_Count on the trigger never returns to 0 so the loop keeps running indefinite.