- Joined
- Mar 24, 2013
- Messages
- 1,105
Hello, so here I am making a "toss" and a unit is taken from around the caster and thrown toward the target, although I haven't implemented a change in flying height just yet. ANYWAY--- My trigger Works fine as long as I don't Remove the TempPoints but as soon as I do remove them, it just goes to the center of playable...What am I doing wrong? I can only assume the temp location is not being saved properly but I'm failing to understand why.
Here's my trigs.
Here's my trigs.
-
Toss Cast
-

Events
-


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

Conditions
-


(Ability being cast) Equal to Toss
-
-

Actions
-


Set Toss_MaxIndex = (Toss_MaxIndex + 1)
-


Set TempUnit = (Triggering unit)
-


Set Toss_TargetPoint[Toss_MaxIndex] = (Target point of ability being cast)
-


Set TempLoc = (Position of TempUnit)
-


Set TempLoc2 = Toss_TargetPoint[Toss_MaxIndex]
-


Set TempGroup = (Units within 300.00 of TempLoc matching ((((Matching unit) is A structure) Not equal to True) and (((Matching unit) belongs to an ally of (Triggering player)) Not equal to True)))
-


Set Thrown_Unit[Toss_MaxIndex] = (Random unit from TempGroup)
-


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



If - Conditions
-




(Level of Storm Crow Form for (Random unit from TempGroup)) Less than 1
-
-



Then - Actions
-




Unit - Add Storm Crow Form to (Random unit from TempGroup)
-
-



Else - Actions
-
-


Trigger - Turn on Toss Loop <gen>
-


// Custom script: call RemoveLocation(udg_TempLoc)
-


// Custom script: call RemoveLocation(udg_TempLoc2)
-
-
-
Toss Loop
-

Events
-


Time - Every 0.03 seconds of game time
-
-

Conditions
-

Actions
-


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



If - Conditions
-




Toss_MaxIndex Equal to 0
-
-



Then - Actions
-




Trigger - Turn off (This trigger)
-
-



Else - Actions
-




For each (Integer Toss_CurrentIndex) from 1 to Toss_MaxIndex, do (Actions)
-





Loop - Actions
-






Set TempLoc = (Position of Thrown_Unit[Toss_CurrentIndex])
-






Set TempLoc2 = Toss_TargetPoint[Toss_CurrentIndex]
-






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







If - Conditions
-








(Distance between TempLoc and TempLoc2) Less than or equal to Toss_ThresholdRange
-
-







Then - Actions
-








Set Thrown_Unit[Toss_CurrentIndex] = Thrown_Unit[Toss_MaxIndex]
-








Set Toss_TargetPoint[Toss_CurrentIndex] = Toss_TargetPoint[Toss_MaxIndex]
-








Set Toss_CurrentIndex = (Toss_CurrentIndex - 1)
-








Set Toss_MaxIndex = (Toss_MaxIndex - 1)
-
-







Else - Actions
-








Set TempReal = (Angle from TempLoc to TempLoc2)
-








Custom script: call SetUnitX(udg_Thrown_Unit[udg_Toss_CurrentIndex], GetUnitX(udg_Thrown_Unit[udg_Toss_CurrentIndex]) + udg_Toss_SpeedInterval * Cos(bj_DEGTORAD * udg_TempReal))
-








Custom script: call SetUnitY(udg_Thrown_Unit[udg_Toss_CurrentIndex], GetUnitY(udg_Thrown_Unit[udg_Toss_CurrentIndex]) + udg_Toss_SpeedInterval * Sin(bj_DEGTORAD * udg_TempReal))
-
-
-






// Custom script: call RemoveLocation(udg_TempLoc)
-






// Custom script: call RemoveLocation(udg_TempLoc2)
-
-
-
-
-
-




