Check if water is in range of unit

dudeim

New Member
Reaction score
22
Heej all,

i've been trying to create a spell but i can't find one part of the trigger so here is my question...

Is it possible to check if within 1500 range of the unit there is some water? cus you can check for terrain types but couldn't find water (maybe overlooked it)

Thanks
 

SomaZ

New Member
Reaction score
3
This is a tough one. I suggest you take a rectangle, and divide it into many squares. Make it of some size you want (like 50x50 or something) and make a point in every of those squares. Then check every point wether "Amphibious" pathing (or walking, or something like that) is available in that point AND AT THE SAME TIME simple Walking isn't available there. That will mean that it's water. If you find one, then check the distance from it to your unit. If it is within 1500 AoE then exit the loop (stop checking the points).

Kind of complex, everything has to be done with code, but that's the only way you can do it (or use a different algorithm). May lag, I don't know.

Hope I helped.
 

Igor_Z

You can change this now in User CP.
Reaction score
61
I got an idea but its kinda crazy... I think you should create regions where you have a water terrain. And then check if a unit is in 1500 range of region. I think that is your best solution. My advise is only for GUI, i don't know JASS and i don't know if it is possible in JASS. But u might have a problem because the region's length and width cannot be changed good(in other words u can't rotate it how u want :()
 

CuteCumber

Member
Reaction score
4
Or maybe, u can create a dummy unit at the water terrain with an aura ability, set the datas to 0, AoE to 1500 and affected to self(maybe), check whether it has the 'water around' buff. If true, then do your stuffs.
 

dudeim

New Member
Reaction score
22
thanks for the replys, but i'm thinking of doing something else cus it's a bit to complicated i think...
 

Hellohihi

New Member
Reaction score
42
Trigger:
  • Conditions
    • (Terrain pathing at (Position of (Triggering unit)) of type Amphibious Pathing is off) Equal to False
 

TwoHeadedBoy

New Member
Reaction score
6
Couldnt you create a unit that requires amphibious pathing, so when created, it will jump to the nearest water. Then check how far away that created unit is from the triggering unit?
 

SomaZ

New Member
Reaction score
3
Fist of all amphibious units can walk on normal ground.

Second: if you think the thing I suggested is too complicated (and other things suggested) then you're better off without this skill/w/e as it is too advanced for you.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top