- Joined
- Mar 1, 2013
- Messages
- 555
Hi everyone
I made a 'system' for my map where every spell that has a missle and a target point can use the same loop. For some reason, when casting a missile, it moves instantly to the center of the map.
Please help!
I made a 'system' for my map where every spell that has a missle and a target point can use the same loop. For some reason, when casting a missile, it moves instantly to the center of the map.
-
Missile cast 2
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
-
Or - Any (Conditions) are true
-
Conditions
- (Ability being cast) Equal to Titan
-
Conditions
-
Or - Any (Conditions) are true
-
Actions
- If (iIndex2 Equal to 0) then do (Trigger - Turn on Missile loop 2 <gen>) else do (Do nothing)
- Set iIndex2 = (iIndex2 + 1)
- Set uC2[iIndex2] = (Triggering unit)
- Set Temp_Point = (Position of uC2[iIndex2])
- Set Temp_Point2 = (Target point of ability being cast)
- Set rDirection[iIndex2] = (Angle from Temp_Point to Temp_Point2)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Ability being cast) Equal to Titan
-
Then - Actions
- Unit - Create 1 Titan for (Owner of uC2[iIndex2]) at Temp_Point facing rDirection[iIndex2] degrees
- Set uE2[iIndex2] = (Last created unit)
- Set rSpeed2[iIndex2] = 7.00
- Set rDamage2[iIndex2] = 200.00
- Set iDurationE[iIndex2] = 200
- Else - Actions
-
If - Conditions
- Custom script: call RemoveLocation(udg_Temp_Point)
- Custom script: call RemoveLocation(udg_Temp_Point2)
-
Events
-
Missile loop 2
-
Events
- Time - Every 0.02 seconds of game time
- Conditions
-
Actions
-
For each (Integer Temp_Int) from 1 to iIndex2, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (uE2[Temp_Int] is paused) Equal to False
-
Then - Actions
- Set Temp_Point = (Position of uE[Temp_Int])
- Set iDurationE[Temp_Int] = (iDurationE[Temp_Int] - 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- iDurationE[Temp_Int] Greater than 0
-
Then - Actions
- Set Temp_Point2 = (Temp_Point offset by rSpeed2[Temp_Int] towards rDirection[Temp_Int] degrees)
- Unit - Move uE2[Temp_Int] instantly to Temp_Point2, facing rDirection[Temp_Int] degrees
- Custom script: call RemoveLocation(udg_Temp_Point2)
-
Else - Actions
- Unit - Kill uE2[Temp_Int]
-
If - Conditions
- Custom script: call RemoveLocation(udg_Temp_Point)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (uE2[Temp_Int] is dead) Equal to True
-
Then - Actions
- Set uC2[Temp_Int] = uC2[iIndex2]
- Set uC2[Temp_Int] = No unit
- Set rDamage2[Temp_Int] = rDamage2[iIndex2]
- Set rDamage2[iIndex2] = 0.00
- Set rDirection[Temp_Int] = rDirection[iIndex2]
- Set rDirection[iIndex2] = 0.00
- Set uE2[Temp_Int] = uE2[iIndex2]
- Set uE2[iIndex2] = No unit
- Set rSpeed2[Temp_Int] = rSpeed2[iIndex2]
- Set rSpeed2[iIndex2] = 0.00
- Set iIndex2 = (iIndex2 - 1)
- Set Temp_Int = (Temp_Int - 1)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
For each (Integer Temp_Int) from 1 to iIndex2, do (Actions)
-
Events