Jump to content
Sign in to follow this  
uait

objectmapper and objectgrabber?

Recommended Posts

I've had this working in the past but now I get nothing I removed the space the above ".sqf" so that's ok.

If I put a hint on the null it returns the patch of the file not true /false which it says it should.

I tried copying the file directly to the mission folder but again nothing just the path to the file.

Here's the actual code

scriptName "DynO\data\scripts\objectGrabber.sqf";
/*
File: objectGrabber.sqf
Author: Joris-Jan van 't Land

Description:
Converts a set of placed objects to an object array for the DynO mapper.
Places this information in the debug output for processing.

Parameter(s):
_this select 0: position of the anchor point
_this select 1: size of the covered area

Returns:
Success flag (Boolean)
*/

//Validate parameter count
if ((count _this) < 2) exitWith {debugLog "Log: [objectGrabber] Function requires at least 2 parameters!"; false};

private ["_anchorPos", "_anchorDim"];
_anchorPos = _this select 0;
_anchorDim = _this select 1;

//Validate parameters
if ((typeName _anchorPos) != (typeName [])) exitWith {debugLog "Log: [objectGrabber] Anchor position (0) must be an Array!"; false};
if ((typeName _anchorDim) != (typeName 0)) exitWith {debugLog "Log: [objectGrabber] Covered area size (1) must be an Number!"; false};

private ["_objs"];
_objs = nearestObjects [_anchorPos, ["All"], _anchorDim];

for "_i" from 0 to ((count _objs) - 1) do
{
private ["_obj", "_type"];
_obj = _objs select _i;

_type = typeOf _obj;

//Exclude human objects.
private ["_sim"];
_sim = getText (configFile >> "CfgVehicles" >> _type >> "simulation");
if !(_sim in ["soldier"]) then
{
	private ["_objPos", "_dX", "_dY", "_z", "_azimuth", "_fuel", "_damage"];
	_objPos = position _obj;
	_dX = (_objPos select 0) - (_anchorPos select 0);
	_dY = (_objPos select 1) - (_anchorPos select 1);
	_z = _objPos select 2;
	_azimuth = direction _obj;
	_fuel = fuel _obj;
	_damage = damage _obj;

	debugLog (format ["Log: objectGrabber: %1", [_type, [_dX, _dY, _z], _azimuth, _fuel, _damage]]);
};
};

true

I do have another grabber file which does work but it adds lots of extra quotes which all need deleting.

I'm getting "MISSINIT","grabber","utes",false,true,false] in the rpt file.

calling it with

null = [getpos player,100] execvm "ca\modules\dyno\data\scripts\objectGrabber.sqf"

or

null = [player,100] execvm "ca\modules\dyno\data\scripts\objectGrabber.sqf" 

same result for both.

Edited by F2k Sel

Share this post


Link to post
Share on other sites

ok... thank for reply...

but im not sure what to do...

well i try something! we will see!!! :)

thank you very much

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  

×