• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Water detection and x,y

Status
Not open for further replies.
Level 24
Joined
Nov 9, 2006
Messages
2,558
Water detection and x,y position + item leveling

GUI: Got 2 questions, i know they may have been answered before but i want answers quick.
1) How can i detect water with a condition? (all i can find is cliff level in integer).
2) How to do x,y positions of a unit? I need this because im using a position loop which lasts the whole game so i dont want it to be leaky.
 
Last edited:
Level 8
Joined
Mar 23, 2007
Messages
302
To detect water...
u need a Z value for the unit. then if Z is under "waterlevel", the unit is in water.

for the X Y...
there is a function in Jass so there could be a solution in GUI,
im not sure but isnt there a GUI function to "Set Unit Position to X,Y"

greets equal
 
Level 17
Joined
Jun 17, 2007
Messages
1,433
GUI: Got 2 questions, i know they may have been answered before but i want answers quick.
1) How can i detect water with a condition? (all i can find is cliff level in integer).
2) How to do x,y positions of a unit? I need this because im using a position loop which lasts the whole game so i dont want it to be leaky.
2) You might as well do that in GUI with locations being used and removed as normal, because the coordinate function in GUI creates of location of the coordinates, ie
JASS:
Location(x,y)
 
Level 24
Joined
Nov 9, 2006
Messages
2,558
To detect water...
u need a Z value for the unit. then if Z is under "waterlevel", the unit is in water.
Yeah i know, but how? I can only find X,Y...

2) You might as well do that in GUI with locations being used and removed as normal, because the coordinate function in GUI creates of location of the coordinates, ie
U sure doing it the normal way without x,y works without leaks?
Because i've heard from somewhere that using GUI to set positions leak.
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
To detect water...
u need a Z value for the unit. then if Z is under "waterlevel", the unit is in water.

There was a thread not so long ago which I tried to figure out and help in, but the fact is that you cant check weather the ground is water or not using the GetLocationZ function...

There is a way if you are interesting in the matter to know if its water or not, by this function:
JASS:
function IsPointWater takes real x, real y returns boolean
    return IsTerrainPathable(x,y,PATHING_TYPE_WALKABILITY) and not(IsTerrainPathable(x,y,PATHING_TYPE_AMPHIBIOUSPATHING))
endfunction
(This function doesnt exist in the blizzard files, but I found it in vexorians caster system)

2) Are you looking for this perhaps?
JASS:
native          SetUnitX            takes unit whichUnit, real newX returns nothing
constant native GetUnitX            takes unit whichUnit returns real
native          SetUnitY            takes unit whichUnit, real newY returns nothing
constant native GetUnitY            takes unit whichUnit returns real
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Yes indeed.
But note that the function name is incorect.
It should be IsPointNOTWater
 
Status
Not open for further replies.
Top