Jump to content
xBowBii

BIS_fnc_findSafePos broken?

Recommended Posts

Hey guys,

 

I can't get BIS_fnc_findSafePos to work, my RPT is getting spammed by this error message:

 

Error in expression < BIS_fnc_isPosBlacklisted)) then
{
if ((_pos distance _testPos) >= _minDist) the>
  Error position: <_pos distance _testPos) >= _minDist) the>
  Error Undefined variable in expression: _pos
File A3\functions_f\misc\fn_findSafePos.sqf, line 98
Error in expression <["_newX", "_newY", "_testPos"];
_newX = _posX + (_maxDist - (random (_maxDist * >
  Error position: <_posX + (_maxDist - (random (_maxDist * >
  Error Undefined variable in expression: _posx
File A3\functions_f\misc\fn_findSafePos.sqf, line 90

When executing this code:

_position = [[14291,14854,0],0,12000,5,0,20,0] call BIS_fnc_findSafePos;

Is the function broken?

 

Thanks,

xBowBii

Share this post


Link to post
Share on other sites

Works for me, i simply placed your call in the init.sqf of a 1 man mission, ran it and checked the value with 

 

systemchat format ["Position: %1",true];

 

which returned TRUE.

 

I can only assume your code is broken somewhere before that line is called

 

Ignore this, I was having a senior moment

Share this post


Link to post
Share on other sites

@terox

systemchat format ["Position: %1",true];

Will always display the string "Position: true" in systemChannel, even when the called function before throws an error.

@xBowBii

Your example is working fine.

_position = [[14291,14854,0],0,12000,5,0,20,0] call BIS_fnc_findSafePos;

//Returns: _position == [18801.8,21845.5] on Map VR

//productVersion = ["Arma 3","Arma3",152,132676,"Stable",false]

  • Like 1

Share this post


Link to post
Share on other sites

@terox

systemchat format ["Position: %1",true];

Will always display the string "Position: true" in systemChannel, even when the called function before throws an error.

@xBowBii

Your example is working fine.

_position = [[14291,14854,0],0,12000,5,0,20,0] call BIS_fnc_findSafePos;

//Returns: _position == [18801.8,21845.5] on Map VR

//productVersion = ["Arma 3","Arma3",152,132676,"Stable",false]

 

Could you try on Altis? I always get that error when executing that code on altis.. In the VR map it works like a charm..

 

 

Works for me, i simply placed your call in the init.sqf of a 1 man mission, ran it and checked the value with 

 

systemchat format ["Position: %1",true];

 

which returned TRUE.

 

I can only assume your code is broken somewhere before that line is called

Uh? It doesn't matter if the code after my code is working, the game just throws an error when executing my code ;) 

 

But thanks in advance for the help guys, I appreciate it :)

Share this post


Link to post
Share on other sites

Executed several times on Altis, with no errors showing up.

Do you use the same version of Arma3, maybe you opted into the Dev Branch and something is broken there, idk.
Make sure you use the stable/release branch and also verify the integrity of the gamecache (both in Steam: Library -> Rightklick on Arma3 -> Properties) and als try it without any mods loaded.

Share this post


Link to post
Share on other sites

It shouldn't matter if there are any objects or if there is water on the terrain, it was for testing if the function is somehow broken when feeded with the parameters xBowBii postet.

But I also tested it on the same Island where he got the error, see my last post.

  • Like 1

Share this post


Link to post
Share on other sites

Hi,

 

so i'm not into arma3, i "still" like arma2 and i noticed on arma2 BIS_fnc_findSafePos is critically malfunctioning, when you call it a few in a row. On Napf it will output Position: [10240,10240,800] after a few times. Here an Example from an script i was working on:

 

diag_log format ["[Dog] - Var is: %1",_var];

_tmpPos =  [_var, 1, 5, 3, 1, 20, 0] call BIS_fnc_findSafePos;

diag_log format ["[Dog] - Tmp Pos is: %1",_tmpPos];

 

"[Dog] - Var is: [13423.6,13258.7,0]"
"[Dog] - Tmp Pos is: [13428.5,13262.9]"
"[Dog] - Var is: [13426.2,13248.9,0]"
"[Dog] - Tmp Pos is: [13427.1,13253.2]"
"[Dog] - Var is: [13426.7,13238.8,0]"
"[Dog] - Tmp Pos is: [13421.7,13242.8]"
"[Dog] - Var is: [13425.1,13228.8,0]"
"[Dog] - Tmp Pos is: [10240,10240,800]"
"[Dog] - Var is: [13425.1,13228.8,0]"
"[Dog] - Tmp Pos is: [10240,10240,800]"
"[Dog] - Var is: [13425.1,13228.8,0]"
"[Dog] - Tmp Pos is: [10240,10240,800]"

 

It will continue to output the same Position over and over and over....

 

It will also malfunction, if i call it to often, without the step inbetween like in the following example:

diag_log format ["[Dog] - Var is: %1",(_array select 0)];

_tmpPos =  [(_array select 0), 1, 5, 3, 1, 20, 0] call BIS_fnc_findSafePos;

diag_log format ["[Dog] - Tmp Pos is: %1",_tmpPos];

My Solution is to simply wait a large amount of Time, before calling that script again or don't use it at all. If you need to spawn something it`s alright, because the script is just called once, but if you do it a lot i suggest you use nearObjects to check, if it`s a good position.

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

×