Problem: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.
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.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.
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.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
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.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.