| 01-07-2009, 02:48 AM | #1 |
By using GetTerrainCliffLevel(real x, real y), this will allow me to find the terrain height of a location. Alright, I understand that, then I noticed that it returns an integer? Okay, so where exactly does terrain height start counting off? Like this? Deep Water: 0 Shore Water: 1 Surface: 2 Cliffs: 3+ Or is it like this? Cliffs: 1+ Surface: 0 Shore Water: -1 Deep Water: -2 EDIT: Or is it neither? If then, how does this work? |
| 01-07-2009, 04:10 AM | #2 |
When you create a map, there is a selection called "Initial Cliff Level". Well that function returns the current cliff level at the specified point (default is 2). Using the cliff tool (not the raise tool) will allow for different cliff heights, thus making the function return different values. What would it be good for? Well you can make ranged attacks deal more damage shooting down a cliff level and make them deal less damage shooting up (unless the game already does this, I'm not too sure). |
| 01-07-2009, 04:23 AM | #3 | |
Quote:
Damn. I was just about to supply the same answer. Regarding ranged attacks, I've never seen any gameplay constants regarding damage relative to cliff height so I must assume the game doesn't already do that. |
| 01-07-2009, 04:25 AM | #4 |
There's a mischance for shooting at the bottom of a ramp to the top, possibly for shotting from the bottom of the cliff to the top aswell. I don't think any other cliff based damage calculations are done. GetTerranCliffLevel will not tell you if you terrain is land/sea for which you need GetTerrainType. Although, I don't know if GetTerrainType even returns if something is sea or not. I beileive there are custom functions in the script section that will tell you these things, though. |
| 01-07-2009, 10:05 AM | #5 |
if u wanna detect water n ground, i suggest u use 2 units, 1 floating and 1 ground, move them to same position, get their absolute height. and if the height is different, its water. and when u know its water, check for how big the difference is then u will know if its deep or shore water. i forgot the numbers but this will do it |
| 01-07-2009, 12:20 PM | #6 |
I think Ignitedstar wants GetLocationZ? Or you're just curious about this terrain organization system? |
| 01-07-2009, 11:26 PM | #7 | |
I got curious when I was experimenting on how I could determine whether or not a unit is above or in/under water. Submerge does this well, because it changes a unit's animations from normal animations to swim animations- assuming that the unit has alternate animations for water. Quote:
About the height mischance... If this "experiment" is successful, I could do that as well... Hmm-mmm @Zerzax: Using GetLocationZ could work. If anyone knows the height of the water plane- or even an estimate of the water plane, it would be easy to do, because all I'd need to look for then is whether or not the caster is below that height. Although... When using GetLocationX, Y, or Z, this refers to finding the real points of where the origin (like when attaching stuff) of the unit is, doesn't it? If this is true, the origin's location on the Z-axis is slightly above the terrain, or it might even be dependent on the scaling value of the unit. I'm wondering that, because it could misjudge for units with different scaling values. For example, a footman with a scaling value of 10 may be considered above the water, but a footman with normal scaling might be considered under water. I might have escaped from the actual problem, though. Ammorth said that the "initial cliff level" is 2, at default, so does the scale start from 2? I'll look into this. |
| 01-08-2009, 05:20 AM | #8 |
The initial cliff level is whatever it is, and the base is always 0 (or 1, if that's as low as it goes). When you create a map you select the "initial cliff level". If you set that to, say, 10, and then after doing that you immediately called GetTerrainCliffLevel(0.00, 0.00) it would return 10. If you used the cliff tool and made a 1-level cliff and then called it again, it would return 11. |
| 01-09-2009, 12:35 AM | #9 |
Oh, okay. So I can use GetTerrainCliffLevel to do that, then. It's a lot easier than GetLocationZ. I want to try this out. Thanks, Pyro. |
