hehe, moderators answering galore..ahem.
Considerations: if your ambush is spotted (for instance you run out and get yourself seen) you wouldn't want your men to just sit around in old combatmode blue and get slaughtered, or even worse, lie helplessly while setcaptivated soldiers run amok amongst them? So, what you need is an OR syntax. Let's say the trigger in the middle of the road is:
Activated By: East
Condition: "_x in thisList" count units e_group1 >0
on Activation: leader w_group1 SetCombatMode "YELLOW"; leader w_group1 setBehaviour "Combat"
euhm. So that as soon as at least one of the members of e_group1 are within the trigger radius (as long as they're east, that is
), the trigger activates. And it makes the leader (and thus the whole group) of w_group1 to go to "Open fire" and "Combat" modes. I would suggest Artaks solution with the combat mode "BLUE", it's easiest :thumbsup: Also make their Behaviour "Stealth" and they'll keep their heads down.
Anyhow, ahem. The easiest way to see if the other teams seen you (or, if not seen you, heard you) is by gauging their behaviour -> if the enemy team is in safe mode, it's damned easy to make a condition stating: (behaviour leader e_group1) !="safe". At least I think that's the syntax :-\
so, add to the condition:
Condition: "_x in thisList" count units e_group1 >0 OR behaviour (leader e_group1) !="safe"
and, ta-da, if you're spotted/you shoot at him, the trigger will activate even if the ambush is spoiled...at least you won't lie around like vegetables ;D
Another way might be to use some kind of knowsAbout or somesuch. But I think the above would work the best. I think behaviour goes to "Combat" in most AI cases directly, so even if the enemy group is on Aware it might work... :toocool:
Alright. I'm getting inspired by you here Artak...must...write...scripts...
Wolfrug out.