Jump to content
Sign in to follow this  
HazJ

Check if object in marker

Recommended Posts

Hello,

I am rewriting a mission for 1.64 EOL. It is a total pain sometimes as being so used to A3 and all. A lot of commands and functions are not available. What I am a looking for is an equivalent of inArea command or inTrigger? I want to check if an object is inside a marker. Although BIS_fnc_inTrigger is in A2, the marker syntax (STRING) doesn't appear to be.

Quote

 Error position: Type String, expected Object,Location
File ca\modules\functions\misc\fn_inTrigger.sqf, line 23

Anyone know? If not, I'll just have to write my own function. Just wanted to see if there is something already.

Share this post


Link to post
Share on other sites

Not tested, but maybe try using blacklist checking.

 

_item = "myMarkerName";

_newlist = [];

 

// from ACM's blacklistArea function (BIS_ACM_blacklistAreaFunc), registering a blacklist marker area,

// _tl and _br represent top-left and bottom-right positions of the marker:

private ["_pos", "_size", "_tl", "_br"];
_pos = markerPos _item;
_size = markerSize _item;
_tl = [(_pos select 0) - (_size select 0), (_pos select 1) + (_size select 1)];
_br = [(_pos select 0) + (_size select 0), (_pos select 1) - (_size select 1)];


_newList = _newList + [[_tl, _br]];

//  Should return true if object position is in the marker boundaries.

_inArea = [(position _object), _newlist] call BIS_fnc_isPosBlacklisted;

  • Like 1

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  

×