Is there a way to know how a unit will move ahead of time when you issue an order?
I'm creating a turn based map and would like to create a trail to where the unit is going to move before he does it.
Example
Here's my attempt at doing this:
Basically each trail point is its own unit which I order to move toward the targeted order point (without move speed it only turns and doesnt actually move), that way it faces more or less in the right direction and I create a new trail point unit 300 units in front of it. Rinse and repeat until the distance between the last point and the target order point is less than 300.
However, this way is limited by the turn speed of units in WC3 and I MUST wait at least 0.10 seconds in between for it to have enough time to turn. Also, without wait time the the loop crashes the game.
Are there any other/better ways of achieving the same thing? Any help appreciated.
I'm creating a turn based map and would like to create a trail to where the unit is going to move before he does it.
Example

Here's my attempt at doing this:
-
CreateTrail
-
Events
-
Unit - A unit Is issued an order targeting a point
-
-
Conditions
-
(Ordered unit) Not equal to PreviousTrailPoint
-
MoveOrderCooldown Equal to False
-
-
Actions
-
Unit - Move (Ordered unit) instantly to (Position of (Ordered unit)), facing (Target point of issued order)
-
Set VariableSet MoveOrderCooldown = True
-
Set VariableSet TargetTrailEnd = (Target point of issued order)
-
Set VariableSet OrderedHero = (Ordered unit)
-
Set VariableSet PreviousTrailPoint = (Ordered unit)
-
Unit Group - Pick every unit in TrailGroup and do (Unit - Remove (Picked unit) from the game)
-
Unit - Set OrderedHero movement speed to 0.00
-
Trigger - Add Create Trail Point <gen> to the trigger queue (Checking conditions)
-
Set VariableSet MoveOrderCooldown = False
-
-
-
Create Trail Point
-
Events
-
Conditions
-
Actions
-
Wait 0.10 seconds
-
Unit - Create 1.Trail Point for (Owner of (Ordered unit)) at ((Position of PreviousTrailPoint) offset by 300.00 towards (Facing of PreviousTrailPoint) degrees.) facing (Facing of PreviousTrailPoint) degrees
-
Animation - Change (Last created unit)'s vertex coloring to (100.00%, 0.00%, 0.00%) with 0.00% transparency
-
Set VariableSet PreviousTrailPoint = (Last created unit)
-
Unit - Order PreviousTrailPoint to Move To.TargetTrailEnd
-
Unit - Set PreviousTrailPoint movement speed to 0.00
-
Unit Group - Add PreviousTrailPoint to TrailGroup
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Distance between (Position of PreviousTrailPoint) and TargetTrailEnd) Greater than 350.00
-
-
Then - Actions
-
Trigger - Add (This trigger) to the trigger queue (Checking conditions)
-
-
Else - Actions
-
Unit - Create 1.Trail End for (Owner of (Ordered unit)) at TargetTrailEnd facing (Facing of PreviousTrailPoint) degrees
-
Animation - Change (Last created unit)'s vertex coloring to (100.00%, 0.00%, 0.00%) with 0.00% transparency
-
Unit Group - Add (Last created unit) to TrailGroup
-
-
-
Trigger - Remove (This trigger) from the trigger queue
-
-
Basically each trail point is its own unit which I order to move toward the targeted order point (without move speed it only turns and doesnt actually move), that way it faces more or less in the right direction and I create a new trail point unit 300 units in front of it. Rinse and repeat until the distance between the last point and the target order point is less than 300.
However, this way is limited by the turn speed of units in WC3 and I MUST wait at least 0.10 seconds in between for it to have enough time to turn. Also, without wait time the the loop crashes the game.
Are there any other/better ways of achieving the same thing? Any help appreciated.