Jump to content
Sign in to follow this  
1para{god-father}

getpos Height

Recommended Posts

OK having an issue !

If I stack a few objects on top of each then try and get the Relative height of the object for some reason it only ever shows the vertical position above the object beneath it & places them all on the ground :(

using this :-

	_relElevation = (getPos _x) select 2;

wikik " it returns the vertical position above the object beneath it"


#define conFile(_msg) "debug_console" callExtension (_msg + "~0000")
#define conFileTime(_msg) "debug_console" callExtension (_msg + "~0001")

if ( isNil "KK_fnc_PTspecial" )			then { KK_fnc_PTspecial			= compile preProcessFileLineNumbers "KK_fnc_PTspecial.sqf"; };
if ( isNil "KK_fnc_floatToString" )		then { KK_fnc_floatToString		= compile preProcessFileLineNumbers "KK_fnc_floatToString.sqf"; };
_northing = 0;
_easting = 200000;
conFileTime( "--------------------------------" );
conFileTime( "----- BEGIN  OUTPUT -----" );
conFileTime( "--------------------------------" );

{
private [ "_objType", "_spawnType", "_posATL", "_dir", "_pitchBank", "_pitch", "_bank", "_msg" ];

if ! ( _x isKindOf "Animal" ) then
{
	_objType = typeOf _x;
	_spawnType = "CAN_COLLIDE";
//	_posASL = ( getPosASL _x ) call KK_fnc_PTspecial;
//	_posATL = ( getPosATL _x );

	_xPos = _easting + ((getPos _x) select 0);
	_yPos = _northing + ((getPos _x) select 1);
	_pitchBank = _x call BIS_fnc_getPitchBank;
	_pitch = _pitchBank select 0;
	_bank = _pitchBank select 1;
	_dir = getDir _x;
	_modelRaw = getText ( configFile >> "CfgVehicles" >> ( typeOf _x ) >> "model" );
	_modelX = [ _modelRaw, "\" ] call BIS_fnc_splitString;
	_modelCom = _modelX select ( count _modelX - 1 );
	_modelY = [ _modelCom, "." ] call BIS_fnc_splitString;
	_model = _modelY select 0;
	_relElevation = (getPos _x) select 2;
	_output = format [ '"%1";%2;%3;%4;0.0;0.0;1.0;%5', _model, _xPos, _ypos, _dir ,_relElevation];
	conFile(_output);
};

} forEach ( curatorEditableObjects myZeusModule );

Share this post


Link to post
Share on other sites

try using getPosWorld or at least getPosASL

Share this post


Link to post
Share on other sites
try using getPosWorld or at least getPosASL

Well to be perfectly honest, a simple getPosATL will be sufficient, this command pairs nicely with setPosATL

Many thanks - any idea how to get an accurate Pitch / Bank as the BIS func is terrible and is very hit / miss

If the built-in BIS function's aren't very good, you can take a crack with the vectorDir and vectorUp commands, but that's about all I can tell you, as I don't know much about vectors.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×