Detect being on water

Werbung:

Mavus

New Member
Uhh there would be a way, I don't have the editor open at the moment but it generates a massive amount of lag, I know this from experience.
 

Cokemonkey11

New Member
set all ur water to have 1 type of terrain, and make sure that type isnt anywhere else on the map, then do a trigger that says
every .5 seconds
pick every units in playable map area
if terrain type at position of picked unit equal to (whatever terrain is
at your water)
then - (do wat you want)
else - (do wat you want)
Of course it might just be easier to do rects..
 

Xeridanus

New Member
Sorry for necromancy, you can kill me later (then i'll become a lich ;P). In Vexorians caster system he has at the end some code for detecting if a point has water there or not. im not sure if it works, i think he has it around the wrong way.

[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[/JASS]
 

Maelstrom_

New Member
There is a GUI condition to detect water, its a Boolean thing. I'll open up the editor and get the line :D
______________________________________________________________
Water Check
Events
Time - Every 0.50 seconds of game time
Conditions
Actions
Set TempPoint = (Position of (w/e unit))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Terrain pathing at TempPoint of type Floatability is off) Equal to True
Then - Actions
Set TheGuyIsInWater = False
Else - Actions
Set TheGuyIsInWater = True
Custom script: call RemoveLocation(udg_TempPoint)
______________________________________________________________

Ummm something like that XD
Then you can use the Boolean variable elsewhere in another trigger.
 
Werbung:
Top