Ok, done some testing /changing. Found out I was doing all kinds of things wrong.
Wdefenders, Wreserve, Edefenders etc are all arrays of groups I have created. They are all defined in a script "definitions.sqs" which is called by a 'true' trigger at the start like so
;define the defending, advanced, and reserve groups:
Wdefenders = [Wdefender1, Wdefender2, Wdefender3, Wdefender4, WSU1]
Edefenders = [Edefender1, Edefender2, Edefender3, Edefender4, Edefender5, Edefender6, ESU1]
Wreserve = [Wreserve1, Wreserve2, Wreserve3, Wreserve4, Wreserve5]
Ereserve = [Ereserve1, Ereserve2, Ereserve3, Ereserve4, Ereserve5]
Wadvanced = [Wadvanced1, Wadvanced2, Wadvanced3, Wadvanced4]
Eadvanced = [Eadvanced1, Eadvanced2, Eadvanced3, Eadvanced4]
Wall = [Wdefender1, Wdefender2, Wdefender3, Wdefender4, WSU1, Wreserve1, Wreserve2, Wreserve3, Wreserve4, Wreserve5, Wadvanced1, Wadvanced2, Wadvanced3, Wadvanced4]
Eall = [Edefender1, Edefender2, Edefender3, Edefender4, Edefender5, Edefender6, ESU1, Ereserve1, Ereserve2, Ereserve3, Ereserve4, Ereserve5, Eadvanced1, Eadvanced2, Eadvanced3, Eadvanced4]
Ok, so far, so good.
Because they are arrays, I changed my other scripts to look like this (eYellow - yellow alert, causes appropriate units to go to where enemy has been seen intruding);
; First, checks to see if the red triggers have been set off, exits
; if they have. Otherwise
; eYellow.sqs - this will detect who set the trigger off, and send the response
; group their position by setting a waypoint at the position. (hopefully)
if ealertr then {exit}
_unit = _this select 0
_pos = getPos _unit
[move _pos] forEach Edefenders
[setSpeedMode "FULL"] forEach Edefenders
[move _pos] forEach Ereserve
[setSpeedMode "FULL"] forEach Ereserve
now, when called in the game, i get an error:
"[setSpeedMode "FULL"] forEach Edefenders" error, unknown operator...
Im lost, any ideas anyone?
Thanks.