| 07-09-2007, 11:20 PM | #1 |
Okay, I have these two units in my map that have special privileges, but I need help with them. The first one has the capability to swim in heavy water. Now, since this is a survival map, I want the unit's capability to do so limited, otherwise it would be quite overpowered... Just sit in the middle of a lake and win. So as a PASSIVE ability, this unit will have the capability to swim in heavy waters at the cost of mana per second. When this unit's mana is drained, it can no longer stay afloat in the heavy waters, and it will die if caught without energy out in the middle of the lake. Is there an easy way to find out if the unit is out in heavy water at all, or do I have to use regions to do this? (I'm a dummy when it comes to triggering, so if it's overcomplicated, then I probably won't be able to manage it, but I can generally do fine with GUI.) The second unit, in case you haven't guessed by now, is going to have the ability to walk through trees without hindrance. (Basically giving her an advantage in heavily wooded areas. I don't THINK this has to be triggered, but I figured I'd just tack it onto the water one since it'd make my day easier. So do I give the unit the ability Ghost or w/e? |
| 07-09-2007, 11:30 PM | #2 |
About the trees one, I don't think Ghost does anything... otherwise Shades would be able to walk through trees... |
| 07-09-2007, 11:52 PM | #3 |
the tree one, it has to be triggered, i'm pretty sure. with the action "turn collision off" and you should be able to walk through trees.. water would be a little harder..your unit has to have the swim animation or it will apear to be just walking above the water, unless that's what you want. i'm thinking just make the unit amphibious and make all the deep water on the map a region, then make it so that all units in the region lose X mana per second. |
| 07-10-2007, 12:05 AM | #4 |
The water one will have amphibious walking patterns. I just wanted to know if there was a way to detect if the unit was in deep water or not w/o the use of regions. Will turning off a unit's collision allow it to walk over cliffs and etc? |
| 07-10-2007, 12:19 AM | #5 |
ooh yeah i never thought about cliffs, i'm not sure.. and uh, you could change the terrain tile in deep water to something you don't use anywhere else, then detect the type of terrain a unit is on instead of using regions..there's one idea. |
| 07-10-2007, 12:22 AM | #6 | |
Quote:
It'll go through everything. |
| 07-10-2007, 12:28 AM | #7 |
Bah, see, all I want the unit to be able to do is walk through trees, not over cliffs and into the deep waters for the tree walking unit. |
| 07-10-2007, 02:14 AM | #8 |
"Tree walking" as you define it is impossible to achieve. Either the unit is flying and paths over everything, has no collision and paths around everything (But can go through anything), has ghost and any other unit can path through it, or has locust and again can path through everything. You can do the waterwalking one relatively easily though with amphibious pathing. Just use IsTerrainPathable(MyUnitX, MyUnitY, PATHING_TYPE_WALKABILITY). If that function returns true, the unit is over water. Now, that returns true for shallow water and deep water, so you'd have to do a GetLocationZ() and see if it's under the shallow water cutoff. I think it's 125 or something around there. Not too tough to do overall, though. |
| 07-10-2007, 02:18 AM | #9 |
i still say checking the terrain tile of the unit's location is a good idea, and could work for trees too.. his idea is probably better for the water but.. if you made a certain tile under and around all the trees, but nowhere else, say..leaves? i dunno your map's tileset. but then if the unit is on that specific terrain tile turn off its collision, but when it goes on any other terrain it still has collision..maybe a good idea? |
| 07-10-2007, 02:22 AM | #10 |
Turning off a unit's collision does not change how they path around objects. If a ground unit has its collision turned off via triggers and you right click the other side of a patch of trees, it's still going to walk around them instead of through. That's how it works. And because of that, your idea would not work. |
| 07-10-2007, 02:25 AM | #11 |
he would walk around them if you ordered him to go to the other side, but you could walk through a patch of trees by ordering him to move small distances at a time through the trees. |
| 07-10-2007, 02:33 AM | #12 |
Yeah, but do you find that user friendly at all? You have to click in very small intervals a lot of times just to make it work, which is silly. |
| 07-10-2007, 02:42 AM | #13 |
once you're in the trees you dont have to click all frantically.. here, try out the map i attached..it works alright, some things would have to be fixed up and all..but it's a good start. |
| 07-10-2007, 03:03 AM | #14 |
On the tree walking... Well, I don't mind the unit passing through other units, but here's something I've given thought to... I can set the unit to a flying type. As such, units and trees are no problem. I can then load the terrain with pathing blockers for air units, but this still leaves me with one problem. My terrain is all shallow water that is raised, and flying units are like... 500 units above the air on that ground, even if their flying height is 0... Something isn't exactly working here I think... Any ideas? |
| 07-10-2007, 03:09 AM | #15 |
There's a gameplay constant for "Minimum Flying Height" you'd have to change. Also the fields in the OE. The only thing you'll have to worry about is the flying height smoothing factor that WC3 uses. It will be noticeable when you come near walls and stuff. I can't think of any way to successfully avert it though. |
