Hi everyone, Im just trying to figure out what I would use to verify like..the height of a given location before a unit is created and placed there. Also to see if it is a pathable location. Thanks!
is there a way to relocate a point? and would the height be adjusted if the new position was on higher terrain? or would it just be buried in the ground?
I don't know if moving triggers also changes the height. I would say so, but I'm not certain. So your best bet is to just try it out.
And yes, the DisplayMessage only accepts TEXT (not string). Text is basically a string, but has some knacks to it. But you can type-cast a value into a text like this:
When you use FixedToText() you have to give it the value to be changed and the precision. precision is the amount of decimal places that the text will show (in this example it's 2).
A good idea to learn galaxy is to write your stuff in GUI triggers first, then click on View Map Script (either with CRTL+F11 or there's an option in the menu tabs) and see how the triggers turn into script.
Almost everything can be done in GUI so it's a great reference for 95% of the entire galaxy API.
Another good way is to check the entire API list. I can attach it to this post, one sec..
Hmm Is there a way to tell the difference between a unit on a cliff and one on low ground...in the example picture Ive attached both units return a height of 0.
Heed my advice and look in the GUI triggers or the API list ;)
nativeintCliffLevel(pointinPos);
So:
if(CliffLevel(Point(x,y))==1){//Cliff has height 1. (don't know what the default cliff height is. You gotta check that.)}if(CliffLevel(Point(x,y))>CliffLevel(Point(x2,y2))){//Cliff level at point (x,y) is larger than at point (x2,y2)}
Hmm Is there a way to tell the difference between a unit on a cliff and one on low ground...in the example picture Ive attached both units return a height of 0.
Unit height is a relative value that represents the height the unit is off the ground plane.....
How you get the ground planes Height Im not exactly sure .
Hi everyone, Im just trying to figure out what I would use to verify like..the height of a given location before a unit is created and placed there. Also to see if it is a pathable location. Thanks!
If you want a solution not in galaxy script but in normal GUI triggers then please ask this question in the trigger section instead ;)
i def want script answers, thanks for the reply! any tips on learning galaxy other than blindly searching on here and comparing trigger scripts?
bool gt_Testrigger_Func (bool testConds, bool runActions) { Actions point myPoint; if (!runActions) { return true; }
myPoint = UnitGetPosition(UnitFromId(1));
UIDisplayMessage(PlayerGroupAll(), c_messageAreaChat, PointGetHeight(myPoint));
return true; }
the large line gives an error, does this param only accept string?
is there a way to relocate a point? and would the height be adjusted if the new position was on higher terrain? or would it just be buried in the ground?
What do you mean by relocating a point? Do you mean changing it's X or Y value? Only works by making a new point:
I don't know if moving triggers also changes the height. I would say so, but I'm not certain. So your best bet is to just try it out.
And yes, the DisplayMessage only accepts TEXT (not string). Text is basically a string, but has some knacks to it. But you can type-cast a value into a text like this:
When you use FixedToText() you have to give it the value to be changed and the precision. precision is the amount of decimal places that the text will show (in this example it's 2).
A good idea to learn galaxy is to write your stuff in GUI triggers first, then click on View Map Script (either with CRTL+F11 or there's an option in the menu tabs) and see how the triggers turn into script. Almost everything can be done in GUI so it's a great reference for 95% of the entire galaxy API. Another good way is to check the entire API list. I can attach it to this post, one sec..
yea..i guess thats all that can be expected this close to the launch..thanks for the help dude. : )
Hmm Is there a way to tell the difference between a unit on a cliff and one on low ground...in the example picture Ive attached both units return a height of 0.
Heed my advice and look in the GUI triggers or the API list ;)
So:
thanks..i actually did that right after the post..worked great!
CliffLevel returns an int, so is sufficient for cliffs, but if you want subtle height differences as well (on a ramp for example), use:
PointPathingCliffLevel( Point(x,y) )
Also, if you want to make a new point based on another one, the following functions should help:
PointWithOffset( point orgpos, fixed x, fixed y )
PointWithOffsetPolar( point orgpos, fixed distance, fixed angle )
Unit height is a relative value that represents the height the unit is off the ground plane.....
How you get the ground planes Height Im not exactly sure .
WorldHeight(c_heightMapGround, point);
that returns the height of the ground at a point