Closed sarogahtyp closed 3 years ago
after looking at sources of CBAs taskDefend and getPos it seems not to be a bug but intended behavior. But the wiki is misleading: https://cbateam.github.io/CBA_A3/docs/files/ai/fnc_taskDefend-sqf.html If one reads it one could think the ARRAY could be an array of positions or objects etc. meant is a position array. maybe that should be clarified better in the wiki.
ARRAY is the type of the various Position3D and Position2D tuples. I think the doc is clear. Use selectRandom
to make a random choice for this EG functions.
Clear? Maybe. But you could avoid confusions like you can see in BI-Forum post with a better labelling. But thats your choice.
Edit: fixed link ~commy2
sorry I linked wrong. this post and below
Mods (complete and add to the following information):
Description: if the position parameter is an array which contains positions or objects (mixed not tested) then the function will always choose the first element of that array and therefore the AI defends that position only
Steps to reproduce:
Expected behavior: group should randomly choose between gar1, gar2 and gar3
Where did the issue occur?
Additional context: Workaround is currently: [ this, selectRandom [ gar1, gar2, gar3 ], 15 ] call CBA_fnc_taskDefend