Detecting Water?

wingdnosring

New Member
Reaction score
16
Simple question: Is there a [trigger] condition that allows me to check whether a unit is standing on/in water or not? I plan on putting this in a library for others to use, so I can't use pre-created regions.
 

Frozenwind

System maker
Reaction score
99
Got an alternative... Maybe.

Are there any spots on your map with cliff heights (not terrain heights) equal to the height at the point the water is placed at?

If not, you can use the integer comparison "cliff height at point == 0" (0 is most-likely your lowest height and thus the cliff height at the water area. This will also filter the non-visible water because it's "underground").

Atm, I don't have a different solution (Besides regions but meh. You could eventually cover a region over the entire water area for a 2nd check, in case you have low cliffs without water. That's what I do in my map actually).
 

Trouble

New Member
Reaction score
0
Cover any water with regions.. Name them all Water 1-xx for easy reference. Then, when you're trying to check if a unit's in water, just check if it's in any of those regions.
 

Frozenwind

System maker
Reaction score
99
Cover any water with regions.. Name them all Water 1-xx for easy reference. Then, when you're trying to check if a unit's in water, just check if it's in any of those regions.

Problem:
Regions are circular or rectangular. Now, if you have a snake-ish river, you'll need 100 regions for a rather small area to make it accurate.
 

Severon

New Member
Reaction score
7
Problem:
Regions are circular or rectangular. Now, if you have a snake-ish river, you'll need 100 regions for a rather small area to make it accurate.

Sounds like a job for limits! Though I don't think this would be vary praticle to put in a triggerXD
 

wingdnosring

New Member
Reaction score
16
Well as I said, this is going in a Library, so it has to be triggered. It can't involve regions of cliff heights because somebody else using my library may have their water in a different place.

There's gotta be a way to do this without regions...could the water blocks be considered doodads or something?
 

Frozenwind

System maker
Reaction score
99
If you use your GUI search, you'll see that it isn't possible to detect whether there is water.

However, if you try explaining what exactly you need it for (besides a library), we might be able to work out a "work-around".
 

Cheekything

TH.net Regular
Reaction score
5
Is there a way to detect terrain tiles?

As I don't think it'd be called water, due to the lava and lack of boats.
 

Trouble

New Member
Reaction score
0
Is there a way to detect terrain tiles?

As I don't think it'd be called water, due to the lava and lack of boats.

Only possible in WCIII through JASS. Dunno if it can be done without regions. The new DOTA has an ability which detects if the unit is in/near water, but I'm pretty sure they used either "distance from point" and placed points along the center of the river, or regions.
 

SineCosine

I'm still looking for my Tangent
Reaction score
77
And Trouble has just found your alternative ._.
Create a doodad/unit (It'll be used as your water 'marker', we'll say that it's code is 'wter')

Then, on map initialization, make a trigger 'grab' all units of type 'wter' and create a trigger that fires when a unit enters within range.

That trigger that's fired will:
1. Check if the unit is already in a group, (We'll call it 'soaked')
2. If not, add the unit to group, soaked

Then have a function like isUnitSubmerged(whichUnit)
The function will check if the unit is in the group soaked and return a boolean.

Then, every.. 1 second? have a function that loops through each unit in the group 'soaked'.
For each unit, get all units around that unit and see if any of the units are of type 'wter' if there aren't any, remove the selected unit from 'soaked'

Or something like that..
I don't use SC2, I just happened to be passing by =x
 

Frozenwind

System maker
Reaction score
99
In that dota they might scan around your unit whether the cliff height equals 0 at your location or near your location. Afaik, dota doesn't have any other cliffs at that height besides water?

Points would take so much time to make it be accurate.
 

Trouble

New Member
Reaction score
0
And Trouble has just found your alternative ._.
Create a doodad/unit (It'll be used as your water 'marker', we'll say that it's code is 'wter')

Then, on map initialization, make a trigger 'grab' all units of type 'wter' and create a trigger that fires when a unit enters within range.

That trigger that's fired will:
1. Check if the unit is already in a group, (We'll call it 'soaked')
2. If not, add the unit to group, soaked

Then have a function like isUnitSubmerged(whichUnit)
The function will check if the unit is in the group soaked and return a boolean.

Then, every.. 1 second? have a function that loops through each unit in the group 'soaked'.
For each unit, get all units around that unit and see if any of the units are of type 'wter' if there aren't any, remove the selected unit from 'soaked'

Or something like that..
I don't use SC2, I just happened to be passing by =x

Instead of the loop, it would be more efficient to use the "leaves range of.." function. It's the same GUI option as "enters range of..", just a different selection. And you don't need to use units/doodads - there's a function for points, and a very easy point placer.

Frozenwind - Nah, not so much. All you need to do is figure out the width of your river, divide it by two, and set the trigger to fire when unit comes within range x of point x, then place points at intervals along the river.
 

Frozenwind

System maker
Reaction score
99
Instead of the loop, it would be more efficient to use the "leaves range of.." function. It's the same GUI option as "enters range of..", just a different selection. And you don't need to use units/doodads - there's a function for points, and a very easy point placer.

Frozenwind - Nah, not so much. All you need to do is figure out the width of your river, divide it by two, and set the trigger to fire when unit comes within range x of point x, then place points at intervals along the river.
Yes, but that's a lot of preplace work (and furthermore a lot of preset work in the enter/leave event), which I always try to prevent.
 

wingdnosring

New Member
Reaction score
16
Yeah that is a bit of a pain, but it would definitely work. I've created a third person shooter library for people to use (it's quite impressive actually, if I do say so myself) and I have different actors that display depending on where bullets land. It came to my attention that hitting water still stirred up dust or sparks, when it should really produce ripples or splashes.

The only problem I forsee with this preplaced object theory is that you won't be able to tell whether the bullets landed 'in' the water or on the raised land around it, which hides some of the water boxes from view.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    Actually I was just playing with having some kind of mention of the food forum and recipes on the main page to test and see if it would engage some of those people to post something. It is just weird to get so much traffic and no engagement
  • The Helper The Helper:
    So what it really is me trying to implement some kind of better site navigation not change the whole theme of the site
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top