- Joined
- Feb 6, 2014
- Messages
- 2,466
How can I detect in trigger if a certain unit is amphibious?
i cant find any function that can check this but you could just give your amphibious units a dummy ability and check in the trigger if your unit has that ability
i cant find any function that can check this but you could just give your amphibious units a dummy ability and check in the trigger if your unit has that ability
What happens if u create a unit that can't walk on water, on water?
Try placing it in a suitably sized patch of water pathing using SetUnitPosition or whatever the native is called. If it is not amphibious it will displace to the nearby land. If it is then it will remain where you place it. Same can be done with land to test if the unit is naval only.
Not all amphibious units have this ability. E.g. Naga Siren.Check if unit has the Submerge ability.
Check if unit is a ground unit
Have you taken a look at the test map? I can kill anything I select except amphibous units.
All right then. Perhaps, you can instead check for terrain pathing, usingand IsUnitMoving by Bribe.
- if not IsTerrainPathable(GetUnitX(udg_GT_Target), GetUnitY(udg_GT_Target), PATHING_TYPE_FLOATABILITY) then
Try placing it in a suitably sized patch of water pathing using SetUnitPosition or whatever the native is called. If it is not amphibious it will displace to the nearby land. If it is then it will remain where you place it. Same can be done with land to test if the unit is naval only.