HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

GetTerrainVariance()

04-10-2006, 04:40 AM#1
TaintedReality
Collapse JASS:
native GetTerrainVariance (real x, real y) returns integer

What does it do exactly? After a bit of testing it seems to basically be random numbers between 0 and 20 =P. I checked it on some locations which were all connected by flat terrain, right next to each other. First I'd get numbers like 16, 16, 16, then 0, 0, 0, 0, 8, 8, 8, etc.. Then I would move downhill on a linear slope and it would go 1, 1, 1, 17, 12, 4, 4, 4, 0, 0, etc. I don't understand what it's doing, and I need it (or something that does what it implies, tells me the terrain height) for what I'm working on.
04-10-2006, 05:26 AM#2
Vuen
[edit] Nevermind, I have no idea what it is.

But it's wrapped in GUI like this:

Trigger:
Untitled Trigger 001
Events
Collapse Conditions
(Terrain variance at (Center of (Playable map area))) Equal to 0
Actions
04-10-2006, 06:25 AM#3
TaintedReality
I know that part already =P.
04-10-2006, 07:16 AM#4
Anitarf
Could it be the tile variation?

For terrain height, use GetLocationZ().
04-10-2006, 03:16 PM#5
TaintedReality
Ah, that's what I needed. Still kind of curious about this but I just needed GetLocationZ(). Thanks.
04-10-2006, 04:03 PM#6
Vuen
Quote:
Originally Posted by Anitarf
Could it be the tile variation?

For terrain height, use GetLocationZ().

Well tile variation is what I wrote at first, but I edited it out because that couldn't possibly be it based on the values he was getting. Variation has nothing to do with slopes, and he should get approximately random numbers between 1 and 8 or so.