Q1: Don't know about that. It seems that the Foreach
- is missing the rest of the code for it. Also, if you are trying to create variables with the format function, then try use "call format...".
Q2: Yes. This is the correct syntax:
{if (side _x == east) then { _x setDammage 1}} forEach _allunits
I'm not sure if your way works because I always use the "if" statement.
Q3: { and " are interchangeable.
Here's a rather ugly example of foreach. This is the onactivation line of a "East present" trigger which covers three spetz naz teams. I wanted to change their weapons by removing the satchel charges and adding handgrenades and Scorpions. As you can see, it has nested foreach commands.
expActiv="{_su=_x;_b=magazines _x;{_su removeMagazine ""pipebomb"";if ({_x==""HandGrenade""} count magazines _su <4) then {_su addMagazine ""handgrenade"";_su addMagazine ""Skorpionmag""}} foreach _b;_x addWeapon ""skorpion""} forEach thislist";
Ugly... yes, effective... yes. One line to change the weapons for three, four man squads. It removes the three satchel charges, adds four handgrenades and four scorpion mags and one scorpion. But does not touch the primary weapon.