Jump to content

Recommended Posts

I rarely script too in depth when i make scenarios,but in this case i want to try to understand why this array wont work.

 

So the script im using is CBA defend,which garrisons groups,in this case in the radius of a named object.From the CBA github,position info reads like this:

centre of area to defend <ARRAY, OBJECT, LOCATION, GROUP> (Default: _group)

Here is my syntax

 

[this,fe,150,3,0.1,0.9] call CBA_fnc_taskDefend

"fe" is the position,works fine.Bu when i try to enter an array of positions(named objects) i get no error but the group selects always the first named object in the array.like so...

 

[this,[fe,de,ge],150,3,0.1,0.9] call CBA_fnc_taskDefend

de and ge are other objects,but they are never being chosen. Does the array need to be classified in some way first? If so how? im simly calling this from a waypoints activation.Any insight welcome.

 

Share this post


Link to post
Share on other sites
1 hour ago, sarogahtyp said:

I tested it and it seems to be a cba bug for me.

you can fix it easily by using selectRandom:

 


[ this, selectRandom [ fe, de, ge ], 150, 3, 0.1, 0.9 ] call CBA_fnc_taskDefend

 

Edit:

I created a bug report here: https://github.com/CBATeam/CBA_A3/issues/1463

your a legend. Had no idea it was a bug and i was using it correctly after all. Awesome to know and thanks for the workaround

Share this post


Link to post
Share on other sites
11 hours ago, sarogahtyp said:

seems not to be a bug but a misleading wiki entry.

 

see my post on github for further information:

https://github.com/CBATeam/CBA_A3/issues/1463#issuecomment-857879864

Cant test this rite now but the select random should also work for search area function correct?

 

[this, "Mark1"] call CBA_fnc_taskSearchArea;

"Mark1" would be a marker in this instance not an object.Issue is if you give a garrison random select and say,start a group far away,the chance of patrol param causes leader to patrol in safe(even if chance 0 leader seems to patrol anyway) and it means he will start in safe mode far from garrison area and walk slowly to location where as rest of squad moves there with normal speed.

 

Just tested 

[this, selectRandom ["pat2","pat3","pat5"]] call CBA_fnc_taskSearchArea;

works very well

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

×