I am having trouble combining multiple arrays in to one larger array. I was trying to move four groups into an array, count the number of units in that array, then activate a trigger to be TRUE when the array count reaches 0. It works fine when i use only one group(variables _a and _aunits) and remove the rest from the script, but when i add more groups the combined array value always seems to equal 0.
this works:
_a = _this Select 0
#Here
_aunits = units _a
_bigarray = _aunits
_j = count _bigarray
~5
?_j>=1: goto "Here"
?_j<=0: Hint "Script works"
condition01 = True
~5
exit
but this doesn't:
_a = _this Select 0
_b = _this Select 1
_c = _this Select 2
_d = _this Select 3
#Here
_aunits = units _a
_bunits = units _b
_cunits = units _c
_dunits = units _d
_bigarray = [_aunits + _bunits + _cunits + _dunits]
_j = count _bigarray
~5
?_j>=1: goto "Here"
?_j<=0: Hint "Script works"
condition01 = True
~5
exit
maybe just a syntax error.....but a few seconds after i start the mission the trigger is activated by condition01 = true
also i want to use this as a generic script so if I had 4 variable and only wanted to use one group , would i execute it like this:
[wave1group,grpnull,grpnull,grpnull] exec "script.sqs"
???
when i try :
[wave1group] exec "script.sqs"
i get an error say that _b , _c , and _d expect a group or unit, not a number. i guess if i leave it blank it uses 0 .