San-D
New Member
- Reaction score
- 15
I heard somewhere that u shouldnt use wait actions in a loop. I have a trigger that whirpool spin that "gravitates" a target to the caster the trigger is the following:
VARS: Caster-Unit
Target-Unit
Distance-Real
Angle-Real
The problem: Everything is just perfect, ONLY it doesnt unpause the uniits!
(Also when i loop the motion its much slower when I doo a seperate trigger (E: Every 0.01 sec; A: move unit...)
REP TO THE ONE WHO SOLVES IT!!!!!
VARS: Caster-Unit
Target-Unit
Distance-Real
Angle-Real
Code:
Whirpool
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Whirpool
Actions
Set Caster = (Casting unit)
Set Target = (Target unit of ability being cast)
Set Angle = (Angle from (Position of Caster) to (Position of Target))
Set Distance = (Distance between (Position of Caster) and (Position of Target))
Unit - Pause Caster
Unit - Pause Target
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Distance Greater than or equal to 100.00
Then - Actions
For each (Integer A) from 100 to (Integer(Distance)), do (Actions)
Loop - Actions
Wait 0.01 seconds
Unit - Move Target instantly to ((Position of Caster) offset by Distance towards Angle degrees)
Unit - Create 1 Dummy for Player 1 (Red) at (Position of Target) facing Default building facing degrees
Unit - Add a 0.01 second Generic expiration timer to (Last created unit)
Set Angle = (Angle + 1.00)
Set Distance = (Distance - 1.00)
Else - Actions
Unit - Make Target Vulnerable
Do nothing
Unit - Unpause Target
Unit - Unpause Caster
The problem: Everything is just perfect, ONLY it doesnt unpause the uniits!
(Also when i loop the motion its much slower when I doo a seperate trigger (E: Every 0.01 sec; A: move unit...)
REP TO THE ONE WHO SOLVES IT!!!!!