1.) Line the coast with locations, and when a unit tries to go to the locations, it's moved back to another location.
Pros: Does not require a location to be centered on the sea unit, thus you can have more than one of each unit.
Cons: Uses craploads of locations, and is rather unprofessional. Also, the comp would probably be too stupid to go around the locations.
2.) Have two locations centered on the sea unit (one that constantly follows it and another that moves to it when it's moved out of it), and have a ground unit constantly be moved to the first location by triggers. If the unit is over sea or impassable terrain, nothing happens. If the unit goes over walkable land, the unit is moved to the location, which activates a trigger that orders the sea unit back to the second location, which should still be in the water terrain.
Pros: Doesn't use a lot of locations and is rather simple to trigger.
Cons: Can only be used for one of each unit since it requires a location to be centered on the unit. Also does not account for sea doodads and tiny islands (or cliffs that might be close to shore).
3.) Have one big location over the areas of water. Then uncheck "Low Air" on the location properties. Make a trigger that performs whatever action (probably moving the sea unit to another location or maybe killing it, depending on the circumstances) when the sea unit goes to that location. Now, since "Low Air" is unchecked, the sea terrain is not part of the location. However, according to the tutorial by UnholyUrine, dirt IS part of the location, so the trigger while fire when the sea unit goes on it.
Pros: Very simple to make, doesn't use many locations, and can work with as many units as needed.
Cons: Unfortunately, UnholyUrine's tutorial wasn't completely accurate. Dirt IS low terrain (like sea terrain) and is therefore NOT part of the location. This is for every tileset, according to both my experiences and this tutorial: http://doodle77.dyndns.org/tutorials.php?id=416
So this technique actually only works when the coast is lined with high dirt or some other high terrain. I suppose I could just use the high water trick (to make the coast high dirt) and then blend it with the dirt, but that'd make the coast a vantage point for archers and such over inland areas (since units on low terrain can't see units on high terrain unless they attack them and ranged units on low terrain will often miss shots against units on higher terrain), which wouldn't make a whole lot of sense.
Anyone got any other ideas that might work for making air units that won't cross land?
None.