Personally I would do something like this. Note, this is obviously mock code, so change it to what you desire.
For loop (A = 1 - 10) do
- Create a (Dummy Unit) for (Owner of (Caster)) at (Position of (Caster)) offset by (Real((X) * (A)) towards (Facing Angle of (Caster) + 90) degrees.
This will spawn 10 units in a line that are at 90 degrees to the caster in a line. The "Y" value can be set to anything. The bigger it is, the more spaced out the units are. If you space it out too much, you may want to spawn more units to fill the gaps.
After they are spawned, you will need to index them into an array variable. This will help to keep track of them. You will also need to save the initial casting angle, and assign each unit a unique value to keep its position in the line.
An example would be:
Set CastingAngle = (Facing angle of (Caster))
Set IntegerTimer = 0
Set StartPoint = (Position of (Caster))
For loop (A = 1 - 10) do
- Create a (Dummy Unit) for (Owner of (Caster)) at (Position of (Caster)) offset by (Real((X) * (A)) towards (Facing Angle of (Caster) + 90) degrees.
- Set DummyUnit[A] = (Last created unit)
END LOOP
Turn on (Periodic Trigger)
From there, we'll turn on a periodic trigger.
Note that this method is not MUI. You'll need to look up tutorials on indexing if you want to do that. Alternatively, you could use Hashtables, but that's bad on system resources. Obviously, this isn't leakless either.
As for the "timer" variable. I'll explain below.
Once you've kept track of them, you need to run a periodic trigger something like this:
Every 0.03 seconds:
If IntegerTimer < 30 then
- Set IntegerTimer = IntegerTimer + 1
- For Loop (A = 1 - 10) do
-- Move (Dummy[A]) instantly to (StartPoint) offset by ((CastingAngle) + 90 - (Real(TimerInteger) x 3)
-ENDLOOP
else
-For Loop (A = 1 - 10) do
-- Remove (Dummy[A]) from the game.
-ENDLOOP
- Turn off (This Trigger)
ENDIF
Basically, what this code would do is create 10 units in a line, evenly spaced out, and then move them in a 90 degree angle starting at a positive 90 degrees and finishing at the same angle as the original caster's angle after approximately 0.9 seconds. To make it slower, just change the period of the timer in periodic.