WaygateActivate
- Parameters
-
waygate unit
activate boolean
- comment
Activates the unit's ability to act as a teleporter. It must have the 'Awrp' ability.
Example (Lua):
portal = CreateUnit(Player(GetPlayerNeutralPassive()), FourCC("hprt"), 256, 0, 90) UnitAddAbility(portal, FourCC('Awrp')) WaygateSetDestination(portal, -800, 32) WaygateActivate(portal, true) print("Waygate is Active: ", WaygateIsActive(portal)) print("Waygate target is: ", WaygateGetDestinationX(portal), WaygateGetDestinationY(portal))
- note
The unit should be walkable because units, that want to teleport, must reach its center.
- note
Removing the 'Awrp' ability also deactivates the waygate. Use
WaygateActivate
again.- note
The advantage of using waygates compared to triggered regions is that units can use waygates for pathing around the map. In contrast, triggered "teleport regions" are not recognized by the game for pathfinding.
- note
See:
WaygateIsActive
,WaygateSetDestination
,UnitAddAbility
.- patch
1.00
- Source
- common.j
- return type
nothing
- Source code
native WaygateActivate takes unit waygate, boolean activate returns nothing