Ok well, for those of you who don't want to download, unzip, and run the files I included I'll include the important stuff below... I realized a lot of you might have A.D.D.
MISSION.SQM
3 objects on map. 1 soldier (man), 1 jeep (jeep), 1 trigger (sealeveltrig). Man has "[man,jeep] exec "logic_getheightdif.sqs"" as INIT. This starts the script going.
INIT.SQS
sealeveltrig setPos [0,0,0];
GetHeight = preProcessFile "func_getheight.sqf"
LOGIC_GETHEIGHTDIF.SQS
; ***************************************
; Initialize input variables
_obj1 = _this select 0;
_obj2 = _this select 1;
sealeveltrig setPos [0,0,0];
; *************************************************************************************
; Find height of each of the two objects above sea level and then calc the difference
_obj1h = [_obj1] call GetHeight
_obj2h = [_obj2] call GetHeight
_dif = _obj1h - _obj2h
hint format ["Debug Info...\nObj1h: %1 \nObj2h: %2 \nDif: %3", _obj1h, _obj2h, _dif]
FUNC_GETHEIGHT.SQF
// *************************************************************************************
// Initialize variables
_obj = _this select 0;
// *************************************************************************************
// Find the height of the object
sealeveltrig setPos [0,0,0];
_3ddist = _obj distance ABS;
_a = (getpos _obj select 0)^2;
_b = (getpos _obj select 1)^2;
_2ddist = sqrt (_a + _b);
objh = sqrt ((_3ddist ^ 2) - (_2ddist ^ 2))
Somewhere along the way the function is not passing any values back to the script Logic_GetHeightDif.sqs. Or perhaps the function isn't running at all, it's damn hard to tell.