yes...from there...and i use google translate when it is german i cant read:
list page:
Quote
terrain
Categories: misc, return
Sorry, not available in english!
Returns or modifies the height of the terrain at a specific location.
The position is set with X and Z. About mode is decided on what should be done:
0 - the height of the terrain is returned as a value between 0-100 (the height parameter can not be specified here!)
1 - the terrain is set to the specified altitude (value between 0-100)
2 - the terrain is changed by the specified height (negative values for lowering)
3 - returns the corresponding X position in the terrain matrix. Not every 3D coordinate has an associated coordinate in the terrain (since the terrain has only a limited number of vertices).
4 - returns the corresponding Z position in the terrain matrix (see FIG. 3).
The height is given with this command with a value between 0 and 100. Here, 0 stands for very low, 100 for very high. At about 50, the sea level is. Only in mode 1 and 2 can the height parameter be specified
If you search the command in the search box a second view is shown that has additional syntax information. See below I searched the command terrain and it now shows more syntax. Terrain X, Z, mode [, height]
searched:
Quote
Terrain X, Z, mode [, height]
Categories: misc, return
Sorry, not available in english!
Returns or modifies the height of the terrain at a specific location.
The position is set with X and Z. About mode is decided on what should be done:
0 - the height of the terrain is returned as a value between 0-100 (the height parameter can not be specified here!)
1 - the terrain is set to the specified altitude (value between 0-100)
2 - the terrain is changed by the specified height (negative values for lowering)
3 - returns the corresponding X position in the terrain matrix. Not every 3D coordinate has an associated coordinate in the terrain (since the terrain has only a limited number of vertices).
4 - returns the corresponding Z position in the terrain matrix (see FIG. 3).
The height is given with this command with a value between 0 and 100. Here, 0 stands for very low, 100 for very high. At about 50, the sea level is. Only in mode 1 and 2 can the height parameter be specified
Since the terrany does not show any detail of it's syntax on the LIST page, I put terrainy in the search box and it shows another view that has more syntax. See below I searched and you see it says terrainy x,y instead of just terrainy. There is two pages for every command it seems and I just figured that out on my own one day.
list page:
Quote
terrainy
Categories: return
Returns the height of the terrain at a certain position.
Water surface is Y=0, under water is Y<0 and over water is Y>0.
searched:
Quote
terrainy X, Z
Categories: return
Returns the height of the terrain at a certain position.
Water surface is Y=0, under water is Y<0 and over water is Y>0.
you just need to figure out when and where to put ( ) and " " sometimes.
No it's not convenient, but it is what I do...I don't know what else to say to help you...only that there is a learning curve and once you build enough of your own scripts you begin to understand the syntax better. I have worked on my mod for 3 years now, and have added over 1,000,000 million lines of script, (no joke) so it is very easy for me to figure out scripts and syntax. My first 3 months I struggled, just like you are now. It is what it is...once you find a command your interested in search it in the search box for more detail syntax...if you click the sub-categories at the top they also will show this "detailed" syntax...i dont know why it does not show in the LIST pages.
-------------------------------
Quote
And there is no error message, it just is not executed, but moves on as if that code was not there...
Hmm...did you make only 1 on:dig now? I do not think you can have 2, like i said before.
get rid of the 1st testing on:dig and try this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
on:dig {
speech "positive";
msg "Digging!",4;
$x=getx("unit",1);
$z=getz("unit",1);
$tmp=terrainy($x,$z);
if (($tmp >= 0) && ($tmp <= 50)){
speech "positive";
msg "I am on is a beach!",4;
}else{
speech "negative";
msg "This is not a beach!",3;
}
}
edited 4×, last 30.01.17 02:45:20 pm