I wan't to create an ability, which will essentially recreate the waygate unit from Wc3. The unit is an invulnerable neutral unit, which should cast an ability on a unit if the unit has been issued a move order on the waygate (I'll do the teleportation with triggers, I just need to get a way to know when to teleport, and I dont't want to teleport whenever a unit enters a region).
Something like if unit A is issued move order on the waygate unit, and is withing 1 range of the waygate, the waygate will cast Teleport ability on unit A. This also has to work if unit A has been issued the move order 10 range away, so the waygate will cast the teleport ability when unit A comes within range.
TLDR: How to I create an ability, that will auto cast on units within range that issues move order on it.
Easiest way I see it is to make it a transport unit that can load units within 1 range.
You can get the loaded units from trigger and then you can teleport them.
That way you can also cancel the teleport when you right-clicked on it from far away.
Thanks - this worked like a charm.
For anyone wanting to do this aswell, all I had to do, was to dublicate the Warp Prism - Load-Unload (Shuttle) ability (comes with both model and sound actors so that's the easiest). Go to the (Basic) Ability: Target Filters and check the flags all the in the bottom (Ally, Enemy, Neutral, Player).
Then you give the ability to your portal unit, and use a trigger like this:
Portal Trigger
Events
Unit -Portal [54.00, 122.00] Loads cargo
Local Variables
Point = Point 013 <Point>
Conditions
Actions
Unit -Move (Triggering cargo unit) instantly to Point (No Blend)
Camera -Pan the camera for player (Owner of (Triggering cargo unit)) to Point over 0.0 seconds with Existing Velocity% initial velocity, 10.0% deceleration, and Do Not use smart panning
Now, whenever you right click to move to your portal unit with a unit, the unit will load into the portal when it gets within range, and the trigger will teleport the unit to your desired location.
EDIT: A little side-note. The ability has the Visible flag marked as Required in the (Basic) Ability: Target Filters, which would not allow cloaked units to use it. So set this to allowed, to be able to use it as a cloaked unit.
I wan't to create an ability, which will essentially recreate the waygate unit from Wc3. The unit is an invulnerable neutral unit, which should cast an ability on a unit if the unit has been issued a move order on the waygate (I'll do the teleportation with triggers, I just need to get a way to know when to teleport, and I dont't want to teleport whenever a unit enters a region).
Something like if unit A is issued move order on the waygate unit, and is withing 1 range of the waygate, the waygate will cast Teleport ability on unit A. This also has to work if unit A has been issued the move order 10 range away, so the waygate will cast the teleport ability when unit A comes within range.
TLDR: How to I create an ability, that will auto cast on units within range that issues move order on it.
Hi,
Easiest way I see it is to make it a transport unit that can load units within 1 range.
You can get the loaded units from trigger and then you can teleport them.
That way you can also cancel the teleport when you right-clicked on it from far away.
Thanks - this worked like a charm.
For anyone wanting to do this aswell, all I had to do, was to dublicate the Warp Prism - Load-Unload (Shuttle) ability (comes with both model and sound actors so that's the easiest). Go to the (Basic) Ability: Target Filters and check the flags all the in the bottom (Ally, Enemy, Neutral, Player).
Then you give the ability to your portal unit, and use a trigger like this:
Now, whenever you right click to move to your portal unit with a unit, the unit will load into the portal when it gets within range, and the trigger will teleport the unit to your desired location.
EDIT: A little side-note. The ability has the Visible flag marked as Required in the (Basic) Ability: Target Filters, which would not allow cloaked units to use it. So set this to allowed, to be able to use it as a cloaked unit.