nullsys 10 Posted December 17, 2014 Expected: To find a location, between 2000 & 5000 meters, relatively flat, on land and with 1 meter of space around it. Create a device, place the device and the player in that location for testing purposes. Reality: This works 100% of the time via Debug and "Local Exec" while in game. This works maybe 3/4 times through SQF. All tested locally through the editor. sndObjects = ["Land_Device_disassembled_F","Land_Device_assembled_F"]; sndObject = sndObjects call BIS_fnc_selectRandom; _pos = [getpos player,2000,5000,1,0,0.7,0,[],[(getpos player),(getpos player)]] call BIS_fnc_findSafePos; hint str _pos; sndChecker = sndObject createVehicle _pos; player setpos _pos; Can someone please explain why this works every time through the debug scripting, but not every time in SQF scripts? Share this post Link to post Share on other sites
jshock 513 Posted December 17, 2014 What is "wrong" the 1/4 of the time it doesn't work? Share this post Link to post Share on other sites
nullsys 10 Posted December 17, 2014 What is "wrong" the 1/4 of the time it doesn't work? Sorry, I forgot to mention. Absolutely nothing happens with _pos. Nothing is returned from the function BIS_fnc_findSafePos. It's almost like it doesn't find a "safe place" and that's the end of it. Yet, I have tested this by placing the player in the desert to the east, making sure the distance is short, and it will absolutely return a new position while using the debug option in "preview". As soon as I go back to trying it through a SQF, nothing is returned roughly 1/4 of the time. Share this post Link to post Share on other sites
jshock 513 Posted December 17, 2014 How are you executing the script (via trigger, etc.)? And make sure to have -showScriptErrors enabled on your Steam startup parameters to make sure it doesn't error out 1/4 of the time. Share this post Link to post Share on other sites
Grumpy Old Man 3549 Posted December 18, 2014 BIS_fnc_findSafePos won't always find safe positions and sometimes choose some weird predefined positions from the maps config, most of them seem to be mid-air. Why not just use isFlatEmpty instead? Share this post Link to post Share on other sites
nullsys 10 Posted December 19, 2014 BIS_fnc_findSafePos won't always find safe positions and sometimes choose some weird predefined positions from the maps config, most of them seem to be mid-air.Why not just use isFlatEmpty instead? Thank you! Giving it a test now, and looking at the scripting for them from the configs. Nice to know it's not just me being mad. Share this post Link to post Share on other sites