Jump to content
Sign in to follow this  
gaga11

Script Bambie - BIS_fnc_findSafePos with Blacklisted area.. not working :(

Recommended Posts

i wanted to do a findsafepos with a blacklisted area...

/*
File: findSafePos.sqf
Author: Joris-Jan van 't Land

Description:
Function to retrieve and dynamic position in the world according to several parameters.

Parameter(s):
_this select 0: center position (Array)
					Note: passing [] (empty Array), the world's safePositionAnchor entry will be used.
_this select 1: minimum distance from the center position (Number)
_this select 2: maximum distance from the center position (Number)
					Note: passing -1, the world's safePositionRadius entry will be used.
_this select 3: minimum distance from the nearest object (Number)
_this select 4: water mode (Number)
					0: cannot be in water
					1: can either be in water or not
					2: must be in water
_this select 5: maximum terrain gradient (average altitude difference in meters - Number)
_this select 6: shore mode (Number):
					0: does not have to be at a shore
					1: must be at a shore
_this select 7: (optional) blacklist (Array of Arrays):
					(_this select 7) select X: Top-left and bottom-right coordinates of blacklisted area (Array)
_this select 8: (optional) default positions (Array of Arrays):
					(_this select 8) select 0: default position on land (Array)
					(_this select 8) select 1: default position on water (Array)

*/

pretty new to arma scripting, been looking around and what i found out about the blacklist stuff is, that it needs to be an array of array

first array are top left corner x and y coords

second lower right corner x and y coords

this is what i got:

_blacklist = [[0.101, 15360.1], [11075.6,5328.23]];
_spawnMarker = [8910.85,3474.14];
_preWaypointPos = [_spawnMarker,0,8000,10,0,1000,0,_blacklist] call BIS_fnc_findSafePos;

result:

17:41:28 Error in expression <"_maxX", "_minY", "_maxY"];
_minX = _tl select 0;
_maxX = _br select 0;
_minY = >
17:41:28   Error position: <select 0;
_maxX = _br select 0;
_minY = >
17:41:28   Error select: Type Number, expected Array,Config entry
17:41:28 File ca\modules\functions\misc\fn_isPosBlacklisted.sqf, line 37

so it got a number but expected an array? wut? :(

halp? :(

Edited by gaga11

Share this post


Link to post
Share on other sites

You need to nest the array one more level. So add extra brackets

_blacklist = [[[0.101, 15360.1],[11075.6,5328.23]]];

Share this post


Link to post
Share on other sites
You need to nest the array one more level. So add extra brackets

_blacklist = [[[0.101, 15360.1],[11075.6,5328.23]]];

an array of array with possion arrays

derp..

thanks it works!

Share this post


Link to post
Share on other sites
Guest

Small BlackList areas are not effective?

I'm trying to black list vehicles (car, helis, etc) since the function ignore then when finding the position. Its not working.

 

EDIT: small Balck listed areas works ok. Error was on my side. 

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  

×