Jump to content
killzone_kid

[FEEDBACK] Do you use BIS_fnc_xxxxx functions? If you do....

Recommended Posts

Hi!

 

I think spawnGroup should have implemented some delay and be spawned, as it freezes the game for a sec everytime you use it.

 

Very used functions (among others, I use a lot):

 

selectRandom (someone said it should be a command and I agree if it adds performance) 

dirTo

arrayShuffle

relPos

MP

spawnVehicle (dont ask me why, vehicles respond better to WPs than just creating vehicles and units)

 

 

For heavy functions like BIS_fnc_spawnGroup, try spawning them instead of calling, then a waitUntil scriptDone to hold the initial script until the group has spawned.

_spawnGroup = [args] spawn BIS_fnc_spawnGroup
waitUntil {scriptDone _spawnGroup};

Share this post


Link to post
Share on other sites

If requests are allowed, I think a BIS_fnc_arraySwitch could prove very useful. Something like :  [array, [2,5], [7,9]] call BIS_fnc_arraySwitch would help me a lot in my current project.

Share this post


Link to post
Share on other sites

If requests are allowed, I think a BIS_fnc_arraySwitch could prove very useful. Something like :  [array, [2,5], [7,9]] call BIS_fnc_arraySwitch would help me a lot in my current project.

 

 

 

 

If BI can create such a function, so can you.

Share this post


Link to post
Share on other sites

To all: Could you please post example params you use for BIS_fnc_findSafePos?

Share this post


Link to post
Share on other sites

To dynamically find flat positions for choppers to land and unload troops. Works well, never seen weird things.

 

_landpos = [_posdestino, 300, 500, 10, 0, 0.3, 0] call BIS_Fnc_findSafePos;

Share this post


Link to post
Share on other sites

 

For heavy functions like BIS_fnc_spawnGroup, try spawning them instead of calling, then a waitUntil scriptDone to hold the initial script until the group has spawned.

_spawnGroup = [args] spawn BIS_fnc_spawnGroup
waitUntil {scriptDone _spawnGroup};

 

Can you believe I've never thought about that? Thanks! will check it!!

Share this post


Link to post
Share on other sites

To all: Could you please post example params you use for BIS_fnc_findSafePos?

 

_foundSpawnPos = FALSE;
for '_x' from 0 to 49 step 1 do {
     _spawnPos = [_centerPos,700,1200,10,0,0.5,0] call BIS_fnc_findSafePos;
          if ((count _spawnPos) > 0) then {
               if (({((_x distance _spawnPos) < 400)} count allPlayers) isEqualTo 0) then {
                    if ((_spawnPos distance2D _centerPos) < 1201) then {          // incase it selects the safePositionAnchor pos instead of doing its job
                         _foundSpawnPos = TRUE;
                    };
               };
          };
     if (_foundSpawnPos) exitWith {};
};

Share this post


Link to post
Share on other sites

On Monday, the following commands should be extended/added to the DEV branch:

 

https://community.bistudio.com/wiki/getDir => BIS_fnc_dirTo

https://community.bistudio.com/wiki/getRelDir => BIS_fnc_relativeDirTo

https://community.bistudio.com/wiki/getPos => BIS_fnc_relPos

https://community.bistudio.com/wiki/getRelPos

 

Please test if working correctly

  • Like 8

Share this post


Link to post
Share on other sites

On Monday, the following commands should be extended/added to the DEV branch:

 

https://community.bistudio.com/wiki/getDir => BIS_fnc_dirTo

https://community.bistudio.com/wiki/getRelDir => BIS_fnc_relativeDirTo

https://community.bistudio.com/wiki/getPos => BIS_fnc_relPos

https://community.bistudio.com/wiki/getRelPos

 

Please test if working correctly

 

Awesome news.

Share this post


Link to post
Share on other sites

Please test if working correctly

Seem to work just as intended. Good, good stuff.. :)

 

Maybe the commands 'direction' and 'position' should also be extended with the new getDir/getPos functionality since they are the same commands anyway?

Share this post


Link to post
Share on other sites

 

Please test if working correctly

 

Great stuff! Works like a charm.

Share this post


Link to post
Share on other sites

Awesome. Will be interesting to see if I can improve the performance of some of my scripts.

Share this post


Link to post
Share on other sites

Awesome, really appreciated additions :)

Keep 'em coming guys :627: (the lists are still long ;) :P )

 

 

 

Although kinda off-topic, one thing that came to mind since there's now the new _thisScript and _thisFSM whatchamacallits added would it be possible to add _thisParentFile or something (kinda what the functions get, _fnc_scriptNameParent) that would return the script/function/fsm that executed the given script/function/fsm and then update BIS_fnc_log family of functions to utilize those, would be a tad easier to do debugging with massively scripted stuff..?

Share this post


Link to post
Share on other sites

BIS_fnc_findSafePos

useful. but could be better.

it doesn't always find the safepos and might deposit units in rocks or sea despite the option not to be near water. a fundamental that could be improved imo.

Share this post


Link to post
Share on other sites

Hi just a question from a curious ignorant mission maker.

 

I assume perforamce improvements comparing a command than using a function.

 

Is it quantifyied? How much?

Share this post


Link to post
Share on other sites

Depends on complexity of a function, if I were to take an average guess... makes things run around x10 faster?

  • Like 2

Share this post


Link to post
Share on other sites

I'm not sure if there's a respective BIS function, but it's be nice to have some kind of command like so:

 

{ _x % 2 != 0 } filter [0,1,2,3,4,5];

 

Whereby any element that returns false is removed from the array. Currently there's no convenient way to do this using forEach and deleteAt (and modifying an array while iterating over it is sketchy at the best of times in any language).

Share this post


Link to post
Share on other sites
I'm not sure if there's a respective BIS function,
[ [0,1,2,3,4,5], [], {_x}, "ASCEND", { _x % 2 != 0 } ] call BIS_fnc_sortBy

It was something i was hoping would of been addressed by the inclusion of the sort command or a sortBy command but at the moment BIS_fnc_sortBy is closest your going to get i think.

  • Like 1

Share this post


Link to post
Share on other sites

Tweaked: Some of the frequently used functions have been optimised due to the availability of new engine script commands. The optimisation work is still ongoing so if you have any suggestions, please leave them here.

  • Tweaked: Optimised script headers
  • Tweaked: Optimised Vector functions
  • Tweaked: Optimised Array functions
  • Tweaked: Optimised Config functions
  • Tweaked: Optimised Geometry functions
  • Tweaked: Optimised Number functions
  • Tweaked: Optimised Strings functions
  • Tweaked: Optimised Vehicles functions
  • Tweaked: Optimised Sides functions
  • Tweaked: Optimised Misc functions
  • Tweaked: Secure variables swapping
  • Tweaked: BIS_fnc_rscLayer optimised, new storage format
  • Tweaked: BIS_fnc_camera modified to accept new a BIS_fnc_rscLayer format
  • Tweaked: BIS_fnc_codePerformance improved, removed possible interference with tested code
  • Tweaked: BIS_fnc_error no longer will break when the message contains HTML-like symbols
  • Tweaked: BIS_fnc_returnConfigEntry now has better handling of undefined input
  • Added: BIS_fnc_deleteCounter to complement the BIS_fnc_counter function

 

 

 

Awesome!

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

×