CBATeam / CBA_A3

Community Base Addons for Arma 3
https://github.com/CBATeam/CBA_A3/wiki
GNU General Public License v2.0
365 stars 149 forks source link

CBA_fnc_taskDefend picks always first position if array was given #1463

Closed sarogahtyp closed 3 years ago

sarogahtyp commented 3 years ago

Mods (complete and add to the following information):

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

sarogahtyp commented 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.

commy2 commented 3 years ago

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.

sarogahtyp commented 3 years ago

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

commy2 commented 3 years ago

The actual form post, I assume.

sarogahtyp commented 3 years ago

sorry I linked wrong. this post and below