| 02-09-2006, 11:53 PM | #1 |
Trigger: Actions
![]() Unit - Move (Attacked unit) instantly to ((Position of (Attacked unit)) offset by 8.00 towards (Angle from (Position of (Attacking unit)) to (Position of (Attacked unit))) degrees)
![]() Wait 0.15 seconds
![]() Unit - Move (Attacked unit) instantly to ((Position of (Attacked unit)) offset by 8.00 towards (Angle from (Position of (Attacking unit)) to (Position of (Attacked unit))) degrees)
![]() Wait 0.15 seconds
![]() Unit - Move (Attacked unit) instantly to ((Position of (Attacked unit)) offset by 8.00 towards (Angle from (Position of (Attacking unit)) to (Position of (Attacked unit))) degrees) |
| 02-10-2006, 03:44 AM | #2 |
I don't see why this coud lead to a memory leak? What is the event? |
| 02-10-2006, 04:24 AM | #3 |
This should be a suitable solution. Trigger: Actions
![]() Set AttackedPosition = Position of (Attacked unit)
![]() Set AttackerPosition = Position of (Attacking unit)
![]() Unit - Move (Attacked unit) instantly to AttackedPosition offset by 8.00 towards (Angle from AttackerPosition to AttackedPosition) degrees
![]() Wait 0.15 seconds
![]() Unit - Move (Attacked unit) instantly to AttackedPosition offset by 8.00 towards (Angle from AttackerPosition to AttackedPosition) degrees
![]() Wait 0.15 seconds
![]() Unit - Move (Attacked unit) instantly to AttackedPosition offset by 8.00 towards (Angle from AttackerPosition to AttackedPosition) degrees
![]() Custom Script - call RemoveLocation(udg_AttackedPosition)
![]() Custom Script - call RemoveLocation(udg_AttackerPosition) |
| 02-10-2006, 10:49 AM | #4 |
The polar offset will still leak, and since you now set the position of attacked unit to a variable, it doesn't change as the unit moves, so you should use increasing offset values: 8, 16, 24. |
| 02-10-2006, 01:11 PM | #5 |
It might also couse problems if the trigger runs twice at the same time. Use locals. |
| 02-10-2006, 01:15 PM | #6 | |
Quote:
I thought of this but , its not mutilinstanceable,and in this one the 2nd move downsn't do anything because attacked position doesn't get declared again. how do you use locals btw |
| 02-10-2006, 02:43 PM | #7 |
JASS:function DoSomething takes nothing returns nothing local integer i local integer c=UnitUserData(GetTriggerUnit()) endfunction Note that like in any real language you can also merge the delare with an initialization to save lines. If you were in gui it would be Trigger: Custom Script: local integer iOf course this means using custom scripts for any actions you do in the trigger |
| 02-10-2006, 06:30 PM | #8 |
i see so what would i need exactly for the actions part? |
| 02-10-2006, 06:40 PM | #9 |
chuckle brother gave it to you, go to the custom script function and copy the lines (1 per function) |
