Jump to content
jllew5

Activate trigger when separate unit in contact

Recommended Posts

Hello all!

 

I've been wanting to try my hand at some Arma 3 machinima, and I'm having a little trouble with trigger activation. I have two units (one AT team, and another rifle squad) operating near each other, with an OPFOR convoy expected to pass through on a road across a valley. I have the AT team move up and go stealth within site of the engagement area, then have a SCRIPTED waypoint to setCombatMode/setBehaviour so they attack the convoy (when OPFOR crosses a threshold, as per usual). That part works well.

Where I'm having trouble is the rifle team: I would like them to stay stationary a 20-30 meters behind the AT team, and out of sight UNTIL the AT team starts firing rockets. At which point, the goal is to have them move up and engage as well. I've thought of a couple ways to do this, but not having much success. One thing I'm trying at the moment is have the rifle squad (unit2) spawn w Force Hold Fire and crouched, place a MOVE waypoint to bring them into contact, and link it to a trigger condition like:
 

waitUntil {
combatMode unit1 in ["RED"];
};

... where unit1 is the AT team. However, I'm getting an error: "Condition: Type Nothing, Expected Bool". I'm sure there's likely a more "elegant" way to accomplish the end goal, but part of this effort is to learn the scripting language and syntax. Another option I'd like to explore when I get this figured out is to get a count of all rockets in the AT teams inventory, then set a condition to check when they drop below the initial number.

Any help is greatly appreciated! Thanks!

Share this post


Link to post
Share on other sites

Simple. In a trigger, the condition is checked (by default) everery 0.5 sec. (you can change this value by scripting trigger instead of editing it).

So, your condition field MUST return a boolean (TRUE/FALSE). You do not have to write a waitUntil:

 

combatMode unit1 isEqualTo "RED"      (or == "red" , works also because == is not case sensitive as are: isEqualTo ... or in for an array of strings)

 

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

×