Search the Community
Showing results for tags 'highest'.
Found 1 result
-
Highest Position Between Two Points
beno_83au posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Good evening. I've been trying to come up with a way to select the highest terrain position along a line (or within a thinly defined area to be precise) and have managed to come up with a fairly rough way to go about it: private _hpStart = getMarkerPos "hpStart"; private _hpEnd = getMarkerPos "hpEnd"; HighestPoint = [0,0,0]; for "_i" from 1 to 10 do { _highestPos = [ [[_hpStart getPos [(_hpStart distance _hpEnd)/2,_hpStart getDir _hpEnd],[50,(_hpStart distance _hpEnd)/2,_hpStart getDir _hpEnd,true]]], [], { if (((AGLtoASL _this) select 2) > (HighestPoint select 2)) then { HighestPoint = AGLtoASL _this; }; ((AGLtoASL _this) select 2) > (HighestPoint select 2) } ] call BIS_fnc_randomPos; }; systemChat format["Highest position found at: %1",HighestPoint]; _markerstr = createMarker [format["m%1",time],HighestPoint]; _markerstr setMarkerShape "ICON"; _markerstr setMarkerType "hd_dot"; _markerstr setMarkerColor "ColorGreen"; _markerstr setMarkerText "Highest position"; The two markers, "hpStart" and "hpEnd" are editor placed, and seeing as BIS_fnc_randomPos only runs 100 times I bumped that amount up to 1000 to see if I got any incorrect results, which I didn't (even after running it A LOT MORE times). Is there a better way to do this that I have not found?