Please helpme out here I have no idea what does the script mean at all =_=!
this line of custom script does the following:
it "call"s a function
the function which is called is called "MoveLightningEx" so it moves a lightning and is the extended version of some other function (which is MoveLightning)
MoveLightningEx takes a few parameters which are:
1. a lightning
2. a boolean (if this is true the lightning won't be shown to players who would be unable to see the lightning because of fog)
3. -8. real values
3. start x of lightning
4. start y of lightning
5. start z of lightning
same for 6-8 but with end instead of start
and the z variable is the z height above mean sea level (or however it is called in wc3)
so as soon as you have different height levels in your map the lightning will look awkward
to fix this you will have take the terrain height into consideration
you get the terrain height by creating (or moving) a location to the point where you want to know the height from and then call the function "GetTerrainZ(location)" which will return the height at this point
in custom script this will look like:
-
Custom script: call MoveLocation(udg_loc, udg_x, udg_y)
-
Custom script: set udg_z = GetLocationZ(udg_loc)
you will have to create the location first because you can't move something which is not there
also you need x and y variables
They are not pre-defined to take up memory space or something. I create the array and use only four values, I just did it to save time in writing, since I was not in front of my World Editor; but still, I don't think I did something wrong
Unnecessary doesn't mean inefficient.
creating the array is faster than creating 4 local variables
but as soon as the array variables are dereferenced it is slower even including the speed advantage from declaration