HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Checking whether a unit is on water or not...

08-04-2006, 03:57 AM#1
darkwulfv
How do I check to see if a unit is on water or not? (Yes I know the theme of the spell session requires me to know this. That's why I'm asking Any help?)
08-04-2006, 04:23 AM#2
Alevice
Trigger:
Conditions
(Terrain pathing at (Position of (Triggering unit)) of type Floatability is off) Equal to False

Collapse JASS:
function UnitIsInWater takes unit whichUnit returns boolean
    return not (IsTerrainPathable(GetUnitX(whichUnit),GetUnitY(whichUnit),PATHING_TYPE_FLOATABILITY))
endfunction
08-04-2006, 09:00 AM#3
Anitarf
How did Blizz implement this pathability anyway? I thought that the RGB channels of pathing maps were used for air, ground and buildability.
08-04-2006, 03:53 PM#4
Naakaloh
I'm not sure, but when I was designing a water-based spell I checked the pathing types and floatability worked for all the places with water.

I think that there may be a separate method of pathing water, since it's clear the the RGB textures weren't designed for it... unless they made the alpha value have some effect.
08-04-2006, 04:07 PM#5
Captain Griffen
Notice naval and ground pathings are different options in the WE for viewing them.
08-04-2006, 04:21 PM#6
Naakaloh
Yes, that's partially why I was thinking that there is a different method.
08-04-2006, 08:47 PM#7
darkwulfv
Thanks Alevice. I think I'm going to work on my spell now.. Still don't have an idea. Oh shit I'm going on vacation again, I gotta work FAST.