# [Trigger]Hight/Slope

Status
Not open for further replies.

#### Supermj

Level 11
Ok, for a trigger I'm making, I need one of these two things:

1) A way to detect how much slope is at a point

-or-

2) A way to detect how much higher one point is than another.

Are either of these functions possible?

#### Eleandor

Level 21
Try GetLocationZ(location) ?

#### Supermj

Level 11
Does that function say how much higher one point is than an other? I really need to learn JASS...

#### Eleandor

Level 21
No, it gets the height of a certain point. Then do the same for your second point and compare the difference...

Something like this:

• Blabla
• Custom script: set udg_RealVar1 = GetLocationZ(udg_point1)
• Custom script: set udg_RealVar2 = GetLocationZ(udg_point2)
• Set RealVar3 = RealVar1 - RealVar2
• if RealVar3 > 100 or < -100 then do stuff
Note that if the height of point 2 is greater than point 1, RealVar3 will be negative, so you'll need to check whether the result is > 100 OR < -100

Last edited:

#### Supermj

Level 11
Ok... lets see... I'll test this, and see what you think. (I'll edit this, and PM you)

#### FhelZone

Level 7
Oh, I was surprised so you are LGM in the helper xD

#### Supermj

Level 11
Shocking... I hardly make any connections to that site, that is my main site for help for triggers... and yes, i am in face LGM there... lol.

#### FhelZone

Level 7
Well, I'll try to ask Cohadar, no I'm afraid he is always busy xD

#### HINDYhat

Level 20
To get the slope of a point, you'd need something called a terrain normal (it's a vector). Anitarf made a function to get the terrain normal at a point, in his Vector Functions : http://wc3campaigns.net/showthread.php?t=87027

#### FhelZone

Level 7
Wow, to the rescue xD Thanks, I did not need to bother asking him xD

#### Supermj

Level 11
HINDYhat, do you realize what you've given me? A non-vJASSed map of exactically what I've been looking for for about 2 months, and even started to make myself! You've just saved me about 2 days of figuring things out! Thanks!!!

#### HINDYhat

Level 20
Well this is a more complete system that can do the particle physics for you : http://hilton.vs.oiccam.com/showthread.php?t=87031

Vector Functions is just a bunch of functions to help you do vector calculations, like finding a terrain normal and stuff. iNfraNe's particle system uses the Vector Functions to make a neat non-vJass'd physics system. Might be useful for you.

#### Supermj

Level 11
Man... if that's non-vJASS too, I will praise you.

Status
Not open for further replies.

Replies
5
Views
1K
[Trigger] Need help here
Replies
7
Views
700
Replies
11
Views
823
Replies
3
Views
625
Replies
3
Views
515