This trigger is meant to replace a built Waygate (Fake) with a Waygate (Real), the default waygate, create a Waygate (Real) at temp location L and then set the destinations to each other. When I build Waygate (Fake), it is replaced, but instead of teleporting to the destination, the unit walks to the destination.
Code:
Ant Hill Construction
Events
Unit - A unit Finishes construction
Conditions
(Unit-type of (Constructed structure)) Equal to Waygate (Fake)
Actions
Player - Make Waygate (Fake) Unavailable for training/construction by (Owner of (Constructed structure))
Set L = (Point((X of (Position of (Constructed structure))), ((Y of (Position of (Constructed structure))) - 5120.00)))
Unit - Replace (Constructed structure) with a Waygate (Real) using The new unit's max life and mana
Neutral Building - Set (Last replaced unit) destination to L
Neutral Building - Enable (Last replaced unit)
Unit - Create 1 Waygate (Real) for (Owner of (Constructed structure)) at L facing Default building facing degrees
Custom script: call RemoveLocation(udg_L)
Set L = (Position of (Last replaced unit))
Neutral Building - Set (Last created unit) destination to L
Neutral Building - Enable (Last created unit)
Custom script: call RemoveLocation(udg_L)